[apparmor] [patch] parser: extend dbus language tests

Seth Arnold seth.arnold at canonical.com
Sat Apr 26 00:41:23 UTC 2014


On Fri, Apr 25, 2014 at 04:03:04PM -0700, Steve Beattie wrote:
> This patch extends the coverage of the parser's simple dbus language
> tests.
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
>  parser/tst/simple_tests/dbus/bad_modifier_2.sd   |    7 +++++++
>  parser/tst/simple_tests/dbus/bad_modifier_3.sd   |    7 +++++++
>  parser/tst/simple_tests/dbus/bad_modifier_4.sd   |    7 +++++++
>  parser/tst/simple_tests/dbus/bad_peer_1.sd       |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_01.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_02.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_03.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_04.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_05.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/bad_regex_06.sd     |    8 ++++++++
>  parser/tst/simple_tests/dbus/ok_bind_1.sd        |    7 +++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_01.sd |   10 ++++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_02.sd |    8 ++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_03.sd |   10 ++++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_04.sd |   10 ++++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_05.sd |   10 ++++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_06.sd |   10 ++++++++++
>  parser/tst/simple_tests/vars/vars_dbus_bad_07.sd |   10 ++++++++++
>  18 files changed, 152 insertions(+)
> 
> Index: b/parser/tst/simple_tests/dbus/bad_modifier_2.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_modifier_2.sd
> @@ -0,0 +1,7 @@
> +#
> +#=DESCRIPTION dbus entry with a repeated modifier
> +#=EXRESULT FAIL
> +
> +profile foo {
> +  dbus send bus=session bus=system,
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_modifier_3.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_modifier_3.sd
> @@ -0,0 +1,7 @@
> +#
> +#=DESCRIPTION dbus entry with a bad 'in' keyword
> +#=EXRESULT FAIL
> +
> +profile foo {
> +  dbus send bus in (session, system),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_modifier_4.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_modifier_4.sd
> @@ -0,0 +1,7 @@
> +#
> +#=DESCRIPTION dbus entry with a bad multivalue modifier
> +#=EXRESULT FAIL
> +
> +profile foo {
> +  dbus send bus=(session, system),
> +}
> Index: b/parser/tst/simple_tests/dbus/ok_bind_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/ok_bind_1.sd
> @@ -0,0 +1,7 @@
> +#
> +#=DESCRIPTION simple dbus implicit bind acceptance test
> +#=EXRESULT PASS
> +
> +profile a_profile {
> +  dbus name=(SomeService),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_peer_1.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_peer_1.sd
> @@ -0,0 +1,8 @@
> +#
> +#=Description dbus rule with bad 'peer'
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send peer(label=wat),
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_01.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_01.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus bus modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       bus=@{MISSING_VAR}
> +       path="/com/canonical/hud/applications/BAR",
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_02.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_02.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus name modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (bind) name=@{MISSING_VAR},
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_03.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_03.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus path modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       bus=session
> +       path="/com/canonical/hud/applications/@{MISSING_VAR}",
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_04.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_04.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus interface modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       interface=@{MISSING_VAR}
> +       path="/com/canonical/hud/applications/BAR",
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_05.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_05.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus bus modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       member=@{MISSING_VAR}
> +       path="/com/canonical/hud/applications/BAR",
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_06.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_06.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus peer label modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       path="/com/canonical/hud/applications/BAR"
> +       peer=(label=@{MISSING_VAR}),
> +}
> Index: b/parser/tst/simple_tests/vars/vars_dbus_bad_07.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/vars/vars_dbus_bad_07.sd
> @@ -0,0 +1,10 @@
> +#
> +#=DESCRIPTION missing reference variable in dbus peer name modifier
> +#=EXRESULT FAIL
> +#
> +
> +/does/not/exist {
> +  dbus (send)
> +       path="/com/canonical/hud/applications/BAR"
> +       peer=(name=@{MISSING_VAR}),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_01.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_01.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad bus regex expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send bus=s{ession,ystem peer=(label=splat),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_02.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_02.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus bind name=abcd]efg,
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_03.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_03.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad peer regex expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send bus=session peer=(label=splat\ ),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_04.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_04.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad path regex expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send path=/some/random/{path peer=(label=splat),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_05.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_05.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad iface regex expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send interface=Get,Set} peer=(label=splat),
> +}
> Index: b/parser/tst/simple_tests/dbus/bad_regex_06.sd
> ===================================================================
> --- /dev/null
> +++ b/parser/tst/simple_tests/dbus/bad_regex_06.sd
> @@ -0,0 +1,8 @@
> +#
> +#=DESCRIPTION dbus rule with a bad member regex expansion
> +#=EXRESULT FAIL
> +#
> +
> +profile foo {
> +  dbus send member=s{{ession,ystem} peer=(label=splat),
> +}
> 
> -- 
> Steve Beattie
> <sbeattie at ubuntu.com>
> http://NxNW.org/~steve/



> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140425/f90bf9c1/attachment-0001.pgp>


More information about the AppArmor mailing list