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

Seth Arnold seth.arnold at canonical.com
Thu Apr 24 19:00:08 UTC 2014


On Thu, Apr 24, 2014 at 01:06:06AM -0500, Tyler Hicks wrote:
> 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>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
>  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
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140424/ada1433e/attachment.pgp>


More information about the AppArmor mailing list