2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 05:47:59 +00:00

parse tests: add parse tests for missing mount options

add simple parsing tests for nostrictatime, lazytime, nolazytime

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2023-03-31 02:59:48 -07:00
parent 231c469d86
commit cfb77309d6
16 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting = options
#=EXRESULT FAIL
#
/usr/bin/foo {
mount options=(strictatime, nostrictatime) -> /foo,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting = options
#=EXRESULT FAIL
#
/usr/bin/foo {
mount options=(lazytime, nolazytime) -> /foo,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting = options
#=EXRESULT FAIL
#
/usr/bin/foo {
mount options=(symfollow, nosymfollow) -> /foo,
}

View File

@ -0,0 +1,8 @@
#
#=Description basic rules to test the "nostrictatime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=nostrictatime /a -> /1,
mount options=(nostrictatime) /b -> /2,
mount options in (nostrictatime) /d -> /4,
}

View File

@ -0,0 +1,8 @@
#
#=Description basic rules to test the "lazytime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=lazytime /a -> /1,
mount options=(lazytime) /b -> /2,
mount options in (lazytime) /d -> /4,
}

View File

@ -0,0 +1,8 @@
#
#=Description basic rules to test the "nolazytime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=nolazytime /a -> /1,
mount options=(nolazytime) /b -> /2,
mount options in (nolazytime) /d -> /4,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic rules to test the "strictatime" mount option in combination
#=EXRESULT PASS
/usr/bin/foo {
mount options=(rw,strictatime) /c -> /3,
mount options in (ro,strictatime) /e -> /5,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic rules to test the "nostrictatime" mount option in combination
#=EXRESULT PASS
/usr/bin/foo {
mount options=(rw,nostrictatime) /c -> /3,
mount options in (ro,nostrictatime) /e -> /5,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic rules to test the "lazytime" mount option in combination
#=EXRESULT PASS
/usr/bin/foo {
mount options=(rw,lazytime) /c -> /3,
mount options in (ro,lazytime) /e -> /5,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic rules to test the "nolazytime" mount option in combination
#=EXRESULT PASS
/usr/bin/foo {
mount options=(rw,nolazytime) /c -> /3,
mount options in (ro,nolazytime) /e -> /5,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting options with in
#=EXRESULT PASS
#
/usr/bin/foo {
mount options in (strictatime, nostrictatime) -> /foo,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting options with in
#=EXRESULT PASS
#
/usr/bin/foo {
mount options in (lazytime, nolazytime) -> /foo,
}

View File

@ -0,0 +1,8 @@
#
#=Description basic rules to test the "nosymfollow" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=nosymfollow /a -> /1,
mount options=(nosymfollow) /b -> /2,
mount options in (nosymfollow) /d -> /4,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic rules to test the "symfollow" mount option in combination
#=EXRESULT PASS
/usr/bin/foo {
mount options=(rw,symfollow) /c -> /3,
mount options in (ro,symfollow) /e -> /5,
}

View File

@ -0,0 +1,7 @@
#
#=Description basic mount rule conflicting options with in
#=EXRESULT PASS
#
/usr/bin/foo {
mount options in (symfollow, nosymfollow) -> /foo,
}

View File

@ -108,6 +108,9 @@ exception_not_raised = (
'mount/bad_opt_26.sd',
'mount/bad_opt_27.sd',
'mount/bad_opt_28.sd',
'mount/bad_opt_29.sd',
'mount/bad_opt_30.sd',
'mount/bad_opt_31.sd',
'profile/flags/flags_bad10.sd',
'profile/flags/flags_bad11.sd',
'profile/flags/flags_bad12.sd',