Added more unit tests

This commit is contained in:
Juan Font 2021-07-04 13:01:41 +02:00
parent 07e95393b3
commit d0e970f21d
7 changed files with 165 additions and 11 deletions

View file

@ -20,12 +20,11 @@
// Everyone in the montreal-admins or global-admins group are
// allowed to tag servers as montreal-webserver.
"tag:montreal-webserver": [
"group:montreal-admins",
"group:global-admins",
"group:example",
],
// Only a few admins are allowed to create API servers.
"tag:api-server": [
"group:global-admins",
"tag:production": [
"group:example",
"president@example.com",
],
},
@ -38,7 +37,7 @@
"Action": "accept",
"Users": [
"group:example2",
"192.168.1.1"
"192.168.1.0/24"
],
"Ports": [
"*:22,3389",
@ -62,8 +61,7 @@
{
"Action": "accept",
"Users": [
"example-host-2",
"192.168.1.0/24"
"example-host-2",
],
"Ports": [
"example-host-1:*",

View file

@ -0,0 +1,24 @@
// This ACL is a very basic example to validate the
// expansion of hosts
{
"Hosts": {
"host-1": "100.100.100.100",
"subnet-1": "100.100.101.100/24",
},
"ACLs": [
{
"Action": "accept",
"Users": [
"subnet-1",
"192.168.1.0/24"
],
"Ports": [
"*:22,3389",
"host-1:*",
],
},
],
}

View file

@ -0,0 +1,20 @@
// This ACL is used to test wildcards
{
"Hosts": {
"host-1": "100.100.100.100",
"subnet-1": "100.100.101.100/24",
},
"ACLs": [
{
"Action": "accept",
"Users": [
"testnamespace",
],
"Ports": [
"host-1:*",
],
},
],
}

View file

@ -0,0 +1,20 @@
// This ACL is used to test the port range expansion
{
"Hosts": {
"host-1": "100.100.100.100",
"subnet-1": "100.100.101.100/24",
},
"ACLs": [
{
"Action": "accept",
"Users": [
"subnet-1",
],
"Ports": [
"host-1:5400-5500",
],
},
],
}

View file

@ -0,0 +1,20 @@
// This ACL is used to test wildcards
{
"Hosts": {
"host-1": "100.100.100.100",
"subnet-1": "100.100.101.100/24",
},
"ACLs": [
{
"Action": "accept",
"Users": [
"*",
],
"Ports": [
"host-1:*",
],
},
],
}