Skip to content

Commit

Permalink
interfaces/mount: mock release info for tests to pass
Browse files Browse the repository at this point in the history
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed May 16, 2017
1 parent 83c468c commit 8a95a81
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions interfaces/mount/ns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@ import (

"github.com/snapcore/snapd/dirs"
"github.com/snapcore/snapd/interfaces/mount"
"github.com/snapcore/snapd/release"
"github.com/snapcore/snapd/testutil"
)

type nsSuite struct {
oldDistroLibExecDir string
testutil.BaseTest
}

var _ = Suite(&nsSuite{})

func (s *nsSuite) SetUpTest(c *C) {
s.BaseTest.SetUpTest(c)
dirs.SetRootDir(c.MkDir())
// Mock enough bits so that we can observe calls to snap-discard-ns
s.oldDistroLibExecDir = dirs.DistroLibExecDir
}

func (s *nsSuite) TearDownTest(c *C) {
dirs.SetRootDir("")
dirs.DistroLibExecDir = s.oldDistroLibExecDir
s.AddCleanup(func() { dirs.SetRootDir("") })
s.AddCleanup(release.MockOnClassic(true))
// Anything that just gives us no-reexec.
s.AddCleanup(release.MockReleaseInfo(&release.OS{ID: "fedora"}))
}

func (s *nsSuite) TestDiscardNamespaceMnt(c *C) {
Expand Down

0 comments on commit 8a95a81

Please sign in to comment.