Skip to content

(MODULES-11594) Fix SLES-15 nightly errors #1679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,16 @@
}
}

$skip_ssl = $facts['os']['release']['major'] =~ /^15/ ? {
true => true,
false => undef,
}

$default_options = {
'client' => {
'port' => '3306',
'socket' => $mysql::params::socket,
'skip-ssl' => $skip_ssl,
},
'mysqld_safe' => {
'nice' => '0',
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/types/mysql_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class { 'mysql::server': }
end

it 'finds the database #stdout' do
run_shell("mysql -NBe \"SHOW DATABASES LIKE 'spec_db'\"") do |r|
run_shell("mariadb -NBe \"SHOW DATABASES LIKE 'spec_db'\"") do |r|
expect(r.stdout).to match(%r{^spec_db$})
expect(r.stderr).to be_empty
end
Expand All @@ -48,14 +48,14 @@ class { 'mysql::server': }
end

it 'finds latin1 db #stdout' do
run_shell("mysql -NBe \"SHOW VARIABLES LIKE '%_database'\" spec_latin1") do |r|
run_shell("mariadb -NBe \"SHOW VARIABLES LIKE '%_database'\" spec_latin1") do |r|
expect(r.stdout).to match(%r{^character_set_database\tlatin1\ncollation_database\tlatin1_swedish_ci$})
expect(r.stderr).to be_empty
end
end

it 'finds utf8 db #stdout' do
run_shell("mysql -NBe \"SHOW VARIABLES LIKE '%_database'\" spec_utf8") do |r|
run_shell("mariadb -NBe \"SHOW VARIABLES LIKE '%_database'\" spec_utf8") do |r|
expect(r.stdout).to match(%r{^character_set_database\tutf8(mb3)?\ncollation_database\tutf8(mb3)?_general_ci$})
expect(r.stderr).to be_empty
end
Expand Down
50 changes: 25 additions & 25 deletions spec/acceptance/types/mysql_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class { 'mysql::server':
end

it 'does not find the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR test1@tester"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR test1@tester"', expect_failures: true)
expect(result.stderr).to contain(%r{There is no such grant defined for user 'test1' on host 'tester'})
end
end
Expand All @@ -53,7 +53,7 @@ class { 'mysql::server':
end

it 'does not find the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR atest@tester"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR atest@tester"', expect_failures: true)
expect(result.stderr).to contain(%r{There is no such grant defined for user 'atest' on host 'tester'})
end
end
Expand All @@ -76,7 +76,7 @@ class { 'mysql::server':
end

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

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

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

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

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

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

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

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

it 'finds short ipv6 #stdout' do
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'::1/128'\"") do |r|
run_shell("mariadb -NBe \"SHOW GRANTS FOR 'test'@'::1/128'\"") do |r|
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON ['|`]test['|`].* TO ['|`]test['|`]@['|`]::1/128['|`]})
expect(r.stderr).to be_empty
end
Expand All @@ -279,9 +279,9 @@ class { 'mysql::server':
}

exec { 'mysql-create-table':
command => '/usr/bin/mysql -NBe "CREATE TABLE foo.bar (name VARCHAR(20))"',
command => '/usr/bin/mariadb -NBe "CREATE TABLE foo.bar (name VARCHAR(20))"',
environment => "HOME=${::root_home}",
unless => '/usr/bin/mysql -NBe "SELECT 1 FROM foo.bar LIMIT 1;"',
unless => '/usr/bin/mariadb -NBe "SELECT 1 FROM foo.bar LIMIT 1;"',
require => Mysql_database['foo'],
}

Expand Down Expand Up @@ -387,7 +387,7 @@ class { 'mysql::server':
describe 'adding procedure privileges' do
pp = <<-MANIFEST
exec { 'simpleproc-create':
command => 'mysql --user="root" --password="password" --database=mysql --delimiter="//" -NBe "CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT(*) INTO param1 FROM t; end//"',
command => 'mariadb --user="root" --password="password" --database=mysql --delimiter="//" -NBe "CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT(*) INTO param1 FROM t; end//"',
path => '/usr/bin/',
before => Mysql_user['test2@tester'],
}
Expand All @@ -407,7 +407,7 @@ class { 'mysql::server':
end

it 'finds the user #stdout' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR test2@tester"')
result = run_shell('mariadb -NBe "SHOW GRANTS FOR test2@tester"')
expect(result.stdout).to match(%r{GRANT EXECUTE ON PROCEDURE `mysql`.`simpleproc` TO ['|`]test2['|`]@['|`]tester['|`]})
expect(result.stderr).to be_empty
end
Expand All @@ -417,7 +417,7 @@ class { 'mysql::server':
it 'works without errors' do
pp = <<-MANIFEST
exec { 'simplefunc-create':
command => '/usr/bin/mysql --user="root" --password="password" --database=mysql -NBe "CREATE FUNCTION simplefunc (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT(\\'Hello, \\', s, \\'!\\')"',
command => '/usr/bin/mariadb --user="root" --password="password" --database=mysql -NBe "CREATE FUNCTION simplefunc (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT(\\'Hello, \\', s, \\'!\\')"',
before => Mysql_user['test3@tester'],
}

Expand All @@ -438,7 +438,7 @@ class { 'mysql::server':
end

it 'finds the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR test3@tester"')
result = run_shell('mariadb -NBe "SHOW GRANTS FOR test3@tester"')
expect(result.stdout).to match(%r{GRANT EXECUTE ON FUNCTION `mysql`.`simplefunc` TO ['|`]test3['|`]@['|`]tester['|`]})
expect(result.stderr).to be_empty
end
Expand All @@ -463,7 +463,7 @@ class { 'mysql::server':
end

it 'finds the user #stdout' do
run_shell('mysql -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
run_shell('mariadb -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
expect(r.stdout).to match(%r{GRANT USAGE ON *.* TO ['|`]proxy1['|`]@['|`]tester['|`]\nGRANT PROXY ON ['|`]proxy_user['|`]@['|`]proxy_host['|`] TO ['|`]proxy1['|`]@['|`]tester['|`]\n})
expect(r.stderr).to be_empty
end
Expand All @@ -488,7 +488,7 @@ class { 'mysql::server':
end

it 'finds the user #stdout' do
run_shell('mysql -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
run_shell('mariadb -NBe "SHOW GRANTS FOR proxy1@tester"') do |r|
expect(r.stdout).not_to match(%r{GRANT PROXY ON 'proxy_user'@'proxy_host' TO ['|`]proxy1['|`]@['|`]tester['|`]})
expect(r.stderr).to be_empty
end
Expand All @@ -514,7 +514,7 @@ class { 'mysql::server':
end

it 'does not find the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR proxy2@tester"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR proxy2@tester"', expect_failures: true)
expect(result.stderr).to match(%r{There is no such grant defined for user 'proxy2' on host 'tester'})
end
end
Expand All @@ -538,7 +538,7 @@ class { 'mysql::server':
end

it 'does not find the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR proxy2@tester"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR proxy2@tester"', expect_failures: true)
expect(result.stderr).to match(%r{There is no such grant defined for user 'proxy2' on host 'tester'})
end
end
Expand All @@ -562,7 +562,7 @@ class { 'mysql::server':
end

it 'does not find the user' do
result = run_shell('mysql -NBe "SHOW GRANTS FOR proxy3@tester"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR proxy3@tester"', expect_failures: true)
expect(result.stderr).to contain(%r{There is no such grant defined for user 'proxy3' on host 'tester'})
end
end
Expand Down Expand Up @@ -609,13 +609,13 @@ class { 'mysql::server':

it 'fails with fqdn' do
unless Gem::Version.new(mysql_version) > Gem::Version.new('5.7.0')
result = run_shell('mysql -NBe "SHOW GRANTS FOR test@fqdn.com"', expect_failures: true)
result = run_shell('mariadb -NBe "SHOW GRANTS FOR test@fqdn.com"', expect_failures: true)
expect(result.stderr).to contain(%r{There is no such grant defined for user 'test' on host 'fqdn.com'})
end
end

it 'finds ipv4 #stdout' do
run_shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'192.168.5.7'\"") do |r|
run_shell("mariadb -NBe \"SHOW GRANTS FOR 'test'@'192.168.5.7'\"") do |r|
expect(r.stdout).to match(%r{GRANT ALL PRIVILEGES ON `test`.* TO ['|`]test['|`]@['|`]192.168.5.7['|`]})
expect(r.stderr).to be_empty
end
Expand Down Expand Up @@ -694,7 +694,7 @@ class { 'mysql::server': override_options => { 'root_password' => 'password' } }
end

it 'has the table' do
result = run_shell("mysql -e 'show tables;' grant_spec_db|grep grant_spec_table")
result = run_shell("mariadb -e 'show tables;' grant_spec_db|grep grant_spec_table")
expect(result.exit_code).to be_zero
end
end
Expand Down
32 changes: 16 additions & 16 deletions spec/acceptance/types/mysql_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
end

it 'has no SSL options #stdout' do
run_shell("mysql -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout).to match(%r{^\s*$})
expect(r.stderr).to be_empty
end
Expand All @@ -57,7 +57,7 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'has the correct plugin', if: (os[:family] != 'sles' && os[:release].to_i == 15) do
run_shell("mysql -NBe \"select plugin from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select plugin from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout.rstrip).to eq('auth_socket')
expect(r.stderr).to be_empty
end
Expand All @@ -69,7 +69,7 @@ class { 'mysql::server': * => $ed25519_opts }
else
'password'
end
run_shell("mysql -NBe \"select #{table} from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select #{table} from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout.rstrip).to be_empty
expect(r.stderr).to be_empty
end
Expand All @@ -89,7 +89,7 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'has the correct plugin' do
run_shell("mysql -NBe \"select plugin from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select plugin from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout.rstrip).to eq('ed25519')
expect(r.stderr).to be_empty
end
Expand All @@ -109,7 +109,7 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp-dash@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp-dash@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
Expand All @@ -129,7 +129,7 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
Expand Down Expand Up @@ -160,14 +160,14 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-ssl@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-ssl@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
end

it 'shows correct ssl_type #stdout' do
run_shell("mysql -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-ssl@localhost'\"") do |r|
run_shell("mariadb -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-ssl@localhost'\"") do |r|
expect(r.stdout).to match(%r{^ANY$})
expect(r.stderr).to be_empty
end
Expand All @@ -188,14 +188,14 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-x509@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-x509@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
end

it 'shows correct ssl_type #stdout' do
run_shell("mysql -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-x509@localhost'\"") do |r|
run_shell("mariadb -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-x509@localhost'\"") do |r|
expect(r.stdout).to match(%r{^X509$})
expect(r.stderr).to be_empty
end
Expand All @@ -219,35 +219,35 @@ class { 'mysql::server': * => $ed25519_opts }
end

it 'finds the user #stdout' do
run_shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
run_shell("mariadb -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
expect(r.stdout).to match(%r{^1$})
expect(r.stderr).to be_empty
end
end

it 'shows correct ssl_type #stdout' do
run_shell("mysql -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
run_shell("mariadb -NBe \"select SSL_TYPE from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
expect(r.stdout).to match(%r{^SPECIFIED$})
expect(r.stderr).to be_empty
end
end

it 'shows correct x509_issuer #stdout' do
run_shell("mysql -NBe \"select X509_ISSUER from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
run_shell("mariadb -NBe \"select X509_ISSUER from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
expect(r.stdout).to match(%r{^/CN=Certificate Authority$})
expect(r.stderr).to be_empty
end
end

it 'shows correct x509_subject #stdout' do
run_shell("mysql -NBe \"select X509_SUBJECT from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
run_shell("mariadb -NBe \"select X509_SUBJECT from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
expect(r.stdout).to match(%r{^/OU=MySQL Users/CN=username$})
expect(r.stderr).to be_empty
end
end

it 'shows correct ssl_cipher #stdout' do
run_shell("mysql -NBe \"select SSL_CIPHER from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
run_shell("mariadb -NBe \"select SSL_CIPHER from mysql.user where CONCAT(user, '@', host) = 'user-w-subject@localhost'\"") do |r|
expect(r.stdout).to match(%r{^EDH-RSA-DES-CBC3-SHA$})
expect(r.stderr).to be_empty
end
Expand Down
Loading