Add chrony NTP synchronization test (New) - #2811
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2811 +/- ##
==========================================
+ Coverage 61.29% 61.38% +0.08%
==========================================
Files 498 500 +2
Lines 50275 50400 +125
Branches 8834 8844 +10
==========================================
+ Hits 30817 30938 +121
- Misses 18616 18623 +7
+ Partials 842 839 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a chrony-based replacement for the existing NTP synchronization test in the base provider, updating job definitions so the networking/ntp coverage can work on Ubuntu releases where chrony has replaced systemd-timesyncd.
Changes:
- Replace
networking/ntpjob command to use a newnetwork_ntp_chrony_test.pychrony-driven implementation. - Update networking + dock job requirements to require the
chronypackage. - Adjust packaging metadata to add chrony as the Ubuntu dependency for networking tests (currently only for
>= 25.10).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| providers/base/units/networking/packaging.pxu | Switch Ubuntu packaging dependency from ntpdate/ntpsec-ntpdate to chrony for >= 25.10. |
| providers/base/units/networking/jobs.pxu | Update networking/ntp job to require chrony and run the new chrony-based script. |
| providers/base/units/dock/jobs.pxu | Update dock NTP jobs to require chrony and run the new chrony-based script. |
| providers/base/bin/network_ntp_chrony_test.py | New chrony-driven implementation that skews time by 1 hour, resyncs via configured sources, and verifies recovery. |
Suppressed comments (1)
providers/base/units/dock/jobs.pxu:2686
- This dock NTP job still declares estimated_duration: 10s, but the new chrony script’s default --timeout is 60s (and can legitimately take close to that). The estimate should be updated to avoid misleading scheduling/UX for long-running tests.
package.name == 'chrony'
user: root
command: network_ntp_chrony_test.py
estimated_duration: 10.00
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@JasonLeonnn Please provide the submission test result |
tomli380576
left a comment
There was a problem hiding this comment.
sry just 1 more small comment
Description
The previous
networking/ntptest depends onntpdatewhich was deprecated in Ubuntu 15.10 and replaced by systemd-timesyncd. Starting with Ubuntu 25.10,chronyhas replacedsystemd-timesyncd.Because of this, a new test case for NTP synchronization with
chrony.Resolved issues
Documentation
Jira ticket
Tests
Ubuntu 25.10+: Runs
networking/ntp-chrony.Ubuntu < 25.10: Falls back to
networking/ntp.Ubuntu Core 26: Environment check added to automatically skip
networking/ntp-chrony(UC relies onsystemd-timesyncdand NTP jobs are excluded from the UC test plan).Ubuntu 26.04: Result
Ubuntu 24.04: Result
Ubuntu Core 26: Result
WARNING: This modifies com.canonical.certification::sru-server