From cfb77309d66e5e9a8766df1e4d3398b23f51c2f1 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Fri, 31 Mar 2023 02:59:48 -0700 Subject: [PATCH] parse tests: add parse tests for missing mount options add simple parsing tests for nostrictatime, lazytime, nolazytime Signed-off-by: John Johansen --- parser/tst/simple_tests/mount/bad_opt_29.sd | 7 +++++++ parser/tst/simple_tests/mount/bad_opt_30.sd | 7 +++++++ parser/tst/simple_tests/mount/bad_opt_31.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_56.sd | 8 ++++++++ parser/tst/simple_tests/mount/ok_opt_57.sd | 8 ++++++++ parser/tst/simple_tests/mount/ok_opt_58.sd | 8 ++++++++ parser/tst/simple_tests/mount/ok_opt_59.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_60.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_61.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_62.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_63.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_64.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_65.sd | 8 ++++++++ parser/tst/simple_tests/mount/ok_opt_66.sd | 7 +++++++ parser/tst/simple_tests/mount/ok_opt_67.sd | 7 +++++++ utils/test/test-parser-simple-tests.py | 3 +++ 16 files changed, 112 insertions(+) create mode 100644 parser/tst/simple_tests/mount/bad_opt_29.sd create mode 100644 parser/tst/simple_tests/mount/bad_opt_30.sd create mode 100644 parser/tst/simple_tests/mount/bad_opt_31.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_56.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_57.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_58.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_59.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_60.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_61.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_62.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_63.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_64.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_65.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_66.sd create mode 100644 parser/tst/simple_tests/mount/ok_opt_67.sd diff --git a/parser/tst/simple_tests/mount/bad_opt_29.sd b/parser/tst/simple_tests/mount/bad_opt_29.sd new file mode 100644 index 000000000..41d3f01c3 --- /dev/null +++ b/parser/tst/simple_tests/mount/bad_opt_29.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting = options +#=EXRESULT FAIL +# +/usr/bin/foo { + mount options=(strictatime, nostrictatime) -> /foo, +} diff --git a/parser/tst/simple_tests/mount/bad_opt_30.sd b/parser/tst/simple_tests/mount/bad_opt_30.sd new file mode 100644 index 000000000..8dcd89da7 --- /dev/null +++ b/parser/tst/simple_tests/mount/bad_opt_30.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting = options +#=EXRESULT FAIL +# +/usr/bin/foo { + mount options=(lazytime, nolazytime) -> /foo, +} diff --git a/parser/tst/simple_tests/mount/bad_opt_31.sd b/parser/tst/simple_tests/mount/bad_opt_31.sd new file mode 100644 index 000000000..c322f04e4 --- /dev/null +++ b/parser/tst/simple_tests/mount/bad_opt_31.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting = options +#=EXRESULT FAIL +# +/usr/bin/foo { + mount options=(symfollow, nosymfollow) -> /foo, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_56.sd b/parser/tst/simple_tests/mount/ok_opt_56.sd new file mode 100644 index 000000000..80b9af379 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_56.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_57.sd b/parser/tst/simple_tests/mount/ok_opt_57.sd new file mode 100644 index 000000000..0cd537bec --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_57.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_58.sd b/parser/tst/simple_tests/mount/ok_opt_58.sd new file mode 100644 index 000000000..849fbedb0 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_58.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_59.sd b/parser/tst/simple_tests/mount/ok_opt_59.sd new file mode 100644 index 000000000..0b60620a6 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_59.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_60.sd b/parser/tst/simple_tests/mount/ok_opt_60.sd new file mode 100644 index 000000000..01a6c01a3 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_60.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_61.sd b/parser/tst/simple_tests/mount/ok_opt_61.sd new file mode 100644 index 000000000..694ba956e --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_61.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_62.sd b/parser/tst/simple_tests/mount/ok_opt_62.sd new file mode 100644 index 000000000..641fd9c97 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_62.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_63.sd b/parser/tst/simple_tests/mount/ok_opt_63.sd new file mode 100644 index 000000000..4b374962e --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_63.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting options with in +#=EXRESULT PASS +# +/usr/bin/foo { + mount options in (strictatime, nostrictatime) -> /foo, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_64.sd b/parser/tst/simple_tests/mount/ok_opt_64.sd new file mode 100644 index 000000000..83fdba52d --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_64.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting options with in +#=EXRESULT PASS +# +/usr/bin/foo { + mount options in (lazytime, nolazytime) -> /foo, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_65.sd b/parser/tst/simple_tests/mount/ok_opt_65.sd new file mode 100644 index 000000000..8b5c2e600 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_65.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_66.sd b/parser/tst/simple_tests/mount/ok_opt_66.sd new file mode 100644 index 000000000..b27d7bb6b --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_66.sd @@ -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, +} diff --git a/parser/tst/simple_tests/mount/ok_opt_67.sd b/parser/tst/simple_tests/mount/ok_opt_67.sd new file mode 100644 index 000000000..4ff29bcd4 --- /dev/null +++ b/parser/tst/simple_tests/mount/ok_opt_67.sd @@ -0,0 +1,7 @@ +# +#=Description basic mount rule conflicting options with in +#=EXRESULT PASS +# +/usr/bin/foo { + mount options in (symfollow, nosymfollow) -> /foo, +} diff --git a/utils/test/test-parser-simple-tests.py b/utils/test/test-parser-simple-tests.py index ce1451f4a..5c9b20da0 100644 --- a/utils/test/test-parser-simple-tests.py +++ b/utils/test/test-parser-simple-tests.py @@ -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',