[apparmor] [PATCH 2/3] tests: Adjust query_label.sh to query a different profile
Tyler Hicks
tyhicks at canonical.com
Wed May 27 21:55:44 UTC 2015
The test program was querying its own profile. Adjust the profile
generation so that a separate profile is generated and have query_label
query the separate profile.
Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
---
tests/regression/apparmor/query_label.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tests/regression/apparmor/query_label.sh b/tests/regression/apparmor/query_label.sh
index 92e588e..099233a 100755
--- a/tests/regression/apparmor/query_label.sh
+++ b/tests/regression/apparmor/query_label.sh
@@ -23,7 +23,8 @@ settest query_label
expect=""
perms=""
-label="--label=$test"
+qprof="/profile/to/query"
+label="--label=$qprof"
dbus_send="--dbus=send"
dbus_receive="--dbus=receive"
@@ -35,13 +36,16 @@ dbus_none="--dbus="
dbus_msg_query="session com.foo.bar /usr/bin/bar /com/foo/bar com.foo.bar Method"
dbus_svc_query="session com.foo.baz"
-# Generate a profile for $test, granting all file access and anything specified
-# in $@
+# Generate a profile for $test, granting all file accesses, and $qprof,
+# granting anything specified in $@.
genqueryprofile()
{
genprofile --stdin <<EOF
$test {
file,
+}
+
+$qprof {
$@
}
EOF
--
2.1.4
More information about the AppArmor
mailing list