Skip to content

Commit 7ddc0dc

Browse files
committed
CentOS tests: Purge whole yum cache
1 parent b3c4cad commit 7ddc0dc

File tree

5 files changed

+2
-5
lines changed

5 files changed

+2
-5
lines changed

spec/acceptance/server_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class { 'zabbix::database': } ->
2020
class { 'zabbix::server': }
2121
EOS
2222

23-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
23+
cleanup_zabbix
2424

2525
# Run it twice and test for idempotency
2626
apply_manifest(pp, catch_failures: true)

spec/acceptance/zabbix_hostgroup_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class { 'zabbix':
3333
}
3434
EOS
3535

36-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
37-
3836
# Cleanup old database
3937
cleanup_zabbix
4038

spec/acceptance/zabbix_template_host_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class { 'zabbix':
4343
}
4444
EOS
4545

46-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
4746
shell("echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><zabbix_export><version>3.0</version><date>2018-12-13T15:00:46Z</date><groups><group><name>Templates/Applications</name></group></groups><templates><template><template>TestTemplate1</template><name>TestTemplate1</name><description/><groups><group><name>Templates/Applications</name></group></groups><applications/><items/><discovery_rules/><macros/><templates/><screens/></template></templates></zabbix_export>' > /root/TestTemplate1.xml")
4847

4948
# Cleanup old database

spec/acceptance/zabbix_template_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class { 'zabbix':
2929
}
3030
EOS
3131

32-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
3332
shell("echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><zabbix_export><version>3.0</version><date>2018-12-13T15:00:46Z</date><groups><group><name>Templates/Applications</name></group></groups><templates><template><template>TestTemplate1</template><name>TestTemplate1</name><description/><groups><group><name>Templates/Applications</name></group></groups><applications/><items/><discovery_rules/><macros/><templates/><screens/></template></templates></zabbix_export>' > /root/TestTemplate1.xml")
3433

3534
# Cleanup old database

spec/support/acceptance/cleanup_zabbix.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
def cleanup_zabbix
2+
shell('rm -rf /etc/yum.repos.d/Zabbix*.repo; rm -rf /var/cache/yum/x86_64/*/Zabbix*; yum clean all --verbose') if fact('os.family') == 'RedHat'
23
cleanup_script = <<-SHELL
34
/opt/puppetlabs/bin/puppet resource service zabbix-server ensure=stopped
45
/opt/puppetlabs/bin/puppet resource package zabbix-server-pgsql ensure=purged

0 commit comments

Comments
 (0)