mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
Add additional mount regression tests for options= options in combo
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
0ee95d7e38
commit
6e16efe703
@ -212,6 +212,18 @@ test_nonfs_options_equals_in() {
|
|||||||
remove_mnt
|
remove_mnt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_nonfs_options_equals_in_ext() {
|
||||||
|
# args: option=$1, option in $2, $3=pass/fail, mount -o $4
|
||||||
|
if [ "$(parser_supports "mount options=($1) options in ($2),")" != "true" ] ; then
|
||||||
|
echo " not supported by parser - skipping mount options=($1) options in ($2),"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
genprofile cap:sys_admin "mount:options=($1) options in ($2)"
|
||||||
|
runchecktest "MOUNT (confined cap mount option=$1 option in $2 ($4))" $3 mount ${loop_device} ${mount_point} -o $4
|
||||||
|
remove_mnt
|
||||||
|
}
|
||||||
|
|
||||||
test_dir_options() {
|
test_dir_options() {
|
||||||
if [ "$(parser_supports "mount options=($1),")" != "true" ] ; then
|
if [ "$(parser_supports "mount options=($1),")" != "true" ] ; then
|
||||||
echo " not supported by parser - skipping mount option=($1),"
|
echo " not supported by parser - skipping mount option=($1),"
|
||||||
@ -288,6 +300,9 @@ test_options() {
|
|||||||
# TODO: expand this to cover more mount flag combinations
|
# TODO: expand this to cover more mount flag combinations
|
||||||
test_nonfs_options_equals_in 'nosuid,nodev' 'noatime,noexec'
|
test_nonfs_options_equals_in 'nosuid,nodev' 'noatime,noexec'
|
||||||
|
|
||||||
|
test_nonfs_options_equals_in_ext 'nosuid,nodev' 'noatime' 'fail' 'nosuid,nodev,noexec'
|
||||||
|
test_nonfs_options_equals_in_ext 'nosuid,nodev' 'noatime' 'fail' 'nosuid,nodev,noatime,noexec'
|
||||||
|
|
||||||
for i in "bind" "rbind" "move"; do
|
for i in "bind" "rbind" "move"; do
|
||||||
test_dir_options $i
|
test_dir_options $i
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user