snap/snapenv: always expect /snap for $SNAP #3666

Merged
merged 1 commit into from Aug 7, 2017

Conversation

Projects
None yet
2 participants
Contributor

zyga commented Aug 7, 2017

On the "inside" of the snap execution environment we can always(1) rely on
the /snap directory to be present. On distributions where the /snap
directory on the host is redirected to /var/lib/snapd/snap this fact
should not leak into the runtime environment.

This was already done correctly but one of the tests was stale.

(1): Snaps with classic confinement don't work there anyway so that's a
non-issue.

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

snap/snapenv: always expect /snap for $SNAP
On the "inside" of the snap execution environment we can always(1) rely on
the /snap directory to be present. On distributions where the /snap
directory on the host is redirected to /var/lib/snapd/snap this fact
should not leak into the runtime environment.

This was already done correctly but one of the tests was stale.

(1): Snaps with classic confinement don't work there anyway so that's a
non-issue.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
@@ -121,7 +121,7 @@ func (s *HTestSuite) TestSnapRunSnapExecEnv(c *C) {
env := snapEnv(info)
c.Check(env, DeepEquals, map[string]string{
"HOME": fmt.Sprintf("%s/snap/snapname/42", usr.HomeDir),
- "SNAP": fmt.Sprintf("%s/snapname/42", dirs.SnapMountDir),
+ "SNAP": fmt.Sprintf("%s/snapname/42", dirs.CoreSnapMountDir),
@mvo5

mvo5 Aug 7, 2017

Collaborator

A small comment here maybe?

@zyga

zyga Aug 7, 2017

Contributor

Since this is a backport how would you feel about me adding one for master?

@zyga

zyga Aug 7, 2017

Contributor

Now done as #3670

@zyga zyga merged commit 32036f2 into snapcore:release/2.27 Aug 7, 2017

0 of 7 checks passed

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

@zyga zyga deleted the zyga:backport/snapenv-arch branch Aug 7, 2017

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