[apparmor] [PATCH 2/4] tests: Remove unneeded umount in mount.sh regression test

Tyler Hicks tyhicks at canonical.com
Mon Mar 24 19:19:14 UTC 2014

r1251 added a mount test, named TEST A3, that was expected to pass.
Therefore, it also added a corresponding umount command to unmount the
successful mount test.

r1961 changed TEST A3 to a failing test, due to the introduction of
mount mediation. The generated profile did not inclue a mount rule, so
the test would fail. However, the umount command was mistakingly left in
the test script. It should have been removed since TEST A3 was now
expected to fail.

The presence of the umount command, which exits with an error, was
causing in the mount.sh script to exit early:

  $ sudo VERBOSE=1 bash mount.sh
  ok: MOUNT (unconfined)
  ok: UMOUNT (unconfined)
  ok: MOUNT (confined)
  ok: MOUNT (confined)
  umount: /tmp/sdtest.7273-27002-kuHH78/mountpoint: not mounted

Note that TEST A4 and TEST A5 were not reached. It is also important to
point out that the mount.sh script returns 0 here. That will be fixed in
a different patch.

This patch removes the unneeded umount command, allowing the entire
mount.sh script to run. Unfortunately, TEST A5 fails.

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

diff --git a/tests/regression/apparmor/mount.sh b/tests/regression/apparmor/mount.sh
index 984b26b..e9429cb 100755
--- a/tests/regression/apparmor/mount.sh
+++ b/tests/regression/apparmor/mount.sh
@@ -70,8 +70,6 @@ runchecktest "MOUNT (confined)" fail mount ${loop_device} ${mount_point}
 genprofile capability:sys_admin
 runchecktest "MOUNT (confined)" fail mount ${loop_device} ${mount_point}
-/bin/umount -text2 ${mount_point}
 # TEST A4.  confine UMOUNT
 /bin/mount -text2 ${loop_device} ${mount_point}

More information about the AppArmor mailing list