summaryrefslogtreecommitdiff
path: root/tests/cloud_tests/configs/modules/ntp_servers.yaml
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-05-19 16:49:11 -0400
committerScott Moser <smoser@ubuntu.com>2017-05-19 16:55:08 -0400
commite11d3899d47ec5fcb545e0c7820af9d3995cb574 (patch)
treea36c05438254df94b410ff88fba2c672709b5673 /tests/cloud_tests/configs/modules/ntp_servers.yaml
parentafdddf8eea34866b43d1fc92624f9ac175802f36 (diff)
downloadvyos-cloud-init-e11d3899d47ec5fcb545e0c7820af9d3995cb574.tar.gz
vyos-cloud-init-e11d3899d47ec5fcb545e0c7820af9d3995cb574.zip
cc_ntp: write template before installing and add service restart
On systems which installed ntp and specified servers or pools in the config ntpd didn't notice the updated configuration file and didn't use the correct configuration. Resolve this by rendering the template first which allows the package install to use the existing configuration. Additionally add a service restart to handle the case where ntp does not need to be installed but it may not have started. Add an integration test to confirm that cc_ntp enables ntp to use the specific servers and pools in the cloud-config. LP: #1645644
Diffstat (limited to 'tests/cloud_tests/configs/modules/ntp_servers.yaml')
-rw-r--r--tests/cloud_tests/configs/modules/ntp_servers.yaml16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/cloud_tests/configs/modules/ntp_servers.yaml b/tests/cloud_tests/configs/modules/ntp_servers.yaml
index 934b9c5d..e0564a03 100644
--- a/tests/cloud_tests/configs/modules/ntp_servers.yaml
+++ b/tests/cloud_tests/configs/modules/ntp_servers.yaml
@@ -5,16 +5,20 @@ cloud_config: |
#cloud-config
ntp:
servers:
- - pool.ntp.org
+ - 172.16.15.14
+ - 172.16.17.18
collect_scripts:
ntp_installed_servers: |
- #!/bin/bash
- dpkg -l | grep ntp | wc -l
+ #!/bin/sh
+ dpkg -l | grep -c ntp
ntp_conf_dist_servers: |
- #!/bin/bash
- ls /etc/ntp.conf.dist | wc -l
+ #!/bin/sh
+ cat /etc/ntp.conf.dist | wc -l
ntp_conf_servers: |
- #!/bin/bash
+ #!/bin/sh
grep '^server' /etc/ntp.conf
+ ntpq_servers: |
+ #!/bin/sh
+ ntpq -p -w
# vi: ts=4 expandtab