Skip to content

Commit

Permalink
demo test
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm committed Sep 23, 2024
1 parent a34c6bf commit c04ee03
Show file tree
Hide file tree
Showing 15 changed files with 798 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/netpol/connlist/connlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,10 @@ var goodPathTests = []struct {
testDirName: "anp_with_banp_new_test",
outputFormats: []string{output.DefaultFormat},
},
{
testDirName: "anp_demo",
outputFormats: ValidFormats,
},
}

func runParsedResourcesConnlistTests(t *testing.T, testList []testutils.ParsedResourcesTest) {
Expand Down
14 changes: 14 additions & 0 deletions test_outputs/connlist/anp_demo_connlist_output.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
src,dst,conn
0.0.0.0-255.255.255.255,hufflepuff/cedric-diggory[StatefulSet],All Connections
0.0.0.0-255.255.255.255,slytherin/draco-malfoy[StatefulSet],All Connections
gryffindor/harry-potter[StatefulSet],0.0.0.0-255.255.255.255,All Connections
gryffindor/harry-potter[StatefulSet],hufflepuff/cedric-diggory[StatefulSet],"SCTP 9003,TCP 8080,UDP 53,5353"
gryffindor/harry-potter[StatefulSet],ravenclaw/luna-lovegood[StatefulSet],UDP 52
gryffindor/harry-potter[StatefulSet],slytherin/draco-malfoy[StatefulSet],"SCTP 1-9002,9004-65535,TCP 1-79,81-65535,UDP 1-52,54-65535"
hufflepuff/cedric-diggory[StatefulSet],0.0.0.0-255.255.255.255,All Connections
hufflepuff/cedric-diggory[StatefulSet],gryffindor/harry-potter[StatefulSet],"SCTP 9003,TCP 80,UDP 5353"
ravenclaw/luna-lovegood[StatefulSet],gryffindor/harry-potter[StatefulSet],All Connections
slytherin/draco-malfoy[StatefulSet],0.0.0.0-255.255.255.255,All Connections
slytherin/draco-malfoy[StatefulSet],gryffindor/harry-potter[StatefulSet],All Connections
slytherin/draco-malfoy[StatefulSet],hufflepuff/cedric-diggory[StatefulSet],All Connections
slytherin/draco-malfoy[StatefulSet],ravenclaw/luna-lovegood[StatefulSet],"TCP 1-79,81-65535"
40 changes: 40 additions & 0 deletions test_outputs/connlist/anp_demo_connlist_output.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
digraph {
subgraph "cluster_gryffindor" {
color="black"
fontcolor="black"
"gryffindor/harry-potter[StatefulSet]" [label="harry-potter[StatefulSet]" color="blue" fontcolor="blue"]
label="gryffindor"
}
subgraph "cluster_hufflepuff" {
color="black"
fontcolor="black"
"hufflepuff/cedric-diggory[StatefulSet]" [label="cedric-diggory[StatefulSet]" color="blue" fontcolor="blue"]
label="hufflepuff"
}
subgraph "cluster_ravenclaw" {
color="black"
fontcolor="black"
"ravenclaw/luna-lovegood[StatefulSet]" [label="luna-lovegood[StatefulSet]" color="blue" fontcolor="blue"]
label="ravenclaw"
}
subgraph "cluster_slytherin" {
color="black"
fontcolor="black"
"slytherin/draco-malfoy[StatefulSet]" [label="draco-malfoy[StatefulSet]" color="blue" fontcolor="blue"]
label="slytherin"
}
"0.0.0.0-255.255.255.255" [label="0.0.0.0-255.255.255.255" color="red2" fontcolor="red2"]
"0.0.0.0-255.255.255.255" -> "hufflepuff/cedric-diggory[StatefulSet]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5]
"0.0.0.0-255.255.255.255" -> "slytherin/draco-malfoy[StatefulSet]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5]
"gryffindor/harry-potter[StatefulSet]" -> "0.0.0.0-255.255.255.255" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"gryffindor/harry-potter[StatefulSet]" -> "hufflepuff/cedric-diggory[StatefulSet]" [label="SCTP 9003,TCP 8080,UDP 53,5353" color="gold2" fontcolor="darkgreen" weight=0.5]
"gryffindor/harry-potter[StatefulSet]" -> "ravenclaw/luna-lovegood[StatefulSet]" [label="UDP 52" color="gold2" fontcolor="darkgreen" weight=0.5]
"gryffindor/harry-potter[StatefulSet]" -> "slytherin/draco-malfoy[StatefulSet]" [label="SCTP 1-9002,9004-65535,TCP 1-79,81-65535,UDP 1-52,54-65535" color="gold2" fontcolor="darkgreen" weight=0.5]
"hufflepuff/cedric-diggory[StatefulSet]" -> "0.0.0.0-255.255.255.255" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"hufflepuff/cedric-diggory[StatefulSet]" -> "gryffindor/harry-potter[StatefulSet]" [label="SCTP 9003,TCP 80,UDP 5353" color="gold2" fontcolor="darkgreen" weight=1]
"ravenclaw/luna-lovegood[StatefulSet]" -> "gryffindor/harry-potter[StatefulSet]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"slytherin/draco-malfoy[StatefulSet]" -> "0.0.0.0-255.255.255.255" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"slytherin/draco-malfoy[StatefulSet]" -> "gryffindor/harry-potter[StatefulSet]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"slytherin/draco-malfoy[StatefulSet]" -> "hufflepuff/cedric-diggory[StatefulSet]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1]
"slytherin/draco-malfoy[StatefulSet]" -> "ravenclaw/luna-lovegood[StatefulSet]" [label="TCP 1-79,81-65535" color="gold2" fontcolor="darkgreen" weight=1]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions test_outputs/connlist/anp_demo_connlist_output.dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions test_outputs/connlist/anp_demo_connlist_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"src": "0.0.0.0-255.255.255.255",
"dst": "hufflepuff/cedric-diggory[StatefulSet]",
"conn": "All Connections"
},
{
"src": "0.0.0.0-255.255.255.255",
"dst": "slytherin/draco-malfoy[StatefulSet]",
"conn": "All Connections"
},
{
"src": "gryffindor/harry-potter[StatefulSet]",
"dst": "0.0.0.0-255.255.255.255",
"conn": "All Connections"
},
{
"src": "gryffindor/harry-potter[StatefulSet]",
"dst": "hufflepuff/cedric-diggory[StatefulSet]",
"conn": "SCTP 9003,TCP 8080,UDP 53,5353"
},
{
"src": "gryffindor/harry-potter[StatefulSet]",
"dst": "ravenclaw/luna-lovegood[StatefulSet]",
"conn": "UDP 52"
},
{
"src": "gryffindor/harry-potter[StatefulSet]",
"dst": "slytherin/draco-malfoy[StatefulSet]",
"conn": "SCTP 1-9002,9004-65535,TCP 1-79,81-65535,UDP 1-52,54-65535"
},
{
"src": "hufflepuff/cedric-diggory[StatefulSet]",
"dst": "0.0.0.0-255.255.255.255",
"conn": "All Connections"
},
{
"src": "hufflepuff/cedric-diggory[StatefulSet]",
"dst": "gryffindor/harry-potter[StatefulSet]",
"conn": "SCTP 9003,TCP 80,UDP 5353"
},
{
"src": "ravenclaw/luna-lovegood[StatefulSet]",
"dst": "gryffindor/harry-potter[StatefulSet]",
"conn": "All Connections"
},
{
"src": "slytherin/draco-malfoy[StatefulSet]",
"dst": "0.0.0.0-255.255.255.255",
"conn": "All Connections"
},
{
"src": "slytherin/draco-malfoy[StatefulSet]",
"dst": "gryffindor/harry-potter[StatefulSet]",
"conn": "All Connections"
},
{
"src": "slytherin/draco-malfoy[StatefulSet]",
"dst": "hufflepuff/cedric-diggory[StatefulSet]",
"conn": "All Connections"
},
{
"src": "slytherin/draco-malfoy[StatefulSet]",
"dst": "ravenclaw/luna-lovegood[StatefulSet]",
"conn": "TCP 1-79,81-65535"
}
]
15 changes: 15 additions & 0 deletions test_outputs/connlist/anp_demo_connlist_output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
| src | dst | conn |
|-----|-----|------|
| 0.0.0.0-255.255.255.255 | hufflepuff/cedric-diggory[StatefulSet] | All Connections |
| 0.0.0.0-255.255.255.255 | slytherin/draco-malfoy[StatefulSet] | All Connections |
| gryffindor/harry-potter[StatefulSet] | 0.0.0.0-255.255.255.255 | All Connections |
| gryffindor/harry-potter[StatefulSet] | hufflepuff/cedric-diggory[StatefulSet] | SCTP 9003,TCP 8080,UDP 53,5353 |
| gryffindor/harry-potter[StatefulSet] | ravenclaw/luna-lovegood[StatefulSet] | UDP 52 |
| gryffindor/harry-potter[StatefulSet] | slytherin/draco-malfoy[StatefulSet] | SCTP 1-9002,9004-65535,TCP 1-79,81-65535,UDP 1-52,54-65535 |
| hufflepuff/cedric-diggory[StatefulSet] | 0.0.0.0-255.255.255.255 | All Connections |
| hufflepuff/cedric-diggory[StatefulSet] | gryffindor/harry-potter[StatefulSet] | SCTP 9003,TCP 80,UDP 5353 |
| ravenclaw/luna-lovegood[StatefulSet] | gryffindor/harry-potter[StatefulSet] | All Connections |
| slytherin/draco-malfoy[StatefulSet] | 0.0.0.0-255.255.255.255 | All Connections |
| slytherin/draco-malfoy[StatefulSet] | gryffindor/harry-potter[StatefulSet] | All Connections |
| slytherin/draco-malfoy[StatefulSet] | hufflepuff/cedric-diggory[StatefulSet] | All Connections |
| slytherin/draco-malfoy[StatefulSet] | ravenclaw/luna-lovegood[StatefulSet] | TCP 1-79,81-65535 |
Loading

0 comments on commit c04ee03

Please sign in to comment.