Skip to content

Commit 169ffbd

Browse files
author
David Swan
committed
(maint) - Test updates
1 parent abe54e8 commit 169ffbd

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

spec/acceptance/types/mysql_grant_spec.rb

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class { 'mysql::server':
7575

7676
it 'finds the user #stdout' do
7777
result = run_shell('mysql -NBe "SHOW GRANTS FOR test2@tester"')
78-
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE.*TO 'test2'@'tester'})
78+
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE.*TO ['|`]test2['|`]@['|`]tester['|`]})
7979
expect(result.stderr).to be_empty
8080
end
8181
end
@@ -99,7 +99,7 @@ class { 'mysql::server':
9999

100100
it 'finds the user #stdout' do
101101
result = run_shell("mysql -NBe \"SHOW GRANTS FOR 'test-2'@tester\"")
102-
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE.*TO 'test-2'@'tester'})
102+
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE.*TO ['|`]test-2['|`]@['|`]tester['|`]})
103103
expect(result.stderr).to be_empty
104104
end
105105
end
@@ -124,7 +124,7 @@ class { 'mysql::server':
124124

125125
it 'finds the user #stdout' do
126126
result = run_shell('mysql -NBe "SHOW GRANTS FOR test3@tester"')
127-
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE ON `test`.* TO 'test3'@'tester' WITH GRANT OPTION$})
127+
expect(result.stdout).to contain(%r{GRANT SELECT, UPDATE ON `test`.* TO ['|`]test3['|`]@['|`]tester['|`] WITH GRANT OPTION$})
128128
expect(result.stderr).to be_empty
129129
end
130130
end
@@ -168,7 +168,7 @@ class { 'mysql::server':
168168

169169
it 'finds the user #stdout' do
170170
result = run_shell('mysql -NBe "SHOW GRANTS FOR test4@tester"')
171-
expect(result.stdout).to contain(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test4'@'tester' WITH GRANT OPTION})
171+
expect(result.stdout).to contain(%r{GRANT ALL PRIVILEGES ON `test`.* TO ['|`]test4['|`]@['|`]tester['|`] WITH GRANT OPTION})
172172
expect(result.stderr).to be_empty
173173
end
174174
end
@@ -233,34 +233,34 @@ class { 'mysql::server':
233233

234234
it 'finds short hostname #stdout' do
235235
result = run_shell('mysql -NBe "SHOW GRANTS FOR test@short"')
236-
expect(result.stdout).to contain(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'short'})
236+
expect(result.stdout).to contain(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]short['|`]})
237237
expect(result.stderr).to be_empty
238238
end
239239

240240
it 'finds long hostname #stdout' do
241241
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'long.hostname.com'\"") do |r|
242-
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'long.hostname.com'})
242+
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]long.hostname.com['|`]})
243243
expect(r.stderr).to be_empty
244244
end
245245
end
246246

247247
it 'finds ipv4 #stdout' do
248248
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'192.168.5.6'\"") do |r|
249-
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'192.168.5.6'})
249+
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]192.168.5.6['|`]})
250250
expect(r.stderr).to be_empty
251251
end
252252
end
253253

254254
it 'finds ipv6 #stdout' do
255255
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'2607:f0d0:1002:0051:0000:0000:0000:0004'\"") do |r|
256-
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'2607:f0d0:1002:0051:0000:0000:0000:0004'})
256+
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]2607:f0d0:1002:0051:0000:0000:0000:0004['|`]})
257257
expect(r.stderr).to be_empty
258258
end
259259
end
260260

261261
it 'finds short ipv6 #stdout' do
262262
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'::1/128'\"") do |r|
263-
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'::1\/128'})
263+
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]::1\/128['|`]})
264264
expect(r.stderr).to be_empty
265265
end
266266
end
@@ -376,8 +376,7 @@ class { 'mysql::server':
376376
}
377377
MANIFEST
378378
it 'create lowercase all privs' do
379-
result = apply_manifest(pp_two, catch_failures: true)
380-
expect(result.exit_code).to eq(0)
379+
apply_manifest(pp_two, catch_changes: true)
381380
end
382381
end
383382

@@ -405,7 +404,7 @@ class { 'mysql::server':
405404

406405
it 'finds the user #stdout' do
407406
result = run_shell('mysql -NBe "SHOW GRANTS FOR test2@tester"')
408-
expect(result.stdout).to match(%r{GRANT EXECUTE ON PROCEDURE `mysql`.`simpleproc` TO 'test2'@'tester'})
407+
expect(result.stdout).to match(%r{GRANT EXECUTE ON PROCEDURE `mysql`.`simpleproc` TO ['|`]test2['|`]@['|`]tester['|`]})
409408
expect(result.stderr).to be_empty
410409
end
411410
end
@@ -436,7 +435,7 @@ class { 'mysql::server':
436435
# rubocop:enable RSpec/ExampleLength
437436
it 'finds the user' do
438437
result = run_shell('mysql -NBe "SHOW GRANTS FOR test3@tester"')
439-
expect(result.stdout).to match(%r{GRANT EXECUTE ON FUNCTION `mysql`.`simplefunc` TO 'test3'@'tester'})
438+
expect(result.stdout).to match(%r{GRANT EXECUTE ON FUNCTION `mysql`.`simplefunc` TO ['|`]test3['|`]@['|`]tester['|`]})
440439
expect(result.stderr).to be_empty
441440
end
442441
# rubocop:enable RSpec/MultipleExpectations
@@ -464,7 +463,7 @@ class { 'mysql::server':
464463

465464
it 'finds the user #stdout' do
466465
run_shell('mysql -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
467-
expect(r.stdout).to match(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO 'proxy1'@'tester'})
466+
expect(r.stdout).to match(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO ['|`]proxy1['|`]@['|`]tester['|`]})
468467
expect(r.stderr).to be_empty
469468
end
470469
end
@@ -489,7 +488,7 @@ class { 'mysql::server':
489488

490489
it 'finds the user #stdout' do
491490
run_shell('mysql -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
492-
expect(r.stdout).not_to match(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO 'proxy1'@'tester'})
491+
expect(r.stdout).not_to match(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO ['|`]proxy1['|`]@['|`]tester['|`]})
493492
expect(r.stderr).to be_empty
494493
end
495494
end
@@ -617,7 +616,7 @@ class { 'mysql::server':
617616

618617
it 'finds ipv4 #stdout' do
619618
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'192.168.5.7'\"") do |r|
620-
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'192.168.5.7'})
619+
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO ['|`]test['|`]@['|`]192.168.5.7['|`]})
621620
expect(r.stderr).to be_empty
622621
end
623622
end

0 commit comments

Comments
 (0)