Skip to content

Commit aa8633f

Browse files
committed
(maint) Plugins don't exist on 5.1; password field name changed
1 parent e0e0c0f commit aa8633f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/acceptance/types/mysql_user_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'spec_helper_acceptance'
2+
require_relative './mysql_helper.rb'
23

34
describe 'mysql_user' do
45
describe 'setup' do
@@ -44,7 +45,7 @@ class { 'mysql::server': }
4445
end
4546
end
4647

47-
describe 'changing authentication plugin' do
48+
describe 'changing authentication plugin', :if => version_is_greater_than('5.2.0') do
4849
it 'should work without errors' do
4950
pp = <<-EOS
5051
mysql_user { 'ashp@localhost':
@@ -63,7 +64,12 @@ class { 'mysql::server': }
6364
end
6465

6566
it 'should not have a password' do
66-
shell("mysql -NBe \"select password from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
67+
table = if version_is_greater_than('5.7.0')
68+
"authentication_string"
69+
else
70+
"password"
71+
end
72+
shell("mysql -NBe \"select #{table} from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
6773
expect(r.stdout.rstrip).to be_empty
6874
expect(r.stderr).to be_empty
6975
end

0 commit comments

Comments
 (0)