parser: add parser tests for specified perms

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2023-11-09 15:12:49 +02:00
parent 79ee3eb180
commit 8a5e7227db
77 changed files with 608 additions and 0 deletions

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr w/peer modifier
#=EXRESULT FAIL
profile a_profile {
network getattr peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr acceptance test
#=EXRESULT FAIL
profile a_profile {
network (getattr) peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr w/peer test
#=EXRESULT FAIL
profile a_profile {
network setattr peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr w/peer ip test
#=EXRESULT FAIL
profile a_profile {
network (setattr) peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr w/peer modifier
#=EXRESULT FAIL
profile a_profile {
network getattr peer=(ip=::1),
}

View file

@ -0,0 +1,8 @@
#
#=DESCRIPTION network bind with non-bind member modifier
#=EXRESULT FAIL
#
profile foo {
network bind peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,8 @@
#
#=DESCRIPTION network bind with non-bind interface modifier
#=EXRESULT FAIL
#
profile foo {
network bind peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create w/peer acceptance test
#=EXRESULT FAIL
profile a_profile {
network create peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create acceptance test
#=EXRESULT FAIL
profile a_profile {
network (create) peer=(ip=::1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network listen w/peer test
#=EXRESULT FAIL
profile a_profile {
network listen peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network listen w/peer test
#=EXRESULT FAIL
profile a_profile {
network (listen) peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION network entry with a bad modifier
#=EXRESULT FAIL
profile foo {
network send type=dgram modifier=foo,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION network entry with a repeated modifier
#=EXRESULT FAIL
profile foo {
network send ip=127.0.0.1 ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION network entry with a bad 'in' keyword
#=EXRESULT FAIL
profile foo {
network send ip in (127.0.0.1, ::1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt w/peer ip test
#=EXRESULT FAIL
profile a_profile {
network getopt peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt w/peer label test
#=EXRESULT FAIL
profile a_profile {
network (getopt) peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt w/peer ip test
#=EXRESULT FAIL
profile a_profile {
network setopt peer=(ip=::1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt w/peer label test
#=EXRESULT FAIL
profile a_profile {
network (setopt) peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt w/peer ip test
#=EXRESULT FAIL
profile a_profile {
network getopt peer=(ip=::1),
}

View file

@ -0,0 +1,5 @@
#
#=DESCRIPTION network accept rule outside of a profile
#=EXRESULT FAIL
network accept,

View file

@ -0,0 +1,8 @@
#
#=Description network rule with bad 'peer'
#=EXRESULT FAIL
#
profile foo {
network send peer(ip=wat),
}

View file

@ -0,0 +1,8 @@
#
#=Description network rule with bad 'peer'
#=EXRESULT FAIL
#
profile foo {
network send peer(port=auto),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown w/peer test
#=EXRESULT FAIL
profile a_profile {
network shutdown peer=(ip=127.0.0.1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown acceptance test
#=EXRESULT FAIL
profile a_profile {
network (shutdown) peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown w/peer test
#=EXRESULT FAIL
profile a_profile {
network shutdown peer=(ip=::1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network accept acceptance test
#=EXRESULT PASS
profile a_profile {
network accept,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network accept acceptance test
#=EXRESULT PASS
profile a_profile {
network (accept),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr acceptance test
#=EXRESULT PASS
profile a_profile {
network getattr,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr acceptance test
#=EXRESULT PASS
profile a_profile {
network (getattr),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr acceptance test
#=EXRESULT PASS
profile a_profile {
network setattr,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr acceptance test
#=EXRESULT PASS
profile a_profile {
network (setattr),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network getattr ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network setattr ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getattr w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network getattr ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setattr w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network setattr ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network bind acceptance test
#=EXRESULT PASS
profile a_profile {
network bind,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network bind acceptance test
#=EXRESULT PASS
profile a_profile {
network (bind),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network connect acceptance test
#=EXRESULT PASS
profile a_profile {
network connect,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network connect acceptance test
#=EXRESULT PASS
profile a_profile {
network (connect),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create acceptance test
#=EXRESULT PASS
profile a_profile {
network create,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create acceptance test
#=EXRESULT PASS
profile a_profile {
network (create),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network create ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network create w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network create ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network listen acceptance test
#=EXRESULT PASS
profile a_profile {
network listen,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network listen acceptance test
#=EXRESULT PASS
profile a_profile {
network (listen),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network listen w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network listen ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network send test
#=EXRESULT PASS
profile a_profile {
network (send),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send) peer=(port=1234),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network rule
#=EXRESULT PASS
profile a_profile {
network,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network send test
#=EXRESULT PASS
profile a_profile {
network send,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network receive,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network r,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (r),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network w,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (w),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network rw,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (rw),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (receive),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send) ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (connect),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send, receive),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send, receive, connect),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send) ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send) ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network msg test
#=EXRESULT PASS
profile a_profile {
network (send) peer=(ip=::1),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt acceptance test
#=EXRESULT PASS
profile a_profile {
network getopt,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt acceptance test
#=EXRESULT PASS
profile a_profile {
network (getopt),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt acceptance test
#=EXRESULT PASS
profile a_profile {
network setopt,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt acceptance test
#=EXRESULT PASS
profile a_profile {
network (setopt),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network getopt w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network getopt ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network setopt ip=127.0.0.1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network setopt w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network setopt ip=::1,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown acceptance test
#=EXRESULT PASS
profile a_profile {
network shutdown,
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown acceptance test
#=EXRESULT PASS
profile a_profile {
network (shutdown),
}

View file

@ -0,0 +1,7 @@
#
#=DESCRIPTION simple network shutdown w/ip acceptance test
#=EXRESULT PASS
profile a_profile {
network shutdown ip=127.0.0.1,
}

View file

@ -461,6 +461,80 @@ syntax_failure = (
'network/network_ok_17.sd',
'network/network_ok_18.sd',
'network/network_ok_19.sd',
'network/network_ok_20.sd',
'network/network_ok_21.sd',
'network/network_ok_22.sd',
'network/network_ok_23.sd',
'network/network_ok_24.sd',
'network/network_ok_25.sd',
'network/network_ok_26.sd',
'network/network_ok_27.sd',
'network/network_ok_28.sd',
'network/network_ok_29.sd',
'network/network_ok_30.sd',
'network/network_ok_31.sd',
'network/network_ok_32.sd',
'network/network_ok_33.sd',
'network/network_ok_34.sd',
'network/network_ok_35.sd',
'network/network_ok_36.sd',
'network/network_ok_37.sd',
'network/network_ok_38.sd',
'network/network_ok_39.sd',
'network/network_ok_40.sd',
'network/network_ok_41.sd',
'network/network_ok_42.sd',
'network/network_ok_43.sd',
'network/perms/ok_accept_1.sd',
'network/perms/ok_accept_2.sd',
'network/perms/ok_attr_1.sd',
'network/perms/ok_attr_2.sd',
'network/perms/ok_attr_3.sd',
'network/perms/ok_attr_4.sd',
'network/perms/ok_attr_5.sd',
'network/perms/ok_attr_6.sd',
'network/perms/ok_attr_7.sd',
'network/perms/ok_attr_8.sd',
'network/perms/ok_bind_1.sd',
'network/perms/ok_bind_2.sd',
'network/perms/ok_connect_1.sd',
'network/perms/ok_connect_2.sd',
'network/perms/ok_create_1.sd',
'network/perms/ok_create_2.sd',
'network/perms/ok_create_3.sd',
'network/perms/ok_create_4.sd',
'network/perms/ok_listen_1.sd',
'network/perms/ok_listen_2.sd',
'network/perms/ok_listen_3.sd',
'network/perms/ok_msg_1.sd',
'network/perms/ok_msg_2.sd',
'network/perms/ok_msg_3.sd',
'network/perms/ok_msg_4.sd',
'network/perms/ok_msg_5.sd',
'network/perms/ok_msg_6.sd',
'network/perms/ok_msg_7.sd',
'network/perms/ok_msg_8.sd',
'network/perms/ok_msg_9.sd',
'network/perms/ok_msg_10.sd',
'network/perms/ok_msg_12.sd',
'network/perms/ok_msg_13.sd',
'network/perms/ok_msg_14.sd',
'network/perms/ok_msg_15.sd',
'network/perms/ok_msg_16.sd',
'network/perms/ok_msg_17.sd',
'network/perms/ok_msg_18.sd',
'network/perms/ok_msg_19.sd',
'network/perms/ok_msg_20.sd',
'network/perms/ok_opt_1.sd',
'network/perms/ok_opt_2.sd',
'network/perms/ok_opt_3.sd',
'network/perms/ok_opt_4.sd',
'network/perms/ok_opt_5.sd',
'network/perms/ok_opt_6.sd',
'network/perms/ok_opt_7.sd',
'network/perms/ok_shutdown_1.sd',
'network/perms/ok_shutdown_2.sd',
'network/perms/ok_shutdown_3.sd',
)