t/m/apparmor-prompting-smoke-camera: adds smoke spread test for permission prompting for camera interface#16682
Conversation
…ssion prompting for camera interface
|
Thu Feb 26 21:07:00 UTC 2026 Failures:Skipped tests from snapd-testing-skip |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16682 +/- ##
==========================================
- Coverage 77.62% 77.52% -0.10%
==========================================
Files 1348 1360 +12
Lines 186909 187181 +272
Branches 2449 2446 -3
==========================================
+ Hits 145085 145121 +36
- Misses 33054 33279 +225
- Partials 8770 8781 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
olivercalder
left a comment
There was a problem hiding this comment.
Looks really good! Just a few small things
| prepare: | | ||
| snap set system experimental.user-daemons=true | ||
| # make sure the video dev file exists | ||
| touch "$TARGET_FILE" |
There was a problem hiding this comment.
We may need to chmod 666 the video file, though I'm not certain
| - ubuntu-2* | ||
|
|
||
| environment: | ||
| TARGET_FILE: /dev/video9 |
There was a problem hiding this comment.
Maybe worth adding a comment something like # use a fake video device path which is extremely unlikely to actually exist
|
|
||
| echo "Check the process exited correctly" | ||
| case "$PROMPT_RESPONSE" in | ||
| "allow") MATCH "" < "$TMP_STDOUT";; |
There was a problem hiding this comment.
I think matching against nothing will always succeed. I think what we need to do is NOMATCH "Permission denied" < "$TMP_STDERR"
|
|
||
| echo "Check the process exited correctly" | ||
| case "$PROMPT_RESPONSE" in | ||
| "allow") MATCH "" < "$TMP_STDOUT";; |
There was a problem hiding this comment.
Same here, want to use NOMATCH on stderr
This addresses SNAPDENG-35726
Adds a smoke test to more simply test permission prompting end-to-end without having to run the full
apparmor-prompting-integration-tests. This smoke test specifically checks for the correct flow of permission prompting for the camera interface by/dev/video9by a user without access to the camera/dev/video9and checking if the rule created for the 10s duration, the session, or forever lifespan is applied for the second request or that the flow is the same if the prompt response was for a single request