From d66a33048ca43db93433e6d018824effe11a50ca Mon Sep 17 00:00:00 2001 From: Miguel Pires Date: Tue, 7 Jan 2025 10:08:17 +0000 Subject: [PATCH 1/2] 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 --- tests/lib/prepare-restore.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/lib/prepare-restore.sh b/tests/lib/prepare-restore.sh index 8d73bea2f81..e32614f8f29 100755 --- a/tests/lib/prepare-restore.sh +++ b/tests/lib/prepare-restore.sh @@ -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 From 0399e6f6867b658870ee3fca59f8a3478721684e Mon Sep 17 00:00:00 2001 From: Miguel Pires Date: Wed, 8 Jan 2025 09:47:46 +0000 Subject: [PATCH 2/2] tests: remove previous fix Signed-off-by: Miguel Pires --- tests/lib/prepare-restore.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/lib/prepare-restore.sh b/tests/lib/prepare-restore.sh index e32614f8f29..65cff46b36d 100755 --- a/tests/lib/prepare-restore.sh +++ b/tests/lib/prepare-restore.sh @@ -795,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