interfaces/mount: add InfoEntry type #3129

Merged
merged 5 commits into from Apr 11, 2017
@@ -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
+}
@@ -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{})
View
@@ -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