interfaces/mount: add ReadMountInfo and LoadMountInfo #3203

Merged
merged 2 commits into from Apr 20, 2017

Conversation

Projects
None yet
3 participants
Contributor

zyga commented Apr 19, 2017

This patch adds a pair of functions for reading mountinfo data and for
loading mountinfo data from a file. They are going to be used by
snap-update-ns shortly.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

interfaces/mount: add ReadMountInfo and LoadMountInfo
This patch adds a pair of functions for reading mountinfo data and for
loading mountinfo data from a file. They are going to be used by
snap-update-ns shortly.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Looking good! +1

mvo5 approved these changes Apr 20, 2017

Looks fine.

interfaces/mount/mountinfo_test.go
+// Test that loading mountinfo from a file works as expected.
+func (s *profileSuite) TestLoadMountInfo1(c *C) {
+ dir := c.MkDir()
+ fname := filepath.Join(dir, "mountinfo")
@mvo5

mvo5 Apr 20, 2017

Collaborator

(nitpick) You could combine this and the previous line fname := filepath.Join(c.MkDir()), "mountinfo"). But this is also perfectly fine. Same in the best below.

@zyga

zyga Apr 20, 2017

Contributor

Done :-)

interfaces/mount: shorten test code
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

@zyga zyga merged commit fde02a5 into snapcore:master Apr 20, 2017

6 checks passed

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:feature/update-ns/load-mountinfo branch Apr 20, 2017

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