Skip to content

Commit f34d865

Browse files
test: fix mysql test for password as variable
1 parent 58ec2af commit f34d865

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/classes/database_mysql_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
it { is_expected.to contain_class('zabbix::database::mysql') }
6060
it { is_expected.to compile.with_all_deps }
61-
it { is_expected.to contain_exec('zabbix_server_create.sql').with_command("cd #{path} && if [ -f #{sql_server}.gz ]; then gunzip -f #{sql_server}.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-server' -p'zabbix-server' -P 3306 -D 'zabbix-server' < #{sql_server} && touch /etc/zabbix/.schema.done") }
61+
it { is_expected.to contain_exec('zabbix_server_create.sql').with_command("cd #{path} && if [ -f #{sql_server}.gz ]; then gunzip -f #{sql_server}.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-server' -p\"${database_password}\" -P 3306 -D 'zabbix-server' < #{sql_server} && touch /etc/zabbix/.schema.done") }
6262
it { is_expected.to contain_exec('zabbix_server_images.sql').with_command('touch /etc/zabbix/.images.done') }
6363
it { is_expected.to contain_exec('zabbix_server_data.sql').with_command('touch /etc/zabbix/.data.done') }
6464
end
@@ -77,7 +77,7 @@
7777

7878
it { is_expected.to contain_class('zabbix::database::mysql') }
7979
it { is_expected.to compile.with_all_deps }
80-
it { is_expected.to contain_exec('zabbix_server_create.sql').with_command("cd #{path} && if [ -f #{sql_server}.gz ]; then gunzip -f #{sql_server}.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-server' -p'zabbix-server' -D 'zabbix-server' < #{sql_server} && touch /etc/zabbix/.schema.done") }
80+
it { is_expected.to contain_exec('zabbix_server_create.sql').with_command("cd #{path} && if [ -f #{sql_server}.gz ]; then gunzip -f #{sql_server}.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-server' -p\"${database_password}\" -D 'zabbix-server' < #{sql_server} && touch /etc/zabbix/.schema.done") }
8181
it { is_expected.to contain_exec('zabbix_server_images.sql').with_command('touch /etc/zabbix/.images.done') }
8282
it { is_expected.to contain_exec('zabbix_server_data.sql').with_command('touch /etc/zabbix/.data.done') }
8383
end
@@ -101,9 +101,9 @@
101101
it { is_expected.to compile.with_all_deps }
102102

103103
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') < 0
104-
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && if [ -f schema.sql.gz ]; then gunzip -f schema.sql.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p'zabbix-proxy' -P 3306 -D 'zabbix-proxy' < schema.sql && touch /etc/zabbix/.schema.done") }
104+
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && if [ -f schema.sql.gz ]; then gunzip -f schema.sql.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p\"${database_password}\" -P 3306 -D 'zabbix-proxy' < schema.sql && touch /etc/zabbix/.schema.done") }
105105
else
106-
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p'zabbix-proxy' -P 3306 -D 'zabbix-proxy' < proxy.sql && touch /etc/zabbix/.schema.done") }
106+
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p\"${database_password}\" -P 3306 -D 'zabbix-proxy' < proxy.sql && touch /etc/zabbix/.schema.done") }
107107
end
108108
end
109109

@@ -123,9 +123,9 @@
123123
it { is_expected.to compile.with_all_deps }
124124

125125
if Puppet::Util::Package.versioncmp(zabbix_version, '6.0') < 0
126-
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && if [ -f schema.sql.gz ]; then gunzip -f schema.sql.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p'zabbix-proxy' -D 'zabbix-proxy' < schema.sql && touch /etc/zabbix/.schema.done") }
126+
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && if [ -f schema.sql.gz ]; then gunzip -f schema.sql.gz ; fi && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p\"${database_password}\" -D 'zabbix-proxy' < schema.sql && touch /etc/zabbix/.schema.done") }
127127
else
128-
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p'zabbix-proxy' -D 'zabbix-proxy' < proxy.sql && touch /etc/zabbix/.schema.done") }
128+
it { is_expected.to contain_exec('zabbix_proxy_create.sql').with_command("cd #{path} && mysql -h 'rspec.puppet.com' -u 'zabbix-proxy' -p\"${database_password}\" -D 'zabbix-proxy' < proxy.sql && touch /etc/zabbix/.schema.done") }
129129
end
130130
end
131131
end

0 commit comments

Comments
 (0)