2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Merge Add more tests for network port range

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1326
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
John Johansen
2024-09-11 07:48:01 +00:00
11 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - missing end of range
#=EXRESULT FAIL
#
/usr/bin/foo {
network port=22-,
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - missing end of range
#=EXRESULT FAIL
#
/usr/bin/foo {
network peer=(port=2222-),
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - spaces in range not allowed
#=EXRESULT FAIL
#
/usr/bin/foo {
network port=22 - 443,
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - spaces in range not allowed
#=EXRESULT FAIL
#
/usr/bin/foo {
network peer=(port=22 - 443),
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - invalid "--"
#=EXRESULT FAIL
#
/usr/bin/foo {
network port=22--443,
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - invalid "--"
#=EXRESULT FAIL
#
/usr/bin/foo {
network peer=(port=22--443),
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - 3 items in range
#=EXRESULT FAIL
#
/usr/bin/foo {
network port=22-443-1024,
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - 3 items in range
#=EXRESULT FAIL
#
/usr/bin/foo {
network peer=(port=22-443-1024),
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - additional spaces
#=EXRESULT PASS
#
/usr/bin/foo {
network port = 22-443 ,
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION network port range conditional test - additional spaces
#=EXRESULT PASS
#
/usr/bin/foo {
network peer=( port = 22-443 ),
}

View File

@@ -429,6 +429,8 @@ syntax_failure = (
# network port range
'network/network_ok_17.sd',
'network/network_ok_45.sd',
'network/network_ok_46.sd',
)