[apparmor] [PATCH 2/3] tests: Adjust query_label.sh to query a different profile

John Johansen john.johansen at canonical.com
Thu May 28 19:07:08 UTC 2015


On 05/27/2015 02:55 PM, Tyler Hicks wrote:
> 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>
Acked-by: John Johansen <john.johansen 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
> 




More information about the AppArmor mailing list