-
Notifications
You must be signed in to change notification settings - Fork 77
Lack of support for Non-Local/High-UID identities #2367
Description
Bug Description
My laptop has only one non-privileged user which is my Google user (using authd). This means the username of my user is neither ubuntu, nor is my UID 1000 or 1001. This is the case for all cloud account setups and could also cause issues for users on systems with multiple users.
This issue causes checkbox to fail to identify the non-privileged user and crash. As a consequence, this makes me not able to run checkbox tests through the checkbox-cli unless I use a launcher where I specify my normal user.
I am assuming the non-privileged user detection is happening to avoid running non-privileged jobs as root when checkbox was started as root. If that's the case I'd suggest to only guess the user when UID is 0 or implement a fallback on the current user if none other is found.
Relevant checkbox code:
- Definition of the user guessing function:
def guess_normal_user() -> str: - Here a check could be added to see if the current user is root:
"normal_user_provider": self.get_normal_user,
Cert-blocker Test Case
- cert-blocker
To Reproduce
- Get a system with no
ubuntuuser and no users with UID 1000 or 1001 - Run checkbox.checkbox-cli
- Select any non-root test to run
Expected Result
The test runs as the current user and checkbox doesn't crash.
Actual Result
Checkbox crashes with:
==============[ Bootstrap com.canonical.plainbox::manifest (1/2) ]==============
ERROR:plainbox.bug:Undeclared exception RuntimeError raised from run_job
Traceback (most recent call last):
File "/snap/checkbox24/current/bin/checkbox-cli", line 8, in <module>
sys.exit(main())
^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/checkbox_cli.py", line 185, in main
return subcmd.invoked(ctx)
^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/subcommands.py", line 269, in invoked
self._select_test_plan_and_continue()
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/subcommands.py", line 702, in _select_test_plan_and_continue
self.bootstrap()
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/subcommands.py", line 629, in bootstrap
self._run_bootstrap_jobs(bs_jobs)
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/stages.py", line 443, in _run_bootstrap_jobs
result_builder = self.sa.run_job(job_id, "piano", False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/decorators.py", line 154, in wrapper
raise exc
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/decorators.py", line 146, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/session/assistant.py", line 1631, in run_job
result = self._runner.run_job(
^^^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/execution.py", line 191, in run_job
result_builder = self._run_command(job, environ, as_systemd_unit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/execution.py", line 235, in _run_command
return_code = self.execute_job(
^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/plainbox/impl/execution.py", line 258, in execute_job
target_user = job.user or self._user_provider()
^^^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/launcher/subcommands.py", line 642, in get_normal_user
or guess_normal_user()
^^^^^^^^^^^^^^^^^^^
File "/snap/checkbox24/current/lib/python3.12/site-packages/checkbox_ng/user_utils.py", line 54, in guess_normal_user
raise RuntimeError("Cannot guess which user should run unprivileged jobs!")
RuntimeError: Cannot guess which user should run unprivileged jobs!
Environment
- Ubuntu 25.10
- Checkbox snap 7.1.0-dev26
Relevant log output
Additional context
No response