New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: new regression test to reproduce lp-2061981 #13848
tests: new regression test to reproduce lp-2061981 #13848
Conversation
output of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, question about the path granted by personal-files though.
Also, is there something special about the home directory being an extra subdirectory deep in /home
, or does this occur as well if the homedir is e.g. /var/www/test2
?
|
||
plugs: | ||
personal-files: | ||
read: [$HOME/myhome] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is $HOME
here /home
or /home/myhome/test2
? AFAICT the test expects to find /home/myhome/test2/testfile
, so in neither case would granting $HOME/myhome
seem to be correct, unless it grants recursive read access and $HOME
is /home
. But in that case, what happens if the personal-files
plug grants $HOME/myhome/test2
instead, does it still fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$HOME is user home directory I understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I udpated the snap to allow read from $HOME and I get the error
grep error: pattern not found, got:
cannot update snap namespace: cannot expand mount entry (none $HOME/.missing none x-snapd.kind=ensure-dir,x-snapd.must-exist-dir=$HOME 0 0): cannot use invalid home directory "/home/myhome/test2": permission denied
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #13848 +/- ##
==========================================
+ Coverage 78.86% 78.88% +0.02%
==========================================
Files 1043 1043
Lines 134595 135366 +771
==========================================
+ Hits 106144 106782 +638
- Misses 21837 21926 +89
- Partials 6614 6658 +44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Please don't merge this yet. The test needs subtle adjustment. |
10751dc
to
2e9ddff
Compare
XXX: THIS IS NOT A VALID REPRODUCER. To reproduce snapd must re-exec and in spread the host snapd version is 1334. We must repackage snapd for this test to really fail. Running this test is possible to reproduce the following error: run: spread -debug google:ubuntu-22.04-64:tests/regression/lp-2061981 error: cannot update snap namespace: cannot expand mount entry (none $HOME/.missing none x-snapd.kind=ensure-dir,x-snapd.must-exist-dir=$HOME 0 0): cannot use invalid home directory "/home/myhome/test2": permission denied
2e9ddff
to
896b398
Compare
mkdir "$TEST_USER_HOME"/other-subdir | ||
touch "$TEST_USER_HOME"/other-subdir/testfile | ||
chown -R "$TEST_USER" -R "$TEST_USER_HOME" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to install a re-packaged snapd snap here.
Running this test is possible to reproduce the following error:
lp issue: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/2061981
reproduce: > spread -debug google:ubuntu-22.04-64:tests/regression/lp-2061981
error:
cannot update snap namespace: cannot expand mount entry (none $HOME/.missing none x-snapd.kind=ensure-dir,x-snapd.must-exist-dir=$HOME 0 0): cannot use invalid home directory "/home/myhome/test2": permission denied