Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces/mount: add InfoEntry type #3129

Merged
merged 5 commits into from Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions interfaces/mount/mountinfo.go
@@ -0,0 +1,38 @@
// -*- Mode: Go; indent-tabs-mode: t -*-

/*
* Copyright (C) 2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

package mount

// InfoEntry contains data from /proc/$PID/mountinfo
//
// For details please refer to mountinfo documentation at
// https://www.kernel.org/doc/Documentation/filesystems/proc.txt
type InfoEntry struct {
MountID int
ParentID int
DevMajor int
DevMinor int
Root string
MountDir string
MountOpts string
OptionalFlds string
FsType string
MountSource string
SuperOpts string
}
30 changes: 30 additions & 0 deletions interfaces/mount/mountinfo_test.go
@@ -0,0 +1,30 @@
// -*- Mode: Go; indent-tabs-mode: t -*-

/*
* Copyright (C) 2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

package mount_test

import (
. "gopkg.in/check.v1"

_ "github.com/snapcore/snapd/interfaces/mount"
)

type mountinfoSuite struct{}

var _ = Suite(&mountinfoSuite{})
6 changes: 6 additions & 0 deletions spread.yaml
Expand Up @@ -184,8 +184,14 @@ prepare-each: |
dmesg -c > /dev/null

debug-each: |
echo '# journal messages for snapd'
journalctl -u snapd
echo '# apparmor denials '
dmesg | grep DENIED || true
echo '# seccomp denials (kills) '
dmesg | grep 1326 || true
echo '# snap interfaces'
snap interfaces || true

rename:
# Move content into a directory, so that deltas computed by repack benefit
Expand Down