Skip to content

Add chrony NTP synchronization test (New) - #2811

Open
JasonLeonnn wants to merge 6 commits into
mainfrom
add_chrony_ntp_test
Open

Add chrony NTP synchronization test (New)#2811
JasonLeonnn wants to merge 6 commits into
mainfrom
add_chrony_ntp_test

Conversation

@JasonLeonnn

@JasonLeonnn JasonLeonnn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

The previous networking/ntp test depends on ntpdate which was deprecated in Ubuntu 15.10 and replaced by systemd-timesyncd. Starting with Ubuntu 25.10, chrony has replaced systemd-timesyncd.
Because of this, a new test case for NTP synchronization with chrony.

Resolved issues

  • Created a new chrony-based script, implement one hour skew, sync using configured NTP sources, and verify.
  • Updated networking and dock jobs

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 on systemd-timesyncd and 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

@JasonLeonnn
JasonLeonnn requested review from a team and a lite review from Copilot September 1, 2026 05:32
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.38%. Comparing base (b1a785f) to head (cccd644).
⚠️ Report is 17 commits behind head on main.

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     
Flag Coverage Δ
provider-base 40.03% <100.00%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ntp job command to use a new network_ntp_chrony_test.py chrony-driven implementation.
  • Update networking + dock job requirements to require the chrony package.
  • 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.

Comment thread providers/base/units/networking/packaging.pxu Outdated
Comment thread providers/base/units/networking/jobs.pxu Outdated
Comment thread providers/base/units/dock/jobs.pxu Outdated
@JasonLeonnn
JasonLeonnn removed the request for review from a team September 1, 2026 06:08
@JasonLeonnn
JasonLeonnn marked this pull request as draft September 1, 2026 06:08
Comment thread providers/base/units/networking/jobs.pxu Outdated
Comment thread providers/base/units/networking/packaging.pxu Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
Comment thread providers/base/bin/network_ntp_chrony_test.py Outdated
@clairlin53

Copy link
Copy Markdown
Contributor

@JasonLeonnn Please provide the submission test result

@JasonLeonnn
JasonLeonnn marked this pull request as ready for review September 2, 2026 03:24

@tomli380576 tomli380576 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry just 1 more small comment

Comment thread providers/base/units/networking/jobs.pxu Outdated
Comment thread providers/base/units/networking/jobs.pxu Outdated
Comment thread providers/certification-client/units/client-cert-iot-ubuntucore-26.pxu Outdated

@baconYao baconYao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomli380576 tomli380576 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants