2
0
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:
Tyler Hicks
2016-05-31 15:38:36 -05:00
parent 0fe6e1955a
commit b5d7154100
10 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ safe modifier but no exec condition
#=EXRESULT FAIL
#
/usr/bin/foo {
change_profile safe,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ safe modifier but no exec condition
#=EXRESULT FAIL
#
/usr/bin/foo {
change_profile safe -> baz,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ safe modifier
#=EXRESULT PASS
#
/usr/bin/foo {
change_profile safe /usr/bin/bar -> baz,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ safe modifier
#=EXRESULT PASS
#
/usr/bin/foo {
change_profile safe /usr/bin/bar,
}

View 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,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ unsafe modifier but no exec condition
#=EXRESULT FAIL
#
/usr/bin/foo {
change_profile unsafe,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ unsafe modifier but no exec condition
#=EXRESULT FAIL
#
/usr/bin/foo {
change_profile unsafe -> baz,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ unsafe modifier
#=EXRESULT PASS
#
/usr/bin/foo {
change_profile unsafe /usr/bin/bar -> baz,
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION change_profile w/ unsafe modifier
#=EXRESULT PASS
#
/usr/bin/foo {
change_profile unsafe /usr/bin/bar,
}

View 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,
}