Skip to content

Conversation

@stanley31huang
Copy link
Collaborator

Description

for the watchdog tests, I have made some changes for the implementation in the #1125.

the major changes is to probe watchdog kernel module when the watchdog is not available by default for the watchdog/detect test and watchdog/trigger-system-reset-auto test.

Resolved issues

Documentation

Tests

@stanley31huang stanley31huang requested a review from LiaoU3 June 17, 2025 03:15
@stanley31huang stanley31huang marked this pull request as draft June 17, 2025 03:15
Copy link
Contributor

@LiaoU3 LiaoU3 left a comment

Choose a reason for hiding this comment

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

Please see my comment.

@stanley31huang
Copy link
Collaborator Author

Here is the test results with latest commits/
https://certification.canonical.com/hardware/202309-32027/submission/437298/

Copy link
Contributor

@LiaoU3 LiaoU3 left a comment

Choose a reason for hiding this comment

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

I am good with the change, thank you! Please complete the rest of the unit test.

@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

❌ Patch coverage is 94.68085% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.31%. Comparing base (56dcd35) to head (05e1442).
⚠️ Report is 104 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/watchdog_test.py 93.37% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1962      +/-   ##
==========================================
+ Coverage   51.03%   51.31%   +0.27%     
==========================================
  Files         385      386       +1     
  Lines       41507    41668     +161     
  Branches     7712     7734      +22     
==========================================
+ Hits        21184    21380     +196     
+ Misses      19563    19525      -38     
- Partials      760      763       +3     
Flag Coverage Δ
provider-base 26.86% <93.61%> (+0.95%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@stanley31huang stanley31huang marked this pull request as ready for review July 10, 2025 07:19
@stanley31huang stanley31huang force-pushed the migrate_iotg_watchdog branch from b723b2c to 5cb32e7 Compare July 11, 2025 03:28
@stanley31huang stanley31huang marked this pull request as draft July 11, 2025 05:51
@stanley31huang stanley31huang marked this pull request as ready for review July 11, 2025 05:52
Copy link
Contributor

@rickwu666666 rickwu666666 left a comment

Choose a reason for hiding this comment

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

I found some error while runing detect job.

-------------------[ Detect presence of a Hardware Watchdog ]-------------------
ID: com.canonical.certification::watchdog/detect
Category: Power Management tests
--------------------------------------------------------------------------------
# Perform watchdog detection test
Traceback (most recent call last):
  File "/tmp/nest-uylnar1g.8b90791d9334c3bb6c697e89d47e85aff59ed5e552c0aed4bcf935a1c72d6069/watchdog_test.py", line 406, in <module>
    main()
  File "/tmp/nest-uylnar1g.8b90791d9334c3bb6c697e89d47e85aff59ed5e552c0aed4bcf935a1c72d6069/watchdog_test.py", line 391, in main
    watchdog_detection_test(args.module, args.identity)
  File "/tmp/nest-uylnar1g.8b90791d9334c3bb6c697e89d47e85aff59ed5e552c0aed4bcf935a1c72d6069/watchdog_test.py", line 298, in watchdog_detection_test
    with probe_watchdog_module(watchdog_module):
  File "/snap/checkbox24/current/usr/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/tmp/nest-uylnar1g.8b90791d9334c3bb6c697e89d47e85aff59ed5e552c0aed4bcf935a1c72d6069/watchdog_test.py", line 126, in probe_watchdog_module
    ret = subprocess.run("modprobe {}".format(kernel_module))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/snap/checkbox24/current/usr/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/snap/checkbox24/current/usr/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/snap/checkbox24/current/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'modprobe rzg2l_wdt'

@LiaoU3 LiaoU3 marked this pull request as draft July 11, 2025 07:45
@LiaoU3 LiaoU3 marked this pull request as ready for review July 11, 2025 07:45
seperate the watchdog config and functional test
@stanley31huang stanley31huang force-pushed the migrate_iotg_watchdog branch from 12578ab to 05e1442 Compare July 11, 2025 07:54
Copy link
Contributor

@LiaoU3 LiaoU3 left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@rickwu666666 rickwu666666 left a comment

Choose a reason for hiding this comment

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

LGTM

@pieqq
Copy link
Collaborator

pieqq commented Jul 16, 2025

Hi @stanley31huang !

I started to look at this, but before I dive deeper and provide line-by-line review, could you:

  • Rebase your PR on the latest commit from main
  • Provide some general explanation on what this change brings? I'm asking because, for instance in the original script, a mention was added stating that "with this change watchdog/systemd-config tests only systemd configuration on 20.04 and later series while keeping the original test for prior releases", but it's not clear where the original test is kept, since most of the functions in watchdog_config_test.py have been modified.
  • Fill in the "Tests" section to provide submissions showing successful runs and steps on how to test this locally (or with a container, etc.)

@stanley31huang
Copy link
Collaborator Author

I have separated this PR into two PR. one for test job and the other one is for test scripts
test job: #2021
test scripts: #2022

so closed this one.

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.

5 participants