Open jocave opened 2 months ago
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1537.
This message was autogenerated
After a discussion with zyga from the snapd team, I tried to deactivate journald service by issuing
$ sudo systemctl disable --now systemd-journald.service
However, the service automatically resumed because, as mentioned when running the above command:
Warning: Stopping systemd-journald.service, but it can still be activated by:
systemd-journald-audit.socket
systemd-journald-dev-log.socket
systemd-journald.socket
I then tried to set Storage=none
in /etc/systemd/journald.conf
and restart the journald service, which in effect stopped printing out messages in journalctl, but I could still reproduce the issue:
------------------[ Check if any I²C devices can be detected ]------------------
ID: com.canonical.certification::i2c/i2c-device-detect
Category: I²C (Inter-Integrated Circuit)
--------------------------------------------------------------------------------
Error: Could not open file `/dev/i2c-0': Operation not permitted
Traceback (most recent call last):
Detected buses: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18']
Checking I2C bus 0
File "/tmp/nest-9qunglkm.367efe782aa81d8f66378001f46e336fb16df9c444b549223998300b30c683da/i2c_driver_test.py", line 104, in <module>
I2cDriverTest().main()
File "/tmp/nest-9qunglkm.367efe782aa81d8f66378001f46e336fb16df9c444b549223998300b30c683da/i2c_driver_test.py", line 100, in main
subcommands[args.subcommand]().invoked(args)
File "/tmp/nest-9qunglkm.367efe782aa81d8f66378001f46e336fb16df9c444b549223998300b30c683da/i2c_driver_test.py", line 70, in invoked
result = subprocess.check_output(
File "/snap/checkbox-iiotg/69/checkbox-runtime/usr/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/snap/checkbox-iiotg/69/checkbox-runtime/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['i2cdetect', '-y', '-r', '0']' returned non-zero exit status 1.
--------------------------------------------------------------------------------
Outcome: job failed
I will try deactivating not only journald service but also the sockets, as mentioned in the warning above.
Anecdotally, I deactivated everything mentioned above:
$ sudo systemctl disable --now systemd-journald.service
$ sudo systemctl disable --now systemd-journald-audit.socket
$ sudo systemctl disable --now systemd-journald-dev-log.socket
$ sudo systemctl disable --now systemd-journald.socket
$ sudo systemctl status systemd-journald.service
○ systemd-journald.service - Journal Service
Loaded: loaded (/lib/systemd/system/systemd-journald.service; static)
Active: inactive (dead) since Mon 2024-09-02 11:01:24 UTC; 4s ago
TriggeredBy: ○ systemd-journald.socket
○ systemd-journald-audit.socket
○ systemd-journald-dev-log.socket
Docs: man:systemd-journald.service(8)
man:journald.conf(5)
Process: 6421 ExecStart=/lib/systemd/systemd-journald (code=exited, status=0/SUCCESS)
Main PID: 6421 (code=exited, status=0/SUCCESS)
Status: "Processing requests..."
CPU: 24ms
Sep 02 11:01:14 ubuntu systemd-journald[6421]: Journal started
Sep 02 11:01:14 ubuntu systemd-journald[6421]: Runtime Journal (/run/log/journal/8f211d74ad00459381b5dc96e752791f) is 24.0M, max 73.1M, 49.1M free.
Sep 02 11:01:24 ubuntu systemd-journald[6421]: Journal stopped
and re-run the full intliotg-ubuntucore-22-automated
test plan, and this time it seems the i2c-device-detect job, which requires root access to `/dev/i2c-0', works:
---------------------------[ Running job 133 / 278 ]----------------------------
------------------[ Check if any I²C devices can be detected ]------------------
ID: com.canonical.certification::i2c/i2c-device-detect
Category: I²C (Inter-Integrated Circuit)
--------------------------------------------------------------------------------
Detected buses: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18']
Checking I2C bus 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
(...)
I2C device detected
--------------------------------------------------------------------------------
Outcome: job passed
Issue can be reproduced on Genio 700 Device UC22 Image. See the submission: https://certification.canonical.com/hardware/202405-34026/submission/401341/test-results/fail/?term=i2c%2Fi2c-device-detect
For image info, please see: https://warthogs.atlassian.net/browse/PEB-733
Bug Description
The i2c/i2c-device-detect job used to be able to run on the machines testing the intel-iotg-kernel snap on UC22 and produce a "real" outcome. However, recent runs have not produced a proper test of i2c device detection because of a permissions problem.
It seems likely that this could be some problem in the way checkbox is delivered as a snap and how snapd still impacts execution even when installed in devmode
To Reproduce
Run a snap-testing job from jenkins e.g.: http://10.102.156.15:8080/job/cert-austin-charlotte-001-intel-iotg-kernel-22-beta/
This implies checkbox running using remote mode and on the DUT side checkbox installed from a snap
Environment
OS: UC22 checkbox type: snap testing: i2c
Relevant log output
Additional context
Connecting to one of these machines in the lab and running the same test using a
run
invocation allows the job to be run seccussfully: