interfaces/wayland: add wayland interface #3690

Merged
merged 4 commits into from Aug 9, 2017

Conversation

Projects
None yet
3 participants
Contributor

jdstrand commented Aug 8, 2017

This implicit classic interface is very simple-- add an AppArmor rule for owner /run/user/*/wayland-[0-9]* rw, and have the base declaration allow anyone to autoconnect to it.

The previous investigative PR tried to undo snapd's setting of XDG_RUNTIME_DIR, but this is no longer required. Because we aren't changing XDG_RUNTIME_DIR, there is no risk in breaking existing clients, but clients won't be able to find the wayland server socket without a little help. The help given is similar to what the desktop part is doing for dconf and thus acceptable for now, IMO.

Future iterations of the interface might build upon the portals work and be part of the per-user mounts that is being discussed. This PR does not introduce complications for that work.

jdstrand added some commits Aug 7, 2017

zyga approved these changes Aug 9, 2017

LGTM

+`
+
+func (s *WaylandInterfaceSuite) SetUpTest(c *C) {
+ s.plug = MockPlug(c, waylandConsumerYaml, nil, "wayland")
@zyga

zyga Aug 9, 2017

Contributor

Thank you :-)

Contributor

zyga commented Aug 9, 2017

@jdstrand the test failure looks relevant:

----------------------------------------------------------------------
FAIL: basedeclaration_test.go:127: baseDeclSuite.TestAutoConnection
basedeclaration_test.go:174:
    c.Check(err, NotNil, comm)
... value = nil
... wayland

Which reminds me, I'll move the tests for the base declaration for interfaces to the interfaces/builtin package where people often go test while they work. This will make it less likely to miss changes to base declaration tests.

interfaces/policy: wayland can auto-connect
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@@ -155,6 +155,7 @@ func (s *baseDeclSuite) TestAutoConnection(c *C) {
"unity7": true,
"unity8": true,
"upower-observe": true,
+ "wayland": true,
@jdstrand

jdstrand Aug 9, 2017

Contributor

Thanks for this.

Codecov Report

Merging #3690 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3690      +/-   ##
==========================================
+ Coverage   75.29%   75.33%   +0.04%     
==========================================
  Files         389      390       +1     
  Lines       33683    33675       -8     
==========================================
+ Hits        25361    25370       +9     
+ Misses       6503     6487      -16     
+ Partials     1819     1818       -1
Impacted Files Coverage Δ
interfaces/builtin/wayland.go 100% <100%> (ø)
cmd/snap-seccomp/main.go 49.79% <0%> (ø) ⬆️
overlord/snapstate/snapstate.go 80.46% <0%> (+0.26%) ⬆️
overlord/ifacestate/helpers.go 63% <0%> (+0.66%) ⬆️
interfaces/builtin/physical_memory_observe.go 100% <0%> (+42.85%) ⬆️

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 7d34e1c...33bb353. Read the comment docs.

@zyga zyga merged commit 5814fd7 into snapcore:master Aug 9, 2017

6 of 7 checks passed

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

@jdstrand jdstrand deleted the jdstrand:wayland-interface branch Aug 11, 2017

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