Skip to content

Commit e5bbfcc

Browse files
committed
Add test scenarios for missing conf .d directory.
1 parent 3f15126 commit e5bbfcc

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# packages = chrony
3+
# variables = var_time_service_set_maxpoll=16
4+
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_sle
5+
6+
{{{ bash_package_remove("ntp") }}}
7+
8+
# Remove the /etc/chrony.d directory to simulate systems where it doesn't exist
9+
# (e.g., ppc64le systems with chrony-dhcp in Testing Farm)
10+
rm -rf {{{ chrony_d_path }}}
11+
12+
# Configure maxpoll correctly in the main chrony.conf file
13+
sed -i "/^\(server\|pool\).*/d" {{{ chrony_conf_path }}}
14+
echo "pool pool.ntp.org iburst maxpoll 16" >> {{{ chrony_conf_path }}}
15+
echo "server time.nist.gov maxpoll 16" >> {{{ chrony_conf_path }}}
16+
17+
systemctl enable chronyd.service
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# packages = chrony
3+
# variables = var_time_service_set_maxpoll=16
4+
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_sle
5+
# remediation = bash,ansible
6+
7+
{{{ bash_package_remove("ntp") }}}
8+
9+
# Remove the /etc/chrony.d directory to simulate systems where it doesn't exist
10+
# (e.g., ppc64le systems with chrony-dhcp in Testing Farm)
11+
rm -rf {{{ chrony_d_path }}}
12+
13+
# Configure maxpoll incorrectly in the main chrony.conf file
14+
sed -i "/^\(server\|pool\).*/d" {{{ chrony_conf_path }}}
15+
echo "pool pool.ntp.org iburst maxpoll 18" >> {{{ chrony_conf_path }}}
16+
echo "server time.nist.gov maxpoll 20" >> {{{ chrony_conf_path }}}
17+
18+
systemctl enable chronyd.service

0 commit comments

Comments
 (0)