checkbox may resume a session as "root", causing problems with some jobs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox Provider - Base |
Expired
|
High
|
Sylvain Pineau |
Bug Description
[Summary]
This issue was identified while running OEM tests on 202010-28292 device, but it happens with other devices as well.
Some jobs fail with unexpected errors. For instance, `audio/
subprocess.
Connection failure: Connection refused
pa_context_
It turns out it's because the command `pactl info` is run as root. (try running `sudo pactl info` on your own device and you will have the same problem)
It seems that, when Checkbox automatically resumes a session after rebooting, it resumes the session as root.
I noticed this because if I open another tab in the gnome-terminal window that has been opened by Checkbox, the user is `root`.
[Steps to reproduce]
Run a session that involves an audio job (that calls pactl at some point) *after* a reboot
[Expected outcome]
The jobs run normally and pass
[Actual outcome]
The jobs spit some weird output and/or fail (because they are run as root when they should be run as a normal user)
[Additional info]
Checkbox is used in local mode (not remote)
checkbox-ng: 1.11.0
checkbox-support: 0.48.0
com.canonical.
certification-
plainbox-
plainbox-
plainbox-
Changed in checkbox-ng: | |
assignee: | nobody → Sylvain Pineau (sylvain-pineau) |
importance: | Undecided → High |
importance: | High → Critical |
Changed in checkbox-ng: | |
status: | New → Confirmed |
Changed in checkbox-ng: | |
status: | Confirmed → Triaged |
affects: | checkbox-ng → plainbox-provider-checkbox |
Changed in plainbox-provider-checkbox: | |
importance: | Critical → High |
Let's start by promoting the use of remote which is the easiest way to not face this kind of problem with stuff owned by root after reboot.
Here the culprit is pm_test once again which when done with the last pm iteration restarts checkbox using a command like:
sudo -u <invoking_user> bash ...
So even if checkbox runs as a normal user, being somehow owned by root in the process hierarchy prevents to start pulseaudio commands as expected.
To still run checkbox locally, I'd recommend to switch to power-automated from https:/ /git.launchpad. net/plainbox- provider- checkbox/ tree/units/ power-managemen t/test- plan.pxu# n72 to replace the use of https:/ /git.launchpad. net/~oem- qa/oem- qa-checkbox/ +git/oem- plainbox/ tree/units/ somerville- graphic. pxu#n19 in somerville test plans since those jobs only perform a single reboot/poweroff.