Skip to content

Commit

Permalink
tests: remove NTP service on Xenial (#14905)
Browse files Browse the repository at this point in the history
* tests: remove NTP service on Xenial

The auto-refresh tests and the degraded test were all failing. The
former happened because chrony sometimes failed to run and the latter
because ntp.service conflicted with chrony. Removing ntp and leaving
chrony fixes both issues.

Signed-off-by: Miguel Pires <[email protected]>

* tests: remove previous fix

Signed-off-by: Miguel Pires <[email protected]>

---------

Signed-off-by: Miguel Pires <[email protected]>
  • Loading branch information
miguelpires authored Jan 8, 2025
1 parent a24fe7a commit 98d9ab6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/lib/prepare-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ install_dependencies_gce_bucket(){
###

prepare_project() {
# we install chrony on xenial (as its also used in later distros), so the
# ntp service was in conflict, degrading the systemd unit and sometimes breaking
# NTP syncs
if os.query is-xenial; then
systemctl stop ntp.service
systemctl disable ntp.service
apt-get remove --purge -y ntp
systemctl reset-failed
fi

if os.query is-ubuntu && os.query is-classic; then
apt-get remove --purge -y lxd lxcfs || true
apt-get autoremove --purge -y
Expand Down Expand Up @@ -785,16 +795,6 @@ restore_suite_each() {
"$TESTSLIB"/reset.sh --reuse-core
fi

# The ntp service randomly fails to create a socket on virbr0-nic,
# generating issues in actions like the auto-refresh (in Xenial).
# The errror lines are:
# ntpd: bind(23) AF_INET6 ... flags 0x11 failed: Cannot assign requested address
# ntpd: unable to create socket on virbr0-nic
# ntpd: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
if os.query is-xenial && systemctl status ntp | MATCH TIME_ERROR; then
systemctl restart ntp
fi

# Check for invariants late, in order to detect any bugs in the code above.
if [[ "$variant" = full ]]; then
"$TESTSTOOLS"/cleanup-state pre-invariant
Expand Down

0 comments on commit 98d9ab6

Please sign in to comment.