You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit, the Ubuntu 20.04 spec testing was failing two test cases at mysql_grant_spec. One of them was a simple mismatch between the expected stdout and actual stdout of the test case, and the other had to do with a misbehavior from the module at the time of granting privileges to users.
The module upon retrieving the current privileges accounted only for the original static privileges and not the dynamic privileges added in newer mysql versions, causing an error in the code that is used to condense the array of privileges that make up `ALL` into a single statement.
The code which condenses the returned privileges into a simple `ALL` has now been updated correctly trigger when dynamic privileges are in effect, avoiding this issue and ensuring idempotency.
# Currently there is an issue with the behaviour of the module which was highlighted by the 'complex test' test case in 'mysql_grant_spec'. The module, upon retrieving all privileges from an
72
+
# user, does not take into account that the latest version of mysql now includes dynamic privileges which are returned alongside the original static privileges and are set by 'ALL PRIVILEGES'
73
+
# (shortened to 'ALL'). This is a workaround to remove the unnecesary privileges from the sorted_privileges list which is used to check for idempotency in test cases.
Copy file name to clipboardExpand all lines: spec/acceptance/types/mysql_grant_spec.rb
+1-1
Original file line number
Diff line number
Diff line change
@@ -464,7 +464,7 @@ class { 'mysql::server':
464
464
465
465
it'finds the user #stdout'do
466
466
run_shell('mysql -NBe "SHOW GRANTS FOR proxy1@tester"')do |r|
467
-
expect(r.stdout).tomatch(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO ['|`]proxy1['|`]@['|`]tester['|`]})
467
+
expect(r.stdout).tomatch(%r{GRANT USAGE ON *.* TO ['|`]proxy1['|`]@['|`]tester['|`]\nGRANT PROXY ON ['|`]proxy_user['|`]@['|`]proxy_host['|`] TO ['|`]proxy1['|`]@['|`]tester['|`]\n})
0 commit comments