snaps tests assume ubuntu user
Metadata
Current evaluation
Fixed by merged PR snapcore/snapcraft#1068 (commit 1d4e5878d), replacing the hardcoded /home/ubuntu test destination with a temporary directory.
Resolution: closed resolved
Reason: PR snapcore/snapcraft#1068 was merged as commit 1d4e5878d and made snaps tests independent of the current username.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Trying to run the snaps tests locally results in an error as it assumes the user is named `ubuntu`. For example:
$ ./runtests.sh snaps --filter hooks
<snip>
======================================================================
ERROR: demos_tests.test_hooks.HookCase.test_hooks
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kyrofa/src/snapcraft/snaps_tests/demos_tests/test_hooks.py", line 26, in test_hooks
self.install_snap(snap_path, 'hooks', '1.0')
File "/home/kyrofa/src/snapcraft/snaps_tests/__init__.py", line 180, in install_snap
self.snappy_testbed.copy_file(snap_local_path, '/home/ubuntu')
File "/home/kyrofa/src/snapcraft/snaps_tests/testbed.py", line 49, in copy_file
shutil.copy(src, dst)
File "/usr/lib/python3.5/shutil.py", line 235, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/home/ubuntu'
It'd be great if this could be made a little more flexible.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR snapcore/snapcraft#1068 (commit 1d4e5878d), replacing the hardcoded /home/ubuntu test destination with a temporary directory. | |
| stealth/space-bunny-alpha | — | closed resolved | Resolved by PR #1068 (commit 1d4e5878d), replacing the hard-coded /home/ubuntu test path with a temporary directory. | |
| stealth/space-bunny-alpha | — | closed resolved | Snaps tests hardcoded /home/ubuntu as the copy target; fixed by merged PR #1068 (commit 1d4e5878d), which made snaps tests use a temporary directory instead of assuming the ubuntu user. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by #1068: snaps tests switched to a temporary directory instead of assuming /home/ubuntu; merged as 1d4e5878d. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. The test suite hardcoded /home/ubuntu, causing permission errors for non-ubuntu users. Closed without comments or a resolution. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Tests hardcoding /home/ubuntu caused permission errors for non-ubuntu users. No follow-up activity or pull requests were submitted. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. Closed without comments or a fix. Tests failed because they hardcoded the /home/ubuntu directory, causing permission errors for non-ubuntu users. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Abandoned. Closed without resolution or comments. The hardcoded /home/ubuntu path assumption in snap tests causing local permission errors was not addressed due to inactivity. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1068
(confidence 100%)
The linked PR introduced a temporary test directory instead of assuming /home/ubuntu.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1575398 examples tests are using the hardcoded /home/ubuntu dir | snapcraft (launchpad) | closed | Hardcoded /home/ubuntu paths in snap tests were replaced with temporary directories by merged canonical/snapcraft#1068 (commit 1d4e5878d). | |
| #1068 tests: use a temporary directory for snaps tests | snapcraft | merged | Merged PR #1068 made snaps tests use a temporary directory, fixing Launchpad bug #1643658; landed as commit 1d4e5878d. |