mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
parser: add parser simple tests for mqueue rules
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
8
parser/tst/simple_tests/mqueue/bad_01.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_01.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid label
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue label=,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_02.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_02.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid type
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_03.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_03.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid queuename for type sysv
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=sysv /queuename,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_04.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_04.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid queuename for type posix
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=posix 1234,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_05.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_05.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid access name
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue invalidaccess /queuename,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_06.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_06.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid type option - posix
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=posixfoo,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_07.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_07.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid type option - sysv
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=sysvfoo,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_08.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_08.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid type option
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue type=foo,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_09.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_09.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid queuename - does not start with /
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue foo,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/bad_10.sd
Normal file
8
parser/tst/simple_tests/mqueue/bad_10.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue invalid queuename - not only numbers
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
/usr/bin/foo {
|
||||
mqueue 1234foo,
|
||||
}
|
6
parser/tst/simple_tests/mqueue/bad_11.sd
Normal file
6
parser/tst/simple_tests/mqueue/bad_11.sd
Normal file
@@ -0,0 +1,6 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue rule outside of a profile
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
mqueue,
|
7
parser/tst/simple_tests/mqueue/ok_01.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_01.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue generic rule
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/ok_02.sd
Normal file
8
parser/tst/simple_tests/mqueue/ok_02.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue type option
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue type=posix,
|
||||
mqueue type=sysv,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_03.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_03.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue label option
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue label=bar,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_04.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_04.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue valid sysv queue name
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue 1234,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_05.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_05.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue valid posix queue name
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue /bar,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_06.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_06.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue valid sysv queue name with type
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue type=sysv 1234,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_07.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_07.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue valid posix queue name with type
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue type=posix /bar,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_08.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_08.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue type and label defined
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue type=posix label=bar,
|
||||
}
|
7
parser/tst/simple_tests/mqueue/ok_09.sd
Normal file
7
parser/tst/simple_tests/mqueue/ok_09.sd
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue type, label and queue name defined
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue type=posix label=bar /baz,
|
||||
}
|
14
parser/tst/simple_tests/mqueue/ok_10.sd
Normal file
14
parser/tst/simple_tests/mqueue/ok_10.sd
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue valid access mode
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue create,
|
||||
mqueue (create, getattr, setattr),
|
||||
mqueue (open delete),
|
||||
mqueue (read write),
|
||||
mqueue r,
|
||||
mqueue w,
|
||||
mqueue rw,
|
||||
mqueue wr,
|
||||
}
|
8
parser/tst/simple_tests/mqueue/ok_11.sd
Normal file
8
parser/tst/simple_tests/mqueue/ok_11.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue full valid rule
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
mqueue (create, write) type=posix label=baz /bar,
|
||||
mqueue (open, delete) type=sysv label=baz 1234,
|
||||
}
|
10
parser/tst/simple_tests/mqueue/ok_12.sd
Normal file
10
parser/tst/simple_tests/mqueue/ok_12.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION mqueue misc rules
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
deny mqueue,
|
||||
audit allow mqueue,
|
||||
audit deny mqueue,
|
||||
allow mqueue,
|
||||
}
|
Reference in New Issue
Block a user