-
Notifications
You must be signed in to change notification settings - Fork 594
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
interfaces/builtin, testutil: skip unit test when apparmor_parser is not in PATH #14951
base: master
Are you sure you want to change the base?
interfaces/builtin, testutil: skip unit test when apparmor_parser is not in PATH #14951
Conversation
…not in PATH On some distros which support AppArmor, the apparmor_parser binary is located under /usr/sbin, which also happens to not be included in a regular user's $PATH. The sandbox/apparmor package code is able to locate it directly by checking a number of default paths, however the test code simply assumes that it is available in $PATH. Instead of complicating things further, let's skip the offending unit test. Signed-off-by: Maciej Borzecki <[email protected]>
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.
LGTM but see my suggestion inline.
@@ -868,6 +871,9 @@ ptrace (read, trace) peer=unconfined, | |||
|
|||
// Profile existing profile | |||
expectedHash, err := testutil.AppArmorParseAndHashHelper("#include <tunables/global> \nprofile docker_support {" + privilegedProfile + "}") | |||
if err != nil && errors.Is(err, exec.ErrNotFound) { |
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.
The left hand side is redundant
e36856a
to
6baee6c
Compare
Tue Jan 21 14:11:44 UTC 2025 Failures:Preparing:
Executing:
Restoring:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14951 +/- ##
=========================================
Coverage ? 78.26%
=========================================
Files ? 1157
Lines ? 153473
Branches ? 0
=========================================
Hits ? 120119
Misses ? 25947
Partials ? 7407
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks
On some distros which support AppArmor, the apparmor_parser binary is located under /usr/sbin, which also happens to not be included in a regular user's $PATH. The sandbox/apparmor package code is able to locate it directly by checking a number of default paths, however the test code simply assumes that it is available in $PATH. Instead of complicating things further, let's skip the offending unit test.
Thanks for helping us make a better snapd!
Have you signed the license agreement and read the contribution guide?