snapd icon indicating copy to clipboard operation
snapd copied to clipboard

tests/main/snapd-snap: test installing the snapd snap and connecting interfaces

Open anonymouse64 opened this issue 2 years ago • 4 comments

This is originally from the work to vendor apparmor 3 into the snapd snap, but is more useful generally as it ensures we can install/use the snapd snap on classic.

Having this test here will make it easier to propose some changes to the snapd snap and ensure those are adequately tested.

Mostly broken out from https://github.com/snapcore/snapd/pull/11096

anonymouse64 avatar Mar 09 '22 01:03 anonymouse64

Codecov Report

Merging #11483 (6e6a70b) into master (dd799e0) will increase coverage by 0.00%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11483   +/-   ##
=======================================
  Coverage   78.45%   78.46%           
=======================================
  Files         933      933           
  Lines      108159   108159           
=======================================
+ Hits        84857    84863    +6     
+ Misses      18040    18037    -3     
+ Partials     5262     5259    -3     
Flag Coverage Δ
unittests 78.46% <ø> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
overlord/ifacestate/handlers.go 65.02% <0.00%> (+0.14%) :arrow_up:
overlord/hookstate/hookmgr.go 75.32% <0.00%> (+0.64%) :arrow_up:
store/cache.go 71.15% <0.00%> (+1.92%) :arrow_up:

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 dd799e0...6e6a70b. Read the comment docs.

codecov-commenter avatar Mar 09 '22 02:03 codecov-commenter

@mvo5 @pedronis this is ready to land, but it needs force merging

anonymouse64 avatar Mar 24 '22 22:03 anonymouse64

Fwiw, this is now failing in 14.04:

...
2022-07-15T12:12:28.9832493Z Given a snap is installed
2022-07-15T12:12:28.9832925Z + /home/gopath/src/github.com/snapcore/snapd/tests/lib/tools/snaps-state install-local test-snapd-policy-app-consumer
2022-07-15T12:12:28.9833644Z 2022-07-15T12:11:59Z INFO snap "test-snapd-policy-app-consumer" has bad plugs or slots: posix-mq (AppArmor does not support POSIX message queues - cannot setup or connect interfaces)
2022-07-15T12:12:28.9834212Z 2022-07-15T12:12:26Z INFO snap "test-snapd-policy-app-consumer" has bad plugs or slots: posix-mq (AppArmor does not support POSIX message queues - cannot setup or connect interfaces)
2022-07-15T12:12:28.9834648Z error: cannot perform the following tasks:
2022-07-15T12:12:28.9835482Z - Setup snap "test-snapd-policy-app-consumer" (x1) security profiles for auto-connections (cannot obtain mount security snippets for snap "test-snapd-policy-app-consumer": shared-memory plug with "private: true" cannot be connected if "/dev/shm" is a symlink)
2022-07-15T12:12:28.9835856Z -----
...
2022-07-15T12:12:29.9103459Z 2022-07-15 12:12:29 Debug output for google:ubuntu-14.04-64:tests/main/snapd-snap:lxd (jul151135-260101) : 
...

mvo5 avatar Jul 15 '22 13:07 mvo5

I would revert a few removals of empty lines, I think they improved readability, but anyway, LGTM!

Good point, I agree and undid some.

mvo5 avatar Jul 18 '22 16:07 mvo5

Closing since these changes were merged in https://github.com/snapcore/snapd/pull/12087

MiguelPires avatar May 04 '23 07:05 MiguelPires