mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
parser: Add tests for rules with change_profile exec modes
Simple tests that validate the parser's ability to handle change_profile rules containing an exec mode. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
7
parser/tst/simple_tests/change_profile/safe_bad_1.sd
Normal file
7
parser/tst/simple_tests/change_profile/safe_bad_1.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ safe modifier but no exec condition
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile safe,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/safe_bad_2.sd
Normal file
7
parser/tst/simple_tests/change_profile/safe_bad_2.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ safe modifier but no exec condition
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile safe -> baz,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/safe_ok_1.sd
Normal file
7
parser/tst/simple_tests/change_profile/safe_ok_1.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ safe modifier
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile safe /usr/bin/bar -> baz,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/safe_ok_2.sd
Normal file
7
parser/tst/simple_tests/change_profile/safe_ok_2.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ safe modifier
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile safe /usr/bin/bar,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/safe_ok_3.sd
Normal file
7
parser/tst/simple_tests/change_profile/safe_ok_3.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ safe modifier and "safe" target
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile safe /usr/bin/bar -> safe,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/unsafe_bad_1.sd
Normal file
7
parser/tst/simple_tests/change_profile/unsafe_bad_1.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ unsafe modifier but no exec condition
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile unsafe,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/unsafe_bad_2.sd
Normal file
7
parser/tst/simple_tests/change_profile/unsafe_bad_2.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ unsafe modifier but no exec condition
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile unsafe -> baz,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/unsafe_ok_1.sd
Normal file
7
parser/tst/simple_tests/change_profile/unsafe_ok_1.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ unsafe modifier
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile unsafe /usr/bin/bar -> baz,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/unsafe_ok_2.sd
Normal file
7
parser/tst/simple_tests/change_profile/unsafe_ok_2.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ unsafe modifier
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile unsafe /usr/bin/bar,
|
||||
}
|
7
parser/tst/simple_tests/change_profile/unsafe_ok_3.sd
Normal file
7
parser/tst/simple_tests/change_profile/unsafe_ok_3.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION change_profile w/ unsafe modifier and "unsafe" target
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
change_profile unsafe /usr/bin/bar -> unsafe,
|
||||
}
|
Reference in New Issue
Block a user