interfaces/apparmor: add missing call to dirs.SetRootDir #3813

Merged
merged 1 commit into from Aug 26, 2017

Conversation

Projects
None yet
3 participants
Contributor

zyga commented Aug 26, 2017

This patch corrects a test that was failing on openSUSE. On Ubuntu it
was passing by accident because /var/cache/apparmor/$something did not
exist (the code treats file-not-found as an OK condition). On openSUSE
the permissions prevent non-root users from traversing
/var/cache/apparmor so the test failed with permission error.

In both cases what was missing was a call to dirs.SetRootDir(), to
isolate the test from the real system.

Signed-off-by: Zygmunt Krynicki me@zygoon.pl

interfaces/apparmor: add missing call to dirs.SetRootDir
This patch corrects a test that was failing on openSUSE. On Ubuntu it
was passing by accident because /var/cache/apparmor/$something did not
exist (the code treats file-not-found as an OK condition). On openSUSE
the permissions prevent non-root users from traversing
/var/cache/apparmor so the test failed with permission error.

In both cases what was missing was a call to dirs.SetRootDir(), to
isolate the test from the real system.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>

Codecov Report

Merging #3813 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3813      +/-   ##
==========================================
+ Coverage   75.81%   75.82%   +<.01%     
==========================================
  Files         402      402              
  Lines       34793    34793              
==========================================
+ Hits        26380    26382       +2     
+ Misses       6540     6538       -2     
  Partials     1873     1873
Impacted Files Coverage Δ
overlord/snapstate/snapstate.go 80.4% <0%> (-0.27%) ⬇️
interfaces/sorting.go 100% <0%> (+2.56%) ⬆️
wrappers/binaries.go 79.54% <0%> (+6.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a96aa5...f67d7f7. Read the comment docs.

ogra1 approved these changes Aug 26, 2017

seems to do what it says on the tin ...
+1

@zyga zyga merged commit a2d361b into snapcore:master Aug 26, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@zyga zyga deleted the zyga:fix/add-missing-mock branch Aug 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment