Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: remove NTP service on Xenial #14905

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading