[apparmor] [PATCH 2/2] tests: Mount without updating mtab in mount.sh

Tyler Hicks tyhicks at canonical.com
Thu Apr 24 06:06:06 UTC 2014


The mount.sh script mixes calls to the regression test 'mount' binary
and /sbin/mount. This can result in stale mtab entries being left around
after a test run because /sbin/mount adds an mtab entry but the test
'mount' binary, which is also used for unmounting, does not remove mtab
entries.

To solve this problem, the -n option is passed to /sbin/mount so that it
doesn't add an mtab entry when mounting.

Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
---
 tests/regression/apparmor/mount.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/regression/apparmor/mount.sh b/tests/regression/apparmor/mount.sh
index b4951a8..86bfecb 100755
--- a/tests/regression/apparmor/mount.sh
+++ b/tests/regression/apparmor/mount.sh
@@ -33,8 +33,8 @@ loop_device="unset"
 fstype="ext2"
 
 setup_mnt() {
-	/bin/mount -t${fstype} ${loop_device} ${mount_point}
-#	/bin/mount -t${fstype} ${loop_device} ${mount_bad}
+	/bin/mount -n -t${fstype} ${loop_device} ${mount_point}
+#	/bin/mount -n -t${fstype} ${loop_device} ${mount_bad}
 }
 remove_mnt() {
 	mountpoint -q "${mount_point}"
-- 
1.9.1




More information about the AppArmor mailing list