diff --git a/Makefile b/Makefile
index 0fc3abf3..74a40b1a 100644
--- a/Makefile
+++ b/Makefile
@@ -28,4 +28,4 @@ test:
test-update: # overrides/ generates tests' expected output files for relevant tests
# if the format is dot - generates also png files
@echo -- $@ --
- go test ./pkg/netpol/connlist/ ./pkg/netpol/diff/ --args --update
\ No newline at end of file
+ go test ./pkg/netpol/connlist/ ./pkg/netpol/diff/ ./pkg/cli --args --update
\ No newline at end of file
diff --git a/pkg/cli/command_test.go b/pkg/cli/command_test.go
index 24f16dbc..5d9d0071 100644
--- a/pkg/cli/command_test.go
+++ b/pkg/cli/command_test.go
@@ -2,582 +2,405 @@ package cli
import (
_ "embed"
- "errors"
+ "fmt"
"io"
"os"
"path/filepath"
- "strings"
"testing"
- "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ ioutput "github.com/np-guard/netpol-analyzer/pkg/internal/output"
+ "github.com/np-guard/netpol-analyzer/pkg/internal/testutils"
+ "github.com/np-guard/netpol-analyzer/pkg/logger"
)
var (
stdoutFile *os.File
- stderrFile *os.File
testOutR *os.File
testOutW *os.File
- testErrR *os.File
- testErrW *os.File
-
- //go:embed tests_outputs/test_legal_list.txt
- testLegalListOutput string
)
+const outFileName = "test_out.txt"
+const currentPkg = testutils.Cli
+
+// redirect command's execute stdout to a pipe
func preTestRun() {
stdoutFile = os.Stdout
- stderrFile = os.Stderr
testOutR, testOutW, _ = os.Pipe()
os.Stdout = testOutW
- testErrR, testErrW, _ = os.Pipe()
- os.Stderr = testErrW
}
-// finalize test and get its output
-func postTestRun(isErr bool) string {
+// finalize test's command execute and get its output
+func postTestRun() string {
testOutW.Close()
- testErrW.Close()
out, _ := io.ReadAll(testOutR)
- errOut, _ := io.ReadAll(testErrR)
os.Stdout = stdoutFile
- os.Stderr = stderrFile
- actualOutput := string(out)
- actualErr := string(errOut)
- if isErr {
- return actualErr
- }
- return actualOutput
+ return string(out)
}
-// check that expected is the same as actual
-func sameOutput(t *testing.T, actual, expected, testName string, isFile bool) {
- assert.Equal(t, expected, actual, "error - unexpected output for test %s, isFile: %d", testName, isFile)
-}
-
-// check that expected is contained in actual
-func containedOutput(t *testing.T, actual, expected, testName string, isFile bool) {
- isContained := strings.Contains(actual, expected)
- assert.True(t, isContained, "test %s error: %s not contained in %s, isFile: %d", testName, expected, actual, isFile)
+// build a new command with args list and execute it, returns the actual output from stdout and the execute err if exists
+func buildAndExecuteCommand(args []string) (string, error) {
+ preTestRun()
+ cmd := newCommandRoot()
+ cmd.SetArgs(args)
+ err := cmd.Execute()
+ actualOut := postTestRun()
+ return actualOut, err
}
-func clean(test cmdTest) {
- if test.hasFile {
- os.Remove(outFileName)
+// append the optional args of a command if the values are not empty
+func addCmdOptionalArgs(format, outputFile, focusWorkload string) []string {
+ res := []string{}
+ if focusWorkload != "" {
+ res = append(res, "--focusworkload", focusWorkload)
+ }
+ if format != "" {
+ res = append(res, "--output", format)
}
+ if outputFile != "" {
+ res = append(res, "-f", outputFile)
+ }
+ return res
}
-func runTest(test cmdTest, t *testing.T) {
- // run the test and get its output
- preTestRun()
- rootCmd := newCommandRoot()
- rootCmd.SetArgs(test.args)
- err := rootCmd.Execute()
- if !test.isErr {
- require.Nilf(t, err, "expected no errors, but got %v", err)
- } else {
- require.NotNil(t, err, "expected error, but got no error")
+// determines the file suffix from the format
+func determineFileSuffix(format string) string {
+ fileSuffix := ioutput.DefaultFormat
+ if format != "" {
+ fileSuffix = format
}
- actual := postTestRun(test.isErr)
+ return fileSuffix
+}
- // check if has file and if it exists
- var fileContent []byte
- if test.hasFile {
- _, err := os.Stat(outFileName)
- require.Nil(t, err)
- fileContent, err = os.ReadFile(outFileName)
- require.Nil(t, err)
- }
+// gets the test name and name of expected output file for a list command from its args
+func getListCmdTestNameAndExpectedOutputFile(dirName, focusWorkload, format string) (testName, expectedOutputFileName string) {
+ fileSuffix := determineFileSuffix(format)
+ return testutils.ConnlistTestNameByTestArgs(dirName, focusWorkload, fileSuffix)
+}
- // compare actual to test.expectedOutput
- if test.exact {
- sameOutput(t, actual, test.expectedOutput, test.name, false)
- if test.hasFile {
- sameOutput(t, string(fileContent), test.expectedOutput, test.name, true)
- }
- return
- }
+func testInfo(testName string) string {
+ return fmt.Sprintf("test: %q", testName)
+}
- if test.containment {
- containedOutput(t, actual, test.expectedOutput, test.name, false)
- if test.hasFile {
- containedOutput(t, string(fileContent), test.expectedOutput, test.name, true)
+// removes the output file generated for commands which run with `-f` flag
+func removeOutFile(outputFile string) {
+ if outputFile != "" {
+ err := os.Remove(outputFile)
+ if err != nil {
+ logger.NewDefaultLogger().Warnf("file %q was not removed; os error: %v occurred", outputFile, err)
}
- return
}
-
- assert.Error(t, errors.New(""), "test %s: missing containment or equality flag for test")
}
-type cmdTest struct {
- name string
- args []string
- expectedOutput string
- exact bool
- containment bool
- isErr bool
- hasFile bool
+// helping func, reads output file contents and compares it with expected output
+func checkFileContentVsExpectedOutput(t *testing.T, outputFile, expectedFile, tInfo string) {
+ actualOutFromFile, err := os.ReadFile(outputFile)
+ if err != nil {
+ testutils.WarnOnErrorReadingFile(err, outputFile)
+ }
+ testutils.CheckActualVsExpectedOutputMatch(t, expectedFile, string(actualOutFromFile), tInfo, currentPkg)
+ removeOutFile(outputFile)
}
-const outFileName = "test_out.txt"
-
-func TestCommands(t *testing.T) {
- tests := []cmdTest{
+// TestCommandsFailExecute - tests executing failure for illegal commands or commands with invalid args or with wrong input values
+func TestCommandsFailExecute(t *testing.T) {
+ tests := []struct {
+ name string
+ args []string
+ expectedErrorContains string
+ }{
{
- name: "test_illegal_command",
- args: []string{"A"},
- expectedOutput: "Error: unknown command \"A\" for \"k8snetpolicy\"",
- containment: true,
- isErr: true,
+ name: "unknown_command_should_return_error_of_unknown_command_for_k8snetpolicy",
+ args: []string{"A"},
+ expectedErrorContains: "unknown command \"A\" for \"k8snetpolicy\"",
},
-
{
- name: "test_illegal_eval_no_args",
- args: []string{"eval"},
- expectedOutput: "no source defined",
- containment: true,
- isErr: true,
+ name: "eval_command_with_no_args_is_illegal_should_return_error_of_undefined_source",
+ args: []string{"eval"},
+ expectedErrorContains: "no source defined",
},
-
{
- name: "test_illegal_diff_no_args",
- args: []string{"diff"},
- expectedOutput: "both directory paths dir1 and dir2 are required",
- containment: true,
- isErr: true,
+ name: "diff_command_with_no_args_is_illegal_should_return_error_there_are_required_flags",
+ args: []string{"diff"},
+ expectedErrorContains: "both directory paths dir1 and dir2 are required",
},
{
- name: "test_illegal_diff_unsupported_args",
- args: []string{"diff", "--dirpath", filepath.Join(getTestsDir(), "onlineboutique")},
- expectedOutput: "dirpath flag is not used with diff command",
- containment: true,
- isErr: true,
+ name: "diff_command_args_contain_dirpath_should_return_error_of_unsupported_flag",
+ args: []string{"diff", "--dirpath", filepath.Join(testutils.GetTestsDir(currentPkg),
+ "onlineboutique")},
+ expectedErrorContains: "dirpath flag is not used with diff command",
},
{
- name: "test_illegal_diff_output_format",
+ name: "diff_command_with_unsupported_output_format_should_return_error",
args: []string{
"diff",
"--dir1",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_workloads"),
"--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_workloads_changed_workloads"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_workloads_changed_workloads"),
"-o",
"png"},
- expectedOutput: "png output format is not supported.",
- containment: true,
- isErr: true,
+ expectedErrorContains: "png output format is not supported.",
},
{
- name: "test_illegal_eval_peer_not_found",
+ name: "eval_command_with_not_existing_peer_should_return_error_not_found_peer",
args: []string{
"eval",
"--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique"),
"-s",
"default/adservice-77d5cd745d-t8mx4",
"-d",
"default/emailservice-54c7c5d9d-vp27n",
"-p",
"80"},
- expectedOutput: "could not find peer default/default/adservice-77d5cd745d",
- containment: true,
- isErr: true,
+ expectedErrorContains: "could not find peer default/default/adservice-77d5cd745d",
},
-
{
- name: "test_legal_eval",
+ name: "list_command_with_unsupported_output_format_should_return_error",
args: []string{
- "eval",
+ "list",
"--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique"),
- "-s",
- "adservice-77d5cd745d-t8mx4",
- "-d",
- "emailservice-54c7c5d9d-vp27n",
- "-p",
- "80"},
- expectedOutput: "default/adservice-77d5cd745d-t8mx4 => default/emailservice-54c7c5d9d-vp27n over tcp/80: false\n",
- exact: true,
- isErr: false,
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique"),
+ "-o",
+ "png"},
+ expectedErrorContains: "png output format is not supported.",
},
-
{
- name: "test_legal_list",
+ name: "test_using_q_and_v_verbosity_flags_together_should_return_an_error_of_illegal_use_of_quiet_and_verbose_flags",
args: []string{
"list",
"--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_workloads"),
+ "-q",
+ "-v",
},
- expectedOutput: testLegalListOutput,
- exact: true,
- isErr: false,
+ expectedErrorContains: "-q and -v cannot be specified together",
},
-
{
- name: "test_legal_list_with_out_file",
+ name: "eval_command_on_dir_with_severe_error_with_fail_flag_stops_executing_and_returns_the_severe_err_as_err",
args: []string{
- "list",
+ "eval",
"--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique"),
- "-f",
- outFileName,
- },
- expectedOutput: testLegalListOutput,
- exact: true,
- isErr: false,
- hasFile: true,
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_with_pods_severe_error"),
+ "-s",
+ "adservice-77d5cd745d-t8mx4",
+ "-d",
+ "emailservice-54c7c5d9d-vp27n",
+ "-p",
+ "80",
+ "--fail"},
+ expectedErrorContains: "found character that cannot start any token",
},
+ }
+ for _, tt := range tests {
+ tt := tt
+ t.Run(tt.name, func(t *testing.T) {
+ _, err := buildAndExecuteCommand(tt.args)
+ require.Contains(t, err.Error(), tt.expectedErrorContains,
+ "error mismatch for test %q, actual: %q, expected contains: %q", tt.name, err.Error(), tt.expectedErrorContains)
+ })
+ }
+}
+// TestListCommandOutput tests the output of legal list command
+func TestListCommandOutput(t *testing.T) {
+ cases := []struct {
+ dirName string
+ focusWorkload string
+ format string
+ outputFile string
+ }{
+ // when focusWorkload is empty, output should be the connlist of the dir
+ // when format is empty - output should be in defaultFormat (txt)
+ // when outputFile is empty - output should be written to stout only
{
- name: "test_legal_list_with_focus_workload",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "emailservice",
- },
- expectedOutput: "default/checkoutservice[Deployment] => default/emailservice[Deployment] : TCP 8080",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique",
},
{
- name: "test_legal_list_with_focus_workload_format_of_ns_and_name",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "default/emailservice",
- },
- expectedOutput: "default/checkoutservice[Deployment] => default/emailservice[Deployment] : TCP 8080",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "emailservice",
},
{
- name: "test_legal_list_with_focus_workload_of_ingress_controller",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "acs-security-demos"),
- "--focusworkload",
- "ingress-controller",
- },
- expectedOutput: "{ingress-controller} => frontend/asset-cache[Deployment] : TCP 8080\n" +
- "{ingress-controller} => frontend/webapp[Deployment] : TCP 8080",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "default/emailservice",
},
{
- name: "test_legal_list_with_focus_workload_json_output",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "emailservice",
- "--output",
- "json",
- },
- expectedOutput: "[\n" +
- " {\n" +
- " \"src\": \"default/checkoutservice[Deployment]\",\n" +
- " \"dst\": \"default/emailservice[Deployment]\",\n" +
- " \"conn\": \"TCP 8080\"\n" +
- " }\n" +
- "]",
- exact: true,
- isErr: false,
+ dirName: "acs-security-demos",
+ focusWorkload: "ingress-controller",
},
-
{
- name: "test_illegal_list_output_format",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique"),
- "-o",
- "png"},
- expectedOutput: "png output format is not supported.",
- containment: true,
- isErr: true,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "emailservice",
+ format: ioutput.JSONFormat,
},
-
{
- name: "test_legal_list_with_focus_workload_dot_output",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "emailservice",
- "--output",
- "dot",
- },
- expectedOutput: "digraph {\n" +
- "\tsubgraph cluster_default {\n" +
- "\t\t\"checkoutservice[Deployment]\" [label=\"checkoutservice[Deployment]\" color=\"blue\" fontcolor=\"blue\"]\n" +
- "\t\t\"emailservice[Deployment]\" [label=\"emailservice[Deployment]\" color=\"blue\" fontcolor=\"blue\"]\n" +
- "\t\tlabel=\"default\"\n" +
- "\t}\n" +
- "\t\"checkoutservice[Deployment]\" -> \"emailservice[Deployment]\" [label=\"TCP 8080\" color=\"gold2\" fontcolor=\"darkgreen\"]\n" +
- "}",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "emailservice",
+ format: ioutput.DOTFormat,
},
-
{
- name: "test_legal_list_with_focus_workload_csv_output",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "emailservice",
- "--output",
- "csv",
- },
- expectedOutput: "src,dst,conn\n" +
- "default/checkoutservice[Deployment],default/emailservice[Deployment],TCP 8080\n",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "emailservice",
+ format: ioutput.CSVFormat,
},
-
{
- name: "test_legal_list_with_focus_workload_md_output",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--focusworkload",
- "emailservice",
- "--output",
- "md",
- },
- expectedOutput: "| src | dst | conn |\n" +
- "|-----|-----|------|\n" +
- "| default/checkoutservice[Deployment] | default/emailservice[Deployment] | TCP 8080 |",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique_workloads",
+ focusWorkload: "emailservice",
+ format: ioutput.MDFormat,
},
{
- name: "test_illegal_use_of_quiet_and_verbose_flags",
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "-q",
- "-v",
- },
- expectedOutput: "-q and -v cannot be specified together",
- containment: true,
- isErr: true,
+ // the test contains malformed yaml beside to legal yaml.
+ // analysis is able to parse some deployments, thus can produce connectivity output
+ dirName: "document_with_syntax_error",
},
{
- name: "test_legal_diff_txt_output",
- args: []string{
- "diff",
- "--dir1",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_workloads_changed_workloads"),
- "--output",
- "txt",
- },
- expectedOutput: "Connectivity diff:\n" +
- "diff-type: added, source: 0.0.0.0-255.255.255.255, destination: default/unicorn[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/redis-cart[Deployment], destination: default/unicorn[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/unicorn[Deployment], destination: 0.0.0.0-255.255.255.255, dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/unicorn[Deployment], destination: default/redis-cart[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added",
- exact: true,
- isErr: false,
+ dirName: "onlineboutique",
+ outputFile: outFileName,
},
+ }
+ for _, tt := range cases {
+ tt := tt
+ testName, expectedOutputFileName := getListCmdTestNameAndExpectedOutputFile(tt.dirName, tt.focusWorkload, tt.format)
+ t.Run(testName, func(t *testing.T) {
+ args := []string{"list", "--dirpath", filepath.Join(testutils.GetTestsDir(currentPkg), tt.dirName)}
+ args = append(args, addCmdOptionalArgs(tt.format, tt.outputFile, tt.focusWorkload)...)
+ actualOut, err := buildAndExecuteCommand(args)
+ require.Nil(t, err, "test: %q", testName)
+ testutils.CheckActualVsExpectedOutputMatch(t, expectedOutputFileName, actualOut, testInfo(testName), currentPkg)
+ if tt.outputFile != "" {
+ checkFileContentVsExpectedOutput(t, tt.outputFile, expectedOutputFileName, testInfo(testName))
+ }
+ removeOutFile(tt.outputFile)
+ })
+ }
+}
+
+// TestDiffCommandOutput tests the output of legal diff command
+func TestDiffCommandOutput(t *testing.T) {
+ cases := []struct {
+ dir1 string
+ dir2 string
+ format string
+ outputFile string
+ }{
{
- name: "test_legal_diff_txt_output_with_file",
- args: []string{
- "diff",
- "--dir1",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_workloads_changed_workloads"),
- "--output",
- "txt",
- "-f",
- outFileName,
- },
- expectedOutput: "Connectivity diff:\n" +
- "diff-type: added, source: 0.0.0.0-255.255.255.255, destination: default/unicorn[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/redis-cart[Deployment], destination: default/unicorn[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/unicorn[Deployment], destination: 0.0.0.0-255.255.255.255, dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added\n" +
- "diff-type: added, source: default/unicorn[Deployment], destination: default/redis-cart[Deployment], dir1:" +
- " No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added",
- exact: true,
- isErr: false,
- hasFile: true,
+ dir1: "onlineboutique_workloads",
+ dir2: "onlineboutique_workloads_changed_workloads",
+ format: ioutput.TextFormat,
},
{
- name: "test_legal_diff_csv_output",
- args: []string{
- "diff",
- "--dir1",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_workloads_changed_workloads"),
- "--output",
- "csv",
- },
- expectedOutput: "diff-type,source,destination,dir1,dir2,workloads-diff-info\n" +
- "added,0.0.0.0-255.255.255.255,default/unicorn[Deployment],No Connections,All Connections," +
- "workload default/unicorn[Deployment] added\n" +
- "added,default/redis-cart[Deployment],default/unicorn[Deployment],No Connections,All Connections," +
- "workload default/unicorn[Deployment] added\n" +
- "added,default/unicorn[Deployment],0.0.0.0-255.255.255.255,No Connections,All Connections," +
- "workload default/unicorn[Deployment] added\n" +
- "added,default/unicorn[Deployment],default/redis-cart[Deployment],No Connections,All Connections," +
- "workload default/unicorn[Deployment] added\n" +
- "",
- exact: true,
- isErr: false,
+ dir1: "onlineboutique_workloads",
+ dir2: "onlineboutique_workloads_changed_workloads",
+ format: ioutput.CSVFormat,
},
{
- name: "test_legal_diff_md_output",
- args: []string{
- "diff",
- "--dir1",
- filepath.Join(getTestsDir(), "onlineboutique_workloads"),
- "--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_workloads_changed_workloads"),
- "--output",
- "md",
- },
- expectedOutput: "| diff-type | source | destination | dir1 | dir2 | workloads-diff-info |\n" +
- "|-----------|--------|-------------|------|------|---------------------|\n" +
- "| added | 0.0.0.0-255.255.255.255 | default/unicorn[Deployment] | No Connections " +
- "| All Connections | workload default/unicorn[Deployment] added |\n" +
- "| added | default/redis-cart[Deployment] | default/unicorn[Deployment] | No Connections " +
- "| All Connections | workload default/unicorn[Deployment] added |\n" +
- "| added | default/unicorn[Deployment] | 0.0.0.0-255.255.255.255 | No Connections " +
- "| All Connections | workload default/unicorn[Deployment] added |\n" +
- "| added | default/unicorn[Deployment] | default/redis-cart[Deployment] | No Connections " +
- "| All Connections | workload default/unicorn[Deployment] added |",
- exact: true,
- isErr: false,
+ dir1: "onlineboutique_workloads",
+ dir2: "onlineboutique_workloads_changed_workloads",
+ format: ioutput.MDFormat,
},
{
- name: "test_legal_list_dir_with_severe_error_and_produces_legal_output",
- // the test contains malformed yaml beside to legal yaml.
- // MalformedYamlDocError is not fatal, thus not returned
- // analysis is able to parse some deployments, thus can produce connectivity output
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "bad_yamls", "document_with_syntax_error.yaml"),
- },
- expectedOutput: "0.0.0.0-255.255.255.255 => default/checkoutservice[Deployment] : All Connections\n" +
- "0.0.0.0-255.255.255.255 => default/emailservice[Deployment] : All Connections\n" +
- "0.0.0.0-255.255.255.255 => default/recommendationservice[Deployment] : All Connections\n" +
- "default/checkoutservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections\n" +
- "default/checkoutservice[Deployment] => default/emailservice[Deployment] : All Connections\n" +
- "default/checkoutservice[Deployment] => default/recommendationservice[Deployment] : All Connections\n" +
- "default/emailservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections\n" +
- "default/emailservice[Deployment] => default/checkoutservice[Deployment] : All Connections\n" +
- "default/emailservice[Deployment] => default/recommendationservice[Deployment] : All Connections\n" +
- "default/recommendationservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections\n" +
- "default/recommendationservice[Deployment] => default/checkoutservice[Deployment] : All Connections\n" +
- "default/recommendationservice[Deployment] => default/emailservice[Deployment] : All Connections",
- exact: true,
- isErr: false,
+ // when format is empty - output should be in defaultFormat (txt)
+ dir1: "onlineboutique",
+ dir2: "onlineboutique_with_pods_severe_error",
},
{
- name: "test_list_dir_with_severe_error_running_with_fail_stops_and_return_empty_output",
- // as we saw in a previous test on same path, when --fail is not used, the test produces connectivity map
- args: []string{
- "list",
- "--dirpath",
- filepath.Join(getTestsDir(), "bad_yamls", "document_with_syntax_error.yaml"),
- "--fail",
- },
- expectedOutput: "found character that cannot start any token",
- exact: false,
- isErr: true, // fatal error because err is issued by the builder and uses stopOnErr
+ dir1: "onlineboutique_workloads",
+ dir2: "onlineboutique_workloads_changed_workloads",
+ format: ioutput.TextFormat,
+ outputFile: outFileName,
},
+ }
+ for _, tt := range cases {
+ tt := tt
+ testName, expectedOutputFileName := testutils.DiffTestNameByTestArgs(tt.dir1, tt.dir2, determineFileSuffix(tt.format))
+ t.Run(testName, func(t *testing.T) {
+ args := []string{"diff", "--dir1", filepath.Join(testutils.GetTestsDir(currentPkg), tt.dir1), "--dir2",
+ filepath.Join(testutils.GetTestsDir(currentPkg), tt.dir2)}
+ args = append(args, addCmdOptionalArgs(tt.format, tt.outputFile, "")...)
+ actualOut, err := buildAndExecuteCommand(args)
+ require.Nil(t, err, "test: %q", testName)
+ testutils.CheckActualVsExpectedOutputMatch(t, expectedOutputFileName, actualOut, testInfo(testName), currentPkg)
+
+ if tt.outputFile != "" {
+ checkFileContentVsExpectedOutput(t, tt.outputFile, expectedOutputFileName, testInfo(testName))
+ }
+ })
+ }
+}
+
+// TestEvalCommandOutput tests the output of legal eval command
+func TestEvalCommandOutput(t *testing.T) {
+ cases := []struct {
+ dir string
+ sourcePod string
+ destPod string
+ port string
+ evalResult bool
+ }{
{
- name: "test_diff_one_dir_with_severe_error_without_fail_produces_output",
- args: []string{
- "diff",
- "--dir1",
- filepath.Join(getTestsDir(), "onlineboutique"),
- "--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_with_pods_severe_error")},
- expectedOutput: "Connectivity diff:\n" +
- "diff-type: changed, source: default/frontend-99684f7f8[ReplicaSet], " +
- "destination: default/adservice-77d5cd745d[ReplicaSet], dir1: TCP 9555, dir2: TCP 8080",
- exact: true,
- isErr: false,
+ dir: "onlineboutique",
+ sourcePod: "adservice-77d5cd745d-t8mx4",
+ destPod: "emailservice-54c7c5d9d-vp27n",
+ port: "80",
+ evalResult: false,
+ },
+ {
+ dir: "onlineboutique_with_pods_severe_error",
+ sourcePod: "adservice-77d5cd745d-t8mx4",
+ destPod: "emailservice-54c7c5d9d-vp27n",
+ port: "80",
+ evalResult: false,
},
+ }
+ for _, tt := range cases {
+ tt := tt
+ testName := "eval_" + tt.dir + "_from_" + tt.sourcePod + "_to_" + tt.destPod
+ t.Run(testName, func(t *testing.T) {
+ args := []string{"eval", "--dirpath", filepath.Join(testutils.GetTestsDir(currentPkg), tt.dir),
+ "-s", tt.sourcePod, "-d", tt.destPod, "-p", tt.port}
+ actualOut, err := buildAndExecuteCommand(args)
+ require.Nil(t, err, "test: %q", testName)
+ require.Contains(t, actualOut, fmt.Sprintf("%v", tt.evalResult),
+ "unexpected result for test %q, should be %v", testName, tt.evalResult)
+ })
+ }
+}
+
+// TestCommandWithFailFlag testing list or diff commands with --fail flag
+// if there are severe errors on any input dir, command run should stop and return empty result
+func TestCommandWithFailFlag(t *testing.T) {
+ cases := []struct {
+ name string
+ args []string
+ }{
{
- name: "test_diff_one_dir_with_severe_error_with_fail_returns_empty_output",
+ name: "diff_command_with_fail_flag_one_dir_with_severe_error_should_return_empty_output",
args: []string{
"diff",
"--dir1",
- filepath.Join(getTestsDir(), "onlineboutique"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique"),
"--dir2",
- filepath.Join(getTestsDir(), "onlineboutique_with_pods_severe_error"),
+ filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_with_pods_severe_error"),
"--fail"},
- expectedOutput: "found character that cannot start any token",
- exact: false,
- isErr: true,
},
{
- name: "test_eval_on_dir_with_severe_error_without_fail_produces_output",
- args: []string{
- "eval",
- "--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_with_pods_severe_error"),
- "-s",
- "adservice-77d5cd745d-t8mx4",
- "-d",
- "emailservice-54c7c5d9d-vp27n",
- "-p",
- "80"},
- expectedOutput: "default/adservice-77d5cd745d-t8mx4 => default/emailservice-54c7c5d9d-vp27n over tcp/80: false\n",
- exact: true,
- isErr: false,
- },
- {
- name: "test_eval_on_dir_with_severe_error_wit_fail_returns_err_output",
+ name: "list_cmd_dir_with_severe_error_running_with_fail_stops_and_return_empty_output",
+ // as we saw in a previous test on same path, when --fail is not used, the test produces connectivity map
args: []string{
- "eval",
+ "list",
"--dirpath",
- filepath.Join(getTestsDir(), "onlineboutique_with_pods_severe_error"),
- "-s",
- "adservice-77d5cd745d-t8mx4",
- "-d",
- "emailservice-54c7c5d9d-vp27n",
- "-p",
- "80",
- "--fail"},
- expectedOutput: "found character that cannot start any token",
- exact: false,
- isErr: true, // eval command returns err if stopOnFirstError & severe
+ filepath.Join(testutils.GetTestsDir(currentPkg), "document_with_syntax_error"),
+ "--fail",
+ },
},
}
-
- for _, test := range tests {
- runTest(test, t)
- clean(test)
+ for _, tt := range cases {
+ tt := tt
+ t.Run(tt.name, func(t *testing.T) {
+ actualOut, _ := buildAndExecuteCommand(tt.args)
+ require.Empty(t, actualOut, "unexpected result for test %q, should be empty", tt.name)
+ })
}
}
-
-func getTestsDir() string {
- currentDir, _ := os.Getwd()
- res := filepath.Join(currentDir, "..", "..", "tests")
- return res
-}
diff --git a/pkg/internal/testutils/testutils.go b/pkg/internal/testutils/testutils.go
index dd265522..1663ec26 100644
--- a/pkg/internal/testutils/testutils.go
+++ b/pkg/internal/testutils/testutils.go
@@ -2,7 +2,6 @@ package testutils
import (
"flag"
- "fmt"
"os"
"os/exec"
"path/filepath"
@@ -19,57 +18,90 @@ import (
var update = flag.Bool("update", false, "write or override golden files")
const (
- dirLevelUp = ".."
- testsDirName = "tests"
- standardPkgLevelDepth = 3 // e.g. pkg/netpol/connlist
- internalPkgLevelDepth = 5 // e.g. pkg/netpol/connlist/internal/ingressanalyzer
+ dirLevelUp = ".."
+ testsDirName = "tests"
+ connlistExpectedOutputFilePartialName = "connlist_output."
+ netpolPkgLevelDepth = 3 // e.g. pkg/netpol/connlist
+ underscore = "_"
+ dotSign = "."
+ formatStr = "_format_"
+ outputFilesDir = "test_outputs"
+ focusWlAnnotation = "_focus_workload_"
)
-func GetTestsDir() string {
- return GetTestsDirWithDepth(standardPkgLevelDepth)
-}
+// packages names
+const (
+ Cli = "cli"
+ Connlist = "connlist"
+ Ingressanalyzer = "ingressanalyzer"
+ Diff = "diff"
+ Eval = "eval"
+)
+
+// const map , for each pkg name returns its depth in the project's path
+var pkgToDepth map[string]int = map[string]int{Cli: 2, Connlist: netpolPkgLevelDepth, Ingressanalyzer: 5,
+ Diff: netpolPkgLevelDepth, Eval: netpolPkgLevelDepth}
-func GetTestsDirFromInternalPkg() string {
- return GetTestsDirWithDepth(internalPkgLevelDepth)
+func GetTestsDir(testingPkg string) string { // called from netpol packages
+ return getDirWithDepth(testsDirName, pkgToDepth[testingPkg])
}
-func GetTestsDirWithDepth(depth int) string {
+func getDirWithDepth(dirName string, depth int) string {
res, _ := os.Getwd()
for i := 0; i < depth; i++ {
res = filepath.Join(res, dirLevelUp)
}
- return filepath.Join(res, testsDirName)
+ return filepath.Join(res, dirName)
}
-// GetDebugMsgWithTestNameAndFormat: testing helping func - writes debug message for good path tests
-func GetDebugMsgWithTestNameAndFormat(testName, format string) string {
- return fmt.Sprintf("test: %q, output format: %q", testName, format)
+// ConnlistTestNameByTestArgs returns connlist test name and test's expected output file from some tests args
+func ConnlistTestNameByTestArgs(dirName, focusWorkload, format string) (testName, expectedOutputFileName string) {
+ namePrefix := dirName
+ if focusWorkload != "" {
+ namePrefix += focusWlAnnotation + strings.Replace(focusWorkload, "/", underscore, 1)
+ }
+ testName = namePrefix + formatStr + format
+ expectedOutputFileName = namePrefix + underscore + connlistExpectedOutputFilePartialName + format
+ return testName, expectedOutputFileName
+}
+
+// DiffTestNameByTestArgs returns diff test name and test's expected output file from some tests args
+func DiffTestNameByTestArgs(ref1, ref2, format string) (testName, expectedOutputFileName string) {
+ namePrefix := "diff_between_" + ref2 + "_and_" + ref1
+ testName = namePrefix + formatStr + format
+ expectedOutputFileName = namePrefix + dotSign + format
+ return testName, expectedOutputFileName
}
// CheckActualVsExpectedOutputMatch: testing helping func - checks if actual output matches expected output,
// if not generates actual output file
// if --update flag is on, writes the actual output to the expected output file
-func CheckActualVsExpectedOutputMatch(t *testing.T, testName, dirName, expectedOutputFileName, actualOutput, testInfo string) {
- expectedOutputFile := filepath.Join(GetTestsDir(), dirName, expectedOutputFileName)
+func CheckActualVsExpectedOutputMatch(t *testing.T, expectedOutputFileName, actualOutput, testInfo, testingPkg string) {
+ expectedOutputFile := filepath.Join(getDirWithDepth(outputFilesDir, pkgToDepth[testingPkg]), testingPkg, expectedOutputFileName)
// if the --update flag is on (then generate/ override the expected output file with the actualOutput)
if *update {
err := output.WriteToFile(actualOutput, expectedOutputFile)
- require.Nil(t, err, testInfo)
+ if err != nil {
+ warnOnErrorWritingFile(err, expectedOutputFile)
+ }
// if format is dot - generate/ override also png graph file using graphviz program
if strings.HasSuffix(expectedOutputFile, dotSign+output.DOTFormat) {
- err = generateGraphFilesIfPossible(expectedOutputFile)
- require.Nil(t, err, testInfo)
+ generateGraphFilesIfPossible(expectedOutputFile)
}
return
}
// read expected output file
expectedOutput, err := os.ReadFile(expectedOutputFile)
- require.Nil(t, err, testInfo)
+ if err != nil {
+ WarnOnErrorReadingFile(err, expectedOutputFile)
+ }
actualOutputFileName := "actual_" + expectedOutputFileName
- actualOutputFile := filepath.Join(GetTestsDir(), dirName, actualOutputFileName)
+ actualOutputFile := filepath.Join(getDirWithDepth(outputFilesDir, pkgToDepth[testingPkg]), testingPkg, actualOutputFileName)
if cleanStr(string(expectedOutput)) != cleanStr(actualOutput) {
err := output.WriteToFile(actualOutput, actualOutputFile)
- require.Nil(t, err, testInfo)
+ if err != nil {
+ warnOnErrorWritingFile(err, actualOutputFile)
+ }
}
require.Equal(t, cleanStr(string(expectedOutput)), cleanStr(actualOutput),
"output mismatch for %s, actual output file %q vs expected output file: %q",
@@ -77,6 +109,14 @@ func CheckActualVsExpectedOutputMatch(t *testing.T, testName, dirName, expectedO
actualOutputFile, expectedOutputFile)
}
+func WarnOnErrorReadingFile(err error, file string) {
+ logger.NewDefaultLogger().Warnf("failed reading file %q; os error: %v occurred", file, err)
+}
+
+func warnOnErrorWritingFile(err error, file string) {
+ logger.NewDefaultLogger().Warnf("failed writing to file %q; unexpected error %v occurred", file, err)
+}
+
func cleanStr(str string) string {
return strings.ReplaceAll(strings.ReplaceAll(str, "\n", ""), "\r", "")
}
@@ -91,24 +131,22 @@ func CheckErrorContainment(t *testing.T, testInfo, expectedErrorMsg, actualErrMs
const (
// the executable we need from graphviz is "dot"
executableNameForGraphviz = output.DOTFormat
- dotSign = "."
)
var graphsSuffixes = []string{"png", "svg"}
// checks if "graphviz" executable exists, if yes runs a cmd to generates a png graph file from the dot output
-func generateGraphFilesIfPossible(dotFilePath string) error {
+func generateGraphFilesIfPossible(dotFilePath string) {
// check if graphviz is installed to continue
if _, err := exec.LookPath(executableNameForGraphviz); err != nil {
logger.NewDefaultLogger().Warnf("dot executable of graphviz was not found. Output Graphs will not be generated")
- return nil
+ return
}
for _, graphSuffix := range graphsSuffixes {
graphFilePath := dotFilePath + dotSign + graphSuffix
cmd := exec.Command("dot", dotFilePath, "-T"+graphSuffix, "-o", graphFilePath) //nolint:gosec // nosec
if err := cmd.Run(); err != nil {
- return err
+ logger.NewDefaultLogger().Warnf("failed generating %q; unexpected error: %v", graphFilePath, err)
}
}
- return nil
}
diff --git a/pkg/netpol/connlist/connlist_test.go b/pkg/netpol/connlist/connlist_test.go
index 65a70163..37e69b43 100644
--- a/pkg/netpol/connlist/connlist_test.go
+++ b/pkg/netpol/connlist/connlist_test.go
@@ -1,8 +1,8 @@
package connlist
import (
+ "fmt"
"path/filepath"
- "strings"
"testing"
"github.com/np-guard/netpol-analyzer/pkg/internal/output"
@@ -12,11 +12,9 @@ import (
"github.com/stretchr/testify/require"
)
-const connlistExpectedOutputFileNamePrefix = "connlist_output."
-const underscore = "_"
-
const ResourceInfosFunc = "ConnlistFromResourceInfos"
const DirPathFunc = "ConnlistFromDirPath"
+const currentPkg = testutils.Connlist
var allFormats = []string{output.TextFormat, output.JSONFormat, output.CSVFormat, output.MDFormat, output.DOTFormat}
var connlistTestedAPIS = []string{ResourceInfosFunc, DirPathFunc}
@@ -61,7 +59,7 @@ interfaces to test:
json: cannot unmarshal array into Go value of type unstructured.detector"
(4) bad JSON/YAML - missing kind : "Error: unable to decode "tests\\malformed-pod-example-4\\pods.json":
Object 'Kind' is missing in '{ ... }"
- (5) YAML doc with syntax error: "error parsing tests/bad_yamls/document_with_syntax_error.yaml: error
+ (5) YAML doc with syntax error: "error parsing tests/document_with_syntax_error.yaml: error
converting YAML to JSON: yaml: line 19: found character that cannot start any token"
*/
@@ -81,8 +79,8 @@ func TestConnListFromDir(t *testing.T) {
require.Nil(t, err, pTest.testInfo)
out, err := pTest.analyzer.ConnectionsListToString(res)
require.Nil(t, err, pTest.testInfo)
- testutils.CheckActualVsExpectedOutputMatch(t, pTest.testName, tt.testDirName,
- pTest.expectedOutputFileName, out, pTest.testInfo)
+ testutils.CheckActualVsExpectedOutputMatch(t, pTest.expectedOutputFileName, out,
+ pTest.testInfo, currentPkg)
}
})
}
@@ -104,8 +102,8 @@ func TestConnListFromResourceInfos(t *testing.T) {
require.Nil(t, err, pTest.testInfo)
out, err := pTest.analyzer.ConnectionsListToString(res)
require.Nil(t, err, pTest.testInfo)
- testutils.CheckActualVsExpectedOutputMatch(t, pTest.testName, tt.testDirName,
- pTest.expectedOutputFileName, out, pTest.testInfo)
+ testutils.CheckActualVsExpectedOutputMatch(t, pTest.expectedOutputFileName, out,
+ pTest.testInfo, currentPkg)
}
})
}
@@ -270,7 +268,7 @@ func TestConnlistAnalyzeSevereErrorsAndWarnings(t *testing.T) {
/*{
// this error issued by builder
name: "input_file_has_malformed_yaml_doc_should_return_severe_error",
- dirName: filepath.Join("bad_yamls", "document_with_syntax_error.yaml"),
+ dirName: "document_with_syntax_error",
expectedErrNumWithoutStopOnErr: 2,
expectedErrNumWithStopOnErr: 1,
firstErrStrContains: "found character that cannot start any token", //"YAML document is malformed",
@@ -447,7 +445,7 @@ func TestNotContainedOutputLines(t *testing.T) {
// helping func - returns test's dir path from test's dir name
func getDirPathFromDirName(dirName string) string {
- return filepath.Join(testutils.GetTestsDir(), dirName)
+ return filepath.Join(testutils.GetTestsDir(currentPkg), dirName)
}
// helping func - creates ConnlistAnalyzer with desired opts and returns the analyzer with connlist from provided directory
@@ -457,16 +455,6 @@ func getConnlistFromDirPathRes(opts []ConnlistAnalyzerOption, dirName string) (*
return analyzer, res, err
}
-// helping func - creates the analyzer , gets connlist and writes it to string and verifies results
-/*func verifyConnlistAnalyzeOutputVsExpectedOutput(t *testing.T, analyzerOptions []ConnlistAnalyzerOption, dirName,
- expectedOutputFileName, testName, format string) {
- analyzer, res, err := getConnlistFromDirPathRes(analyzerOptions, dirName)
- require.Nil(t, err, utils.GetDebugMsgWithTestNameAndFormat(testName, format))
- out, err := analyzer.ConnectionsListToString(res)
- require.Nil(t, err, utils.GetDebugMsgWithTestNameAndFormat(testName, format))
- utils.CheckActualVsExpectedOutputMatch(t, testName, dirName, expectedOutputFileName, out, format)
-}*/
-
// helping func - if focus workload is not empty append it to ConnlistAnalyzerOption list
func appendFocusWorkloadOptIfRequired(focusWorkload string) []ConnlistAnalyzerOption {
analyzerOptions := []ConnlistAnalyzerOption{}
@@ -476,19 +464,6 @@ func appendFocusWorkloadOptIfRequired(focusWorkload string) []ConnlistAnalyzerOp
return analyzerOptions
}
-func testNameByTestType(dirName, focusWorkload, format string) (testName, expectedOutputFileName string) {
- switch {
- case focusWorkload == "":
- return dirName, connlistExpectedOutputFileNamePrefix + format
-
- case focusWorkload != "":
- focusWorkloadStr := strings.Replace(focusWorkload, "/", underscore, 1)
- return "dir_" + dirName + "_focus_workload_" + focusWorkloadStr,
- focusWorkloadStr + underscore + connlistExpectedOutputFileNamePrefix + format
- }
- return "", ""
-}
-
type preparedTest struct {
testName string
testInfo string
@@ -499,8 +474,8 @@ type preparedTest struct {
func prepareTest(dirName, focusWorkload, format string) preparedTest {
res := preparedTest{}
- res.testName, res.expectedOutputFileName = testNameByTestType(dirName, focusWorkload, format)
- res.testInfo = testutils.GetDebugMsgWithTestNameAndFormat(res.testName, format)
+ res.testName, res.expectedOutputFileName = testutils.ConnlistTestNameByTestArgs(dirName, focusWorkload, format)
+ res.testInfo = fmt.Sprintf("test: %q, output format: %q", res.testName, format)
res.analyzer = NewConnlistAnalyzer(WithOutputFormat(format), WithFocusWorkload(focusWorkload))
res.dirPath = getDirPathFromDirName(dirName)
return res
diff --git a/pkg/netpol/connlist/internal/ingressanalyzer/ingress_analyzer_test.go b/pkg/netpol/connlist/internal/ingressanalyzer/ingress_analyzer_test.go
index 6bbad6fa..35bfb8ec 100644
--- a/pkg/netpol/connlist/internal/ingressanalyzer/ingress_analyzer_test.go
+++ b/pkg/netpol/connlist/internal/ingressanalyzer/ingress_analyzer_test.go
@@ -15,9 +15,11 @@ import (
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
)
+const currentPkg = testutils.Ingressanalyzer
+
// helping func - scans the directory objects and returns the ingress analyzer built from them
func getIngressAnalyzerFromDirObjects(t *testing.T, testName, dirName string, processingErrsNum int) *IngressAnalyzer {
- path := filepath.Join(testutils.GetTestsDirFromInternalPkg(), dirName)
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), dirName)
rList, _ := fsscanner.GetResourceInfosFromDirPath([]string{path}, true, false)
objects, fpErrs := parser.ResourceInfoListToK8sObjectsList(rList, logger.NewDefaultLogger(), false)
require.Len(t, fpErrs, processingErrsNum, "test: %q, expected %d processing errors but got %d",
diff --git a/pkg/netpol/connlist/internal/ingressanalyzer/service_test.go b/pkg/netpol/connlist/internal/ingressanalyzer/service_test.go
index 0a69ec41..be9ae271 100644
--- a/pkg/netpol/connlist/internal/ingressanalyzer/service_test.go
+++ b/pkg/netpol/connlist/internal/ingressanalyzer/service_test.go
@@ -21,7 +21,7 @@ const servicesDirName = "services"
// not existed services or not supported services (e.g. services without selectors are ignored, thus no pods are selected)
func TestServiceMappingToPods(t *testing.T) {
t.Parallel()
- servicesDir := filepath.Join(testutils.GetTestsDirFromInternalPkg(), servicesDirName)
+ servicesDir := filepath.Join(testutils.GetTestsDir(currentPkg), servicesDirName)
cases := []struct {
name string
serviceName string
diff --git a/pkg/netpol/diff/diff_test.go b/pkg/netpol/diff/diff_test.go
index 8883e9f1..bd0b278c 100644
--- a/pkg/netpol/diff/diff_test.go
+++ b/pkg/netpol/diff/diff_test.go
@@ -13,12 +13,11 @@ import (
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
)
-const expectedOutputFilePrefix = "diff_output_from_"
-
var allFormats = []string{output.TextFormat, output.MDFormat, output.CSVFormat, output.DOTFormat}
const ResourceInfosFunc = "ConnDiffFromResourceInfos"
const DirPathFunc = "ConnDiffFromDirPaths"
+const currentPkg = testutils.Diff
var diffTestedAPIS = []string{ResourceInfosFunc, DirPathFunc}
@@ -29,20 +28,22 @@ func TestDiff(t *testing.T) {
t.Parallel()
for _, tt := range goodPathTests {
tt := tt
- testName := getTestName(tt.firstDirName, tt.secondDirName)
- t.Run(testName, func(t *testing.T) {
- t.Parallel()
- for _, format := range tt.formats {
- for _, apiFunc := range diffTestedAPIS {
- pTest, diffRes, err := getAnalysisResFromAPI(apiFunc, tt.firstDirName, tt.secondDirName, format, "")
+ for _, format := range tt.formats {
+ format := format
+ for _, apiFunc := range diffTestedAPIS {
+ apiFunc := apiFunc
+ pTest := prepareTest(tt.firstDirName, tt.secondDirName, format, apiFunc, "")
+ t.Run(pTest.testName, func(t *testing.T) {
+ t.Parallel()
+ diffRes, err := getAnalysisResFromAPI(apiFunc, pTest)
require.Nil(t, err, pTest.testInfo)
actualOutput, err := pTest.analyzer.ConnectivityDiffToString(diffRes)
require.Nil(t, err, pTest.testInfo)
- testutils.CheckActualVsExpectedOutputMatch(t, testName, tt.secondDirName,
- pTest.expectedOutputFileName, actualOutput, pTest.testInfo)
- }
+ testutils.CheckActualVsExpectedOutputMatch(t, pTest.expectedOutputFileName, actualOutput,
+ pTest.testInfo, currentPkg)
+ })
}
- })
+ }
}
}
@@ -59,7 +60,8 @@ func TestDiffAnalyzeFatalErrors(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
for _, apiFunc := range diffTestedAPIS {
- pTest, diffRes, err := getAnalysisResFromAPI(apiFunc, tt.ref1, tt.ref2, output.DefaultFormat, tt.name)
+ pTest := prepareTest(tt.ref1, tt.ref2, output.DefaultFormat, apiFunc, tt.name)
+ diffRes, err := getAnalysisResFromAPI(apiFunc, pTest)
require.Empty(t, diffRes, "test: %q, apiFunc: %q", tt.name, apiFunc)
testutils.CheckErrorContainment(t, pTest.testInfo, tt.errorStrContains, err.Error())
require.Equal(t, 1, len(pTest.analyzer.errors))
@@ -147,8 +149,8 @@ func TestDiffAnalyzerSevereErrorsAndWarnings(t *testing.T) {
if tt.onlyDirPathsAPI && apiFunc != DirPathFunc {
continue
}
-
- pTest, diffRes, err := getAnalysisResFromAPI(apiFunc, tt.ref1, tt.ref2, output.DefaultFormat, tt.name)
+ pTest := prepareTest(tt.ref1, tt.ref2, output.DefaultFormat, apiFunc, tt.name)
+ diffRes, err := getAnalysisResFromAPI(apiFunc, pTest)
if tt.emptyRes {
require.Empty(t, diffRes, pTest.testInfo)
} else {
@@ -234,7 +236,8 @@ func TestErrorsConnDiffFromDirPathOnly(t *testing.T) {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
- pTest, diffRes, err := getAnalysisResFromAPI(DirPathFunc, tt.ref1, tt.ref2, output.DefaultFormat, tt.name)
+ pTest := prepareTest(tt.ref1, tt.ref2, output.DefaultFormat, DirPathFunc, tt.name)
+ diffRes, err := getAnalysisResFromAPI(DirPathFunc, pTest)
if tt.emptyRes {
require.Empty(t, diffRes, pTest.testInfo)
} else {
@@ -284,7 +287,8 @@ func TestDiffOutputFatalErrors(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
for _, apiFunc := range diffTestedAPIS {
- pTest, connsDiff, err := getAnalysisResFromAPI(apiFunc, tt.ref1, tt.ref2, tt.format, tt.name)
+ pTest := prepareTest(tt.ref1, tt.ref2, tt.format, apiFunc, tt.name)
+ connsDiff, err := getAnalysisResFromAPI(apiFunc, pTest)
require.Nil(t, err, pTest.testInfo)
require.NotEmpty(t, connsDiff, pTest.testInfo)
res, err := pTest.analyzer.ConnectivityDiffToString(connsDiff)
@@ -301,15 +305,17 @@ func TestDiffOutputWithArgNamesOption(t *testing.T) {
ref2 := "onlineboutique_workloads_changed_netpols"
for _, format := range ValidDiffFormats {
analyzer := NewDiffAnalyzer(WithOutputFormat(format), WithArgNames("old", "new"))
- diffRes, err := analyzer.ConnDiffFromDirPaths(filepath.Join(testutils.GetTestsDir(), ref1),
- filepath.Join(testutils.GetTestsDir(), ref2))
+ diffRes, err := analyzer.ConnDiffFromDirPaths(filepath.Join(testutils.GetTestsDir(currentPkg), ref1),
+ filepath.Join(testutils.GetTestsDir(currentPkg), ref2))
require.Nil(t, err)
require.NotEmpty(t, diffRes)
res, err := analyzer.ConnectivityDiffToString(diffRes)
require.Nil(t, err)
- testName := "TsetOutputWithArgNamesOption." + format
- testutils.CheckActualVsExpectedOutputMatch(t, testName, ref2,
- testName, res, testName)
+ testNamePrefix := "TsetOutputWithArgNamesOption_"
+ testName, outFileName := testutils.DiffTestNameByTestArgs(ref1, ref2, format)
+ testName = testNamePrefix + testName
+ outFileName = testNamePrefix + outFileName
+ testutils.CheckActualVsExpectedOutputMatch(t, outFileName, res, testName, currentPkg)
}
}
@@ -322,31 +328,26 @@ type preparedTest struct {
analyzer *DiffAnalyzer
}
-func getTestName(ref1, ref2 string) string {
- return "diff_between_" + ref2 + "_and_" + ref1
-}
-
func prepareTest(firstDir, secondDir, format, apiName, testNameStr string) *preparedTest {
- var testName string
+ var testName, expectedOutputFileName string
if testNameStr != "" {
testName = testNameStr
+ expectedOutputFileName = ""
} else {
- testName = getTestName(firstDir, secondDir)
+ testName, expectedOutputFileName = testutils.DiffTestNameByTestArgs(firstDir, secondDir, format)
}
return &preparedTest{
testName: testName,
- expectedOutputFileName: expectedOutputFilePrefix + firstDir + "." + format,
+ expectedOutputFileName: expectedOutputFileName,
testInfo: fmt.Sprintf("test: %q, output format: %q, api func: %q", testName, format, apiName),
analyzer: NewDiffAnalyzer(WithOutputFormat(format)),
- firstDirPath: filepath.Join(testutils.GetTestsDir(), firstDir),
- secondDirPath: filepath.Join(testutils.GetTestsDir(), secondDir),
+ firstDirPath: filepath.Join(testutils.GetTestsDir(currentPkg), firstDir),
+ secondDirPath: filepath.Join(testutils.GetTestsDir(currentPkg), secondDir),
}
}
-func getAnalysisResFromAPI(apiName, firstDir, secondDir, format, testName string) (
- pTest *preparedTest, diffRes ConnectivityDiff, err error) {
- pTest = prepareTest(firstDir, secondDir, format, apiName, testName)
+func getAnalysisResFromAPI(apiName string, pTest *preparedTest) (diffRes ConnectivityDiff, err error) {
switch apiName {
case ResourceInfosFunc:
infos1, _ := fsscanner.GetResourceInfosFromDirPath([]string{pTest.firstDirPath}, true, false)
@@ -355,7 +356,7 @@ func getAnalysisResFromAPI(apiName, firstDir, secondDir, format, testName string
case DirPathFunc:
diffRes, err = pTest.analyzer.ConnDiffFromDirPaths(pTest.firstDirPath, pTest.secondDirPath)
}
- return pTest, diffRes, err
+ return diffRes, err
}
var goodPathTests = []struct {
diff --git a/pkg/netpol/eval/eval_test.go b/pkg/netpol/eval/eval_test.go
index 3a3dfbab..8db3262b 100644
--- a/pkg/netpol/eval/eval_test.go
+++ b/pkg/netpol/eval/eval_test.go
@@ -111,6 +111,8 @@ status:
hostIP: 192.168.49.2`
)
+const currentPkg = testutils.Eval
+
func netpolFromYaml(netpolYamlStr string) (*netv1.NetworkPolicy, error) {
netpol := netv1.NetworkPolicy{}
err := yaml.Unmarshal([]byte(netpolYamlStr), &netpol)
@@ -1079,7 +1081,7 @@ func TestGeneralPerformance(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("skipping TestGeneralPerformance")
}
- path := filepath.Join(testutils.GetTestsDir(), "onlineboutique")
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique")
// list of connections to test with, for CheckIfAllowed / CheckIfAllowedNew
connectionsListForTest := []TestEntry{
{protocol: "tcp", port: "5050"},
@@ -1191,7 +1193,7 @@ func TestGeneralPerformance(t *testing.T) {
}
func TestFromFiles2(t *testing.T) {
- path := filepath.Join(testutils.GetTestsDir(), "onlineboutique")
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique")
pe := NewPolicyEngine()
err := setResourcesFromDir(pe, path)
if err != nil {
@@ -1244,7 +1246,7 @@ func TestFromFiles2(t *testing.T) {
}
func TestFromFiles(t *testing.T) {
- path := filepath.Join(testutils.GetTestsDir(), "onlineboutique")
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique")
pe := NewPolicyEngine()
err := setResourcesFromDir(pe, path)
if err != nil {
@@ -1567,7 +1569,7 @@ func computeExpectedCacheHits(pe *PolicyEngine) (int, error) {
func TestCacheWithPodDeletion(t *testing.T) {
pe := NewPolicyEngine()
var err error
- testDir := filepath.Join(testutils.GetTestsDir(), "onlineboutique_with_replicas")
+ testDir := filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_with_replicas")
if err = setResourcesFromDir(pe, testDir); err != nil {
t.Fatal(err)
}
@@ -1599,7 +1601,7 @@ func TestCacheWithPodDeletion(t *testing.T) {
}
func TestConnectionsMapExamples(t *testing.T) {
- testsDir := testutils.GetTestsDir()
+ testsDir := testutils.GetTestsDir(currentPkg)
tests := []struct {
testName string
@@ -1734,7 +1736,7 @@ func testConnectivityMapOutput(res []string, expectedFileName string) (bool, err
}
func TestDisjointIpBlocks(t *testing.T) {
- path := filepath.Join(testutils.GetTestsDir(), "ipblockstest")
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), "ipblockstest")
pe := NewPolicyEngine()
if err := setResourcesFromDir(pe, path); err != nil {
t.Errorf("%v", err)
@@ -1767,7 +1769,7 @@ func TestDisjointIpBlocks(t *testing.T) {
}
func TestPolicyEngineWithWorkloads(t *testing.T) {
- path := filepath.Join(testutils.GetTestsDir(), "onlineboutique_workloads")
+ path := filepath.Join(testutils.GetTestsDir(currentPkg), "onlineboutique_workloads")
rList, _ := fsscanner.GetResourceInfosFromDirPath([]string{path}, true, false)
objects, processingErrs := parser.ResourceInfoListToK8sObjectsList(rList, logger.NewDefaultLogger(), false)
diff --git a/test_outputs/cli/acs-security-demos_focus_workload_ingress-controller_connlist_output.txt b/test_outputs/cli/acs-security-demos_focus_workload_ingress-controller_connlist_output.txt
new file mode 100644
index 00000000..839eab9f
--- /dev/null
+++ b/test_outputs/cli/acs-security-demos_focus_workload_ingress-controller_connlist_output.txt
@@ -0,0 +1,2 @@
+{ingress-controller} => frontend/asset-cache[Deployment] : TCP 8080
+{ingress-controller} => frontend/webapp[Deployment] : TCP 8080
\ No newline at end of file
diff --git a/test_outputs/cli/diff_between_onlineboutique_with_pods_severe_error_and_onlineboutique.txt b/test_outputs/cli/diff_between_onlineboutique_with_pods_severe_error_and_onlineboutique.txt
new file mode 100644
index 00000000..2108d995
--- /dev/null
+++ b/test_outputs/cli/diff_between_onlineboutique_with_pods_severe_error_and_onlineboutique.txt
@@ -0,0 +1,2 @@
+Connectivity diff:
+diff-type: changed, source: default/frontend-99684f7f8[ReplicaSet], destination: default/adservice-77d5cd745d[ReplicaSet], dir1: TCP 9555, dir2: TCP 8080
\ No newline at end of file
diff --git a/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.csv b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.csv
new file mode 100644
index 00000000..85628423
--- /dev/null
+++ b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.csv
@@ -0,0 +1,5 @@
+diff-type,source,destination,dir1,dir2,workloads-diff-info
+added,0.0.0.0-255.255.255.255,default/unicorn[Deployment],No Connections,All Connections,workload default/unicorn[Deployment] added
+added,default/redis-cart[Deployment],default/unicorn[Deployment],No Connections,All Connections,workload default/unicorn[Deployment] added
+added,default/unicorn[Deployment],0.0.0.0-255.255.255.255,No Connections,All Connections,workload default/unicorn[Deployment] added
+added,default/unicorn[Deployment],default/redis-cart[Deployment],No Connections,All Connections,workload default/unicorn[Deployment] added
diff --git a/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.md b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.md
new file mode 100644
index 00000000..0252fe15
--- /dev/null
+++ b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.md
@@ -0,0 +1,6 @@
+| diff-type | source | destination | dir1 | dir2 | workloads-diff-info |
+|-----------|--------|-------------|------|------|---------------------|
+| added | 0.0.0.0-255.255.255.255 | default/unicorn[Deployment] | No Connections | All Connections | workload default/unicorn[Deployment] added |
+| added | default/redis-cart[Deployment] | default/unicorn[Deployment] | No Connections | All Connections | workload default/unicorn[Deployment] added |
+| added | default/unicorn[Deployment] | 0.0.0.0-255.255.255.255 | No Connections | All Connections | workload default/unicorn[Deployment] added |
+| added | default/unicorn[Deployment] | default/redis-cart[Deployment] | No Connections | All Connections | workload default/unicorn[Deployment] added |
\ No newline at end of file
diff --git a/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.txt b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.txt
new file mode 100644
index 00000000..770fc08b
--- /dev/null
+++ b/test_outputs/cli/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.txt
@@ -0,0 +1,5 @@
+Connectivity diff:
+diff-type: added, source: 0.0.0.0-255.255.255.255, destination: default/unicorn[Deployment], dir1: No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added
+diff-type: added, source: default/redis-cart[Deployment], destination: default/unicorn[Deployment], dir1: No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added
+diff-type: added, source: default/unicorn[Deployment], destination: 0.0.0.0-255.255.255.255, dir1: No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added
+diff-type: added, source: default/unicorn[Deployment], destination: default/redis-cart[Deployment], dir1: No Connections, dir2: All Connections, workloads-diff-info: workload default/unicorn[Deployment] added
\ No newline at end of file
diff --git a/test_outputs/cli/document_with_syntax_error_connlist_output.txt b/test_outputs/cli/document_with_syntax_error_connlist_output.txt
new file mode 100644
index 00000000..251d8373
--- /dev/null
+++ b/test_outputs/cli/document_with_syntax_error_connlist_output.txt
@@ -0,0 +1,12 @@
+0.0.0.0-255.255.255.255 => default/checkoutservice[Deployment] : All Connections
+0.0.0.0-255.255.255.255 => default/emailservice[Deployment] : All Connections
+0.0.0.0-255.255.255.255 => default/recommendationservice[Deployment] : All Connections
+default/checkoutservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
+default/checkoutservice[Deployment] => default/emailservice[Deployment] : All Connections
+default/checkoutservice[Deployment] => default/recommendationservice[Deployment] : All Connections
+default/emailservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
+default/emailservice[Deployment] => default/checkoutservice[Deployment] : All Connections
+default/emailservice[Deployment] => default/recommendationservice[Deployment] : All Connections
+default/recommendationservice[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
+default/recommendationservice[Deployment] => default/checkoutservice[Deployment] : All Connections
+default/recommendationservice[Deployment] => default/emailservice[Deployment] : All Connections
\ No newline at end of file
diff --git a/pkg/cli/tests_outputs/test_legal_list.txt b/test_outputs/cli/onlineboutique_connlist_output.txt
similarity index 100%
rename from pkg/cli/tests_outputs/test_legal_list.txt
rename to test_outputs/cli/onlineboutique_connlist_output.txt
diff --git a/tests/onlineboutique_workloads/emailservice_connlist_output.txt b/test_outputs/cli/onlineboutique_workloads_focus_workload_default_emailservice_connlist_output.txt
similarity index 100%
rename from tests/onlineboutique_workloads/emailservice_connlist_output.txt
rename to test_outputs/cli/onlineboutique_workloads_focus_workload_default_emailservice_connlist_output.txt
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.csv b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.csv
new file mode 100644
index 00000000..ac834af8
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.csv
@@ -0,0 +1,2 @@
+src,dst,conn
+default/checkoutservice[Deployment],default/emailservice[Deployment],TCP 8080
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot
new file mode 100644
index 00000000..2e3a1308
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot
@@ -0,0 +1,8 @@
+digraph {
+ subgraph cluster_default {
+ "checkoutservice[Deployment]" [label="checkoutservice[Deployment]" color="blue" fontcolor="blue"]
+ "emailservice[Deployment]" [label="emailservice[Deployment]" color="blue" fontcolor="blue"]
+ label="default"
+ }
+ "checkoutservice[Deployment]" -> "emailservice[Deployment]" [label="TCP 8080" color="gold2" fontcolor="darkgreen"]
+}
\ No newline at end of file
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.png b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.png
new file mode 100644
index 00000000..abbadc8d
Binary files /dev/null and b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.png differ
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.svg b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.svg
new file mode 100644
index 00000000..55959e06
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.dot.svg
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.json b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.json
new file mode 100644
index 00000000..f3c3fec9
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.json
@@ -0,0 +1,7 @@
+[
+ {
+ "src": "default/checkoutservice[Deployment]",
+ "dst": "default/emailservice[Deployment]",
+ "conn": "TCP 8080"
+ }
+]
\ No newline at end of file
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.md b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.md
new file mode 100644
index 00000000..97330fc8
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.md
@@ -0,0 +1,3 @@
+| src | dst | conn |
+|-----|-----|------|
+| default/checkoutservice[Deployment] | default/emailservice[Deployment] | TCP 8080 |
\ No newline at end of file
diff --git a/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt
new file mode 100644
index 00000000..47af46b8
--- /dev/null
+++ b/test_outputs/cli/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt
@@ -0,0 +1 @@
+default/checkoutservice[Deployment] => default/emailservice[Deployment] : TCP 8080
\ No newline at end of file
diff --git a/tests/acs-security-demos-added-workloads/asset-cache_connlist_output.txt b/test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_asset-cache_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos-added-workloads/asset-cache_connlist_output.txt
rename to test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_asset-cache_connlist_output.txt
diff --git a/tests/acs-security-demos-added-workloads/backend_recommendation_connlist_output.txt b/test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_backend_recommendation_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos-added-workloads/backend_recommendation_connlist_output.txt
rename to test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_backend_recommendation_connlist_output.txt
diff --git a/tests/acs-security-demos-added-workloads/frontend_asset-cache_connlist_output.txt b/test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_frontend_asset-cache_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos-added-workloads/frontend_asset-cache_connlist_output.txt
rename to test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_frontend_asset-cache_connlist_output.txt
diff --git a/tests/acs-security-demos-added-workloads/ingress-controller_connlist_output.txt b/test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_ingress-controller_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos-added-workloads/ingress-controller_connlist_output.txt
rename to test_outputs/connlist/acs-security-demos-added-workloads_focus_workload_ingress-controller_connlist_output.txt
diff --git a/tests/acs-security-demos-with-netpol-list/connlist_output.txt b/test_outputs/connlist/acs-security-demos-with-netpol-list_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos-with-netpol-list/connlist_output.txt
rename to test_outputs/connlist/acs-security-demos-with-netpol-list_connlist_output.txt
diff --git a/tests/acs-security-demos/connlist_output.csv b/test_outputs/connlist/acs-security-demos_connlist_output.csv
similarity index 100%
rename from tests/acs-security-demos/connlist_output.csv
rename to test_outputs/connlist/acs-security-demos_connlist_output.csv
diff --git a/tests/acs-security-demos/connlist_output.dot b/test_outputs/connlist/acs-security-demos_connlist_output.dot
similarity index 100%
rename from tests/acs-security-demos/connlist_output.dot
rename to test_outputs/connlist/acs-security-demos_connlist_output.dot
diff --git a/tests/acs-security-demos/connlist_output.dot.png b/test_outputs/connlist/acs-security-demos_connlist_output.dot.png
similarity index 100%
rename from tests/acs-security-demos/connlist_output.dot.png
rename to test_outputs/connlist/acs-security-demos_connlist_output.dot.png
diff --git a/tests/acs-security-demos/connlist_output.dot.svg b/test_outputs/connlist/acs-security-demos_connlist_output.dot.svg
similarity index 100%
rename from tests/acs-security-demos/connlist_output.dot.svg
rename to test_outputs/connlist/acs-security-demos_connlist_output.dot.svg
diff --git a/test_outputs/connlist/acs-security-demos_connlist_output.json b/test_outputs/connlist/acs-security-demos_connlist_output.json
new file mode 100644
index 00000000..84644c8a
--- /dev/null
+++ b/test_outputs/connlist/acs-security-demos_connlist_output.json
@@ -0,0 +1,72 @@
+[
+ {
+ "src": "backend/checkout[Deployment]",
+ "dst": "backend/notification[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "backend/checkout[Deployment]",
+ "dst": "backend/recommendation[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "backend/checkout[Deployment]",
+ "dst": "payments/gateway[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "backend/recommendation[Deployment]",
+ "dst": "backend/catalog[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "backend/reports[Deployment]",
+ "dst": "backend/catalog[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "backend/reports[Deployment]",
+ "dst": "backend/recommendation[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "frontend/webapp[Deployment]",
+ "dst": "backend/checkout[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "frontend/webapp[Deployment]",
+ "dst": "backend/recommendation[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "frontend/webapp[Deployment]",
+ "dst": "backend/reports[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "frontend/webapp[Deployment]",
+ "dst": "backend/shipping[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "payments/gateway[Deployment]",
+ "dst": "payments/mastercard-processor[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "payments/gateway[Deployment]",
+ "dst": "payments/visa-processor[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "{ingress-controller}",
+ "dst": "frontend/asset-cache[Deployment]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "{ingress-controller}",
+ "dst": "frontend/webapp[Deployment]",
+ "conn": "TCP 8080"
+ }
+]
\ No newline at end of file
diff --git a/tests/acs-security-demos/connlist_output.md b/test_outputs/connlist/acs-security-demos_connlist_output.md
similarity index 100%
rename from tests/acs-security-demos/connlist_output.md
rename to test_outputs/connlist/acs-security-demos_connlist_output.md
diff --git a/tests/acs-security-demos/connlist_output.txt b/test_outputs/connlist/acs-security-demos_connlist_output.txt
similarity index 100%
rename from tests/acs-security-demos/connlist_output.txt
rename to test_outputs/connlist/acs-security-demos_connlist_output.txt
diff --git a/tests/acs_security_frontend_demos/connlist_output.csv b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.csv
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.csv
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.csv
diff --git a/tests/acs_security_frontend_demos/connlist_output.dot b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.dot
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot
diff --git a/tests/acs_security_frontend_demos/connlist_output.dot.png b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot.png
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.dot.png
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot.png
diff --git a/tests/acs_security_frontend_demos/connlist_output.dot.svg b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot.svg
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.dot.svg
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.dot.svg
diff --git a/tests/acs_security_frontend_demos/connlist_output.json b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.json
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.json
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.json
diff --git a/tests/acs_security_frontend_demos/connlist_output.md b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.md
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.md
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.md
diff --git a/tests/acs_security_frontend_demos/connlist_output.txt b/test_outputs/connlist/acs_security_frontend_demos_connlist_output.txt
similarity index 100%
rename from tests/acs_security_frontend_demos/connlist_output.txt
rename to test_outputs/connlist/acs_security_frontend_demos_connlist_output.txt
diff --git a/tests/core_pods_without_host_ip/connlist_output.txt b/test_outputs/connlist/core_pods_without_host_ip_connlist_output.txt
similarity index 100%
rename from tests/core_pods_without_host_ip/connlist_output.txt
rename to test_outputs/connlist/core_pods_without_host_ip_connlist_output.txt
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.csv b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.csv
similarity index 100%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.csv
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.csv
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.dot b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot
similarity index 100%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.dot
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot
diff --git a/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.png b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.png
new file mode 100644
index 00000000..3508e23d
Binary files /dev/null and b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.png differ
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.dot.svg b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.svg
similarity index 98%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.dot.svg
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.svg
index 5792e573..e0fc50d0 100644
--- a/tests/demo_app_with_routes_and_ingress/connlist_output.dot.svg
+++ b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.dot.svg
@@ -8,11 +8,6 @@
viewBox="0.00 0.00 885.00 262.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-
-cluster_ingressworld
-
-ingressworld
-
cluster_helloworld
@@ -23,6 +18,11 @@
routeworld
+
+cluster_ingressworld
+
+ingressworld
+
hello-world[Deployment]
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.json b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.json
similarity index 100%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.json
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.json
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.md b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.md
similarity index 100%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.md
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.md
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.txt b/test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.txt
similarity index 100%
rename from tests/demo_app_with_routes_and_ingress/connlist_output.txt
rename to test_outputs/connlist/demo_app_with_routes_and_ingress_connlist_output.txt
diff --git a/tests/ipblockstest_2/connlist_output.txt b/test_outputs/connlist/ipblockstest_2_connlist_output.txt
similarity index 100%
rename from tests/ipblockstest_2/connlist_output.txt
rename to test_outputs/connlist/ipblockstest_2_connlist_output.txt
diff --git a/tests/ipblockstest_3/connlist_output.txt b/test_outputs/connlist/ipblockstest_3_connlist_output.txt
similarity index 100%
rename from tests/ipblockstest_3/connlist_output.txt
rename to test_outputs/connlist/ipblockstest_3_connlist_output.txt
diff --git a/tests/ipblockstest_4/connlist_output.txt b/test_outputs/connlist/ipblockstest_4_connlist_output.txt
similarity index 100%
rename from tests/ipblockstest_4/connlist_output.txt
rename to test_outputs/connlist/ipblockstest_4_connlist_output.txt
diff --git a/tests/ipblockstest/connlist_output.txt b/test_outputs/connlist/ipblockstest_connlist_output.txt
similarity index 100%
rename from tests/ipblockstest/connlist_output.txt
rename to test_outputs/connlist/ipblockstest_connlist_output.txt
diff --git a/tests/k8s_ingress_test/connlist_output.csv b/test_outputs/connlist/k8s_ingress_test_connlist_output.csv
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.csv
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.csv
diff --git a/tests/k8s_ingress_test/connlist_output.dot b/test_outputs/connlist/k8s_ingress_test_connlist_output.dot
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.dot
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.dot
diff --git a/tests/k8s_ingress_test/connlist_output.dot.png b/test_outputs/connlist/k8s_ingress_test_connlist_output.dot.png
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.dot.png
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.dot.png
diff --git a/tests/k8s_ingress_test/connlist_output.dot.svg b/test_outputs/connlist/k8s_ingress_test_connlist_output.dot.svg
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.dot.svg
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.dot.svg
diff --git a/tests/k8s_ingress_test/connlist_output.json b/test_outputs/connlist/k8s_ingress_test_connlist_output.json
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.json
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.json
diff --git a/tests/k8s_ingress_test/connlist_output.md b/test_outputs/connlist/k8s_ingress_test_connlist_output.md
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.md
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.md
diff --git a/tests/k8s_ingress_test/connlist_output.txt b/test_outputs/connlist/k8s_ingress_test_connlist_output.txt
similarity index 100%
rename from tests/k8s_ingress_test/connlist_output.txt
rename to test_outputs/connlist/k8s_ingress_test_connlist_output.txt
diff --git a/tests/k8s_ingress_test/details-v1-79f774bdb9_connlist_output.txt b/test_outputs/connlist/k8s_ingress_test_focus_workload_details-v1-79f774bdb9_connlist_output.txt
similarity index 100%
rename from tests/k8s_ingress_test/details-v1-79f774bdb9_connlist_output.txt
rename to test_outputs/connlist/k8s_ingress_test_focus_workload_details-v1-79f774bdb9_connlist_output.txt
diff --git a/tests/minikube_resources/connlist_output.txt b/test_outputs/connlist/minikube_resources_connlist_output.txt
similarity index 100%
rename from tests/minikube_resources/connlist_output.txt
rename to test_outputs/connlist/minikube_resources_connlist_output.txt
diff --git a/tests/minimal_test_in_ns/connlist_output.txt b/test_outputs/connlist/minimal_test_in_ns_connlist_output.txt
similarity index 100%
rename from tests/minimal_test_in_ns/connlist_output.txt
rename to test_outputs/connlist/minimal_test_in_ns_connlist_output.txt
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.csv b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.csv
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.csv
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.csv
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.dot b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.dot
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.dot.png b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot.png
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.dot.png
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot.png
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.dot.svg b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot.svg
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.dot.svg
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.dot.svg
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.json b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.json
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.json
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.json
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.md b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.md
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.md
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.md
diff --git a/tests/multiple_ingress_objects_with_different_ports/connlist_output.txt b/test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.txt
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports/connlist_output.txt
rename to test_outputs/connlist/multiple_ingress_objects_with_different_ports_connlist_output.txt
diff --git a/tests/multiple_topology_resources_1/connlist_output.txt b/test_outputs/connlist/multiple_topology_resources_1_connlist_output.txt
similarity index 100%
rename from tests/multiple_topology_resources_1/connlist_output.txt
rename to test_outputs/connlist/multiple_topology_resources_1_connlist_output.txt
diff --git a/tests/multiple_topology_resources_2/connlist_output.txt b/test_outputs/connlist/multiple_topology_resources_2_connlist_output.txt
similarity index 100%
rename from tests/multiple_topology_resources_2/connlist_output.txt
rename to test_outputs/connlist/multiple_topology_resources_2_connlist_output.txt
diff --git a/tests/multiple_topology_resources_3/connlist_output.txt b/test_outputs/connlist/multiple_topology_resources_3_connlist_output.txt
similarity index 100%
rename from tests/multiple_topology_resources_3/connlist_output.txt
rename to test_outputs/connlist/multiple_topology_resources_3_connlist_output.txt
diff --git a/tests/multiple_topology_resources_4/connlist_output.txt b/test_outputs/connlist/multiple_topology_resources_4_connlist_output.txt
similarity index 100%
rename from tests/multiple_topology_resources_4/connlist_output.txt
rename to test_outputs/connlist/multiple_topology_resources_4_connlist_output.txt
diff --git a/test_outputs/connlist/netpol-analysis-example-minimal_connlist_output.txt b/test_outputs/connlist/netpol-analysis-example-minimal_connlist_output.txt
new file mode 100644
index 00000000..2691cdd2
--- /dev/null
+++ b/test_outputs/connlist/netpol-analysis-example-minimal_connlist_output.txt
@@ -0,0 +1,3 @@
+0.0.0.0-255.255.255.255 => default/frontend[Deployment] : TCP 8080
+default/frontend[Deployment] => 0.0.0.0-255.255.255.255 : UDP 53
+default/frontend[Deployment] => default/backend[Deployment] : TCP 9090
\ No newline at end of file
diff --git a/tests/new_online_boutique/connlist_output.txt b/test_outputs/connlist/new_online_boutique_connlist_output.txt
similarity index 100%
rename from tests/new_online_boutique/connlist_output.txt
rename to test_outputs/connlist/new_online_boutique_connlist_output.txt
diff --git a/tests/new_online_boutique_synthesis/connlist_output.txt b/test_outputs/connlist/new_online_boutique_synthesis_connlist_output.txt
similarity index 100%
rename from tests/new_online_boutique_synthesis/connlist_output.txt
rename to test_outputs/connlist/new_online_boutique_synthesis_connlist_output.txt
diff --git a/tests/one_ingress_multiple_ports/connlist_output.csv b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.csv
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.csv
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.csv
diff --git a/tests/one_ingress_multiple_ports/connlist_output.dot b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.dot
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot
diff --git a/tests/one_ingress_multiple_ports/connlist_output.dot.png b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot.png
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.dot.png
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot.png
diff --git a/tests/one_ingress_multiple_ports/connlist_output.dot.svg b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot.svg
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.dot.svg
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.dot.svg
diff --git a/tests/one_ingress_multiple_ports/connlist_output.json b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.json
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.json
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.json
diff --git a/tests/one_ingress_multiple_ports/connlist_output.md b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.md
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.md
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.md
diff --git a/tests/one_ingress_multiple_ports/connlist_output.txt b/test_outputs/connlist/one_ingress_multiple_ports_connlist_output.txt
similarity index 100%
rename from tests/one_ingress_multiple_ports/connlist_output.txt
rename to test_outputs/connlist/one_ingress_multiple_ports_connlist_output.txt
diff --git a/tests/one_ingress_multiple_services/connlist_output.csv b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.csv
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.csv
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.csv
diff --git a/tests/one_ingress_multiple_services/connlist_output.dot b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.dot
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot
diff --git a/tests/one_ingress_multiple_services/connlist_output.dot.png b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot.png
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.dot.png
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot.png
diff --git a/tests/one_ingress_multiple_services/connlist_output.dot.svg b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot.svg
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.dot.svg
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.dot.svg
diff --git a/tests/one_ingress_multiple_services/connlist_output.json b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.json
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.json
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.json
diff --git a/tests/one_ingress_multiple_services/connlist_output.md b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.md
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.md
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.md
diff --git a/tests/one_ingress_multiple_services/connlist_output.txt b/test_outputs/connlist/one_ingress_multiple_services_connlist_output.txt
similarity index 100%
rename from tests/one_ingress_multiple_services/connlist_output.txt
rename to test_outputs/connlist/one_ingress_multiple_services_connlist_output.txt
diff --git a/tests/online_boutique_workloads_no_ns/connlist_output.txt b/test_outputs/connlist/online_boutique_workloads_no_ns_connlist_output.txt
similarity index 100%
rename from tests/online_boutique_workloads_no_ns/connlist_output.txt
rename to test_outputs/connlist/online_boutique_workloads_no_ns_connlist_output.txt
diff --git a/test_outputs/connlist/onlineboutique_connlist_output.json b/test_outputs/connlist/onlineboutique_connlist_output.json
new file mode 100644
index 00000000..48e26654
--- /dev/null
+++ b/test_outputs/connlist/onlineboutique_connlist_output.json
@@ -0,0 +1,87 @@
+[
+ {
+ "src": "0.0.0.0-255.255.255.255",
+ "dst": "default/redis-cart-78746d49dc[ReplicaSet]",
+ "conn": "All Connections"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/cartservice-74f56fd4b[ReplicaSet]",
+ "conn": "TCP 7070"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/currencyservice-77654bbbdd[ReplicaSet]",
+ "conn": "TCP 7000"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/emailservice-54c7c5d9d[ReplicaSet]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/paymentservice-bbcbdc6b6[ReplicaSet]",
+ "conn": "TCP 50051"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/productcatalogservice-68765d49b6[ReplicaSet]",
+ "conn": "TCP 3550"
+ },
+ {
+ "src": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "dst": "default/shippingservice-5bd985c46d[ReplicaSet]",
+ "conn": "TCP 50051"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/adservice-77d5cd745d[ReplicaSet]",
+ "conn": "TCP 9555"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/cartservice-74f56fd4b[ReplicaSet]",
+ "conn": "TCP 7070"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/checkoutservice-69c8ff664b[ReplicaSet]",
+ "conn": "TCP 5050"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/currencyservice-77654bbbdd[ReplicaSet]",
+ "conn": "TCP 7000"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/productcatalogservice-68765d49b6[ReplicaSet]",
+ "conn": "TCP 3550"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/recommendationservice-5f8c456796[ReplicaSet]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "default/frontend-99684f7f8[ReplicaSet]",
+ "dst": "default/shippingservice-5bd985c46d[ReplicaSet]",
+ "conn": "TCP 50051"
+ },
+ {
+ "src": "default/loadgenerator-555fbdc87d[ReplicaSet]",
+ "dst": "default/frontend-99684f7f8[ReplicaSet]",
+ "conn": "TCP 8080"
+ },
+ {
+ "src": "default/recommendationservice-5f8c456796[ReplicaSet]",
+ "dst": "default/productcatalogservice-68765d49b6[ReplicaSet]",
+ "conn": "TCP 3550"
+ },
+ {
+ "src": "default/redis-cart-78746d49dc[ReplicaSet]",
+ "dst": "0.0.0.0-255.255.255.255",
+ "conn": "All Connections"
+ }
+]
\ No newline at end of file
diff --git a/tests/onlineboutique/connlist_output.md b/test_outputs/connlist/onlineboutique_connlist_output.md
similarity index 100%
rename from tests/onlineboutique/connlist_output.md
rename to test_outputs/connlist/onlineboutique_connlist_output.md
diff --git a/tests/onlineboutique/connlist_output.txt b/test_outputs/connlist/onlineboutique_connlist_output.txt
similarity index 100%
rename from tests/onlineboutique/connlist_output.txt
rename to test_outputs/connlist/onlineboutique_connlist_output.txt
diff --git a/tests/onlineboutique_workloads/connlist_output.csv b/test_outputs/connlist/onlineboutique_workloads_connlist_output.csv
similarity index 100%
rename from tests/onlineboutique_workloads/connlist_output.csv
rename to test_outputs/connlist/onlineboutique_workloads_connlist_output.csv
diff --git a/tests/onlineboutique_workloads/connlist_output.dot b/test_outputs/connlist/onlineboutique_workloads_connlist_output.dot
similarity index 100%
rename from tests/onlineboutique_workloads/connlist_output.dot
rename to test_outputs/connlist/onlineboutique_workloads_connlist_output.dot
diff --git a/tests/onlineboutique_workloads/connlist_output.dot.png b/test_outputs/connlist/onlineboutique_workloads_connlist_output.dot.png
similarity index 100%
rename from tests/onlineboutique_workloads/connlist_output.dot.png
rename to test_outputs/connlist/onlineboutique_workloads_connlist_output.dot.png
diff --git a/tests/onlineboutique_workloads/connlist_output.dot.svg b/test_outputs/connlist/onlineboutique_workloads_connlist_output.dot.svg
similarity index 100%
rename from tests/onlineboutique_workloads/connlist_output.dot.svg
rename to test_outputs/connlist/onlineboutique_workloads_connlist_output.dot.svg
diff --git a/tests/onlineboutique_workloads/connlist_output.txt b/test_outputs/connlist/onlineboutique_workloads_connlist_output.txt
similarity index 100%
rename from tests/onlineboutique_workloads/connlist_output.txt
rename to test_outputs/connlist/onlineboutique_workloads_connlist_output.txt
diff --git a/test_outputs/connlist/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt b/test_outputs/connlist/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt
new file mode 100644
index 00000000..47af46b8
--- /dev/null
+++ b/test_outputs/connlist/onlineboutique_workloads_focus_workload_emailservice_connlist_output.txt
@@ -0,0 +1 @@
+default/checkoutservice[Deployment] => default/emailservice[Deployment] : TCP 8080
\ No newline at end of file
diff --git a/tests/semanticDiff-different-topologies-policy-a-with-ipblock/connlist_output.txt b/test_outputs/connlist/semanticDiff-different-topologies-policy-a-with-ipblock_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-a-with-ipblock/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-different-topologies-policy-a-with-ipblock_connlist_output.txt
diff --git a/tests/semanticDiff-different-topologies-policy-a/connlist_output.txt b/test_outputs/connlist/semanticDiff-different-topologies-policy-a_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-a/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-different-topologies-policy-a_connlist_output.txt
diff --git a/tests/semanticDiff-different-topologies-policy-b-with-ipblock/connlist_output.txt b/test_outputs/connlist/semanticDiff-different-topologies-policy-b-with-ipblock_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-b-with-ipblock/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-different-topologies-policy-b-with-ipblock_connlist_output.txt
diff --git a/tests/semanticDiff-different-topologies-policy-b/connlist_output.txt b/test_outputs/connlist/semanticDiff-different-topologies-policy-b_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-b/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-different-topologies-policy-b_connlist_output.txt
diff --git a/tests/semanticDiff-orig-topologies-no-policy/connlist_output.txt b/test_outputs/connlist/semanticDiff-orig-topologies-no-policy_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-orig-topologies-no-policy/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-orig-topologies-no-policy_connlist_output.txt
diff --git a/tests/semanticDiff-orig-topologies-policy-a/connlist_output.txt b/test_outputs/connlist/semanticDiff-orig-topologies-policy-a_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-orig-topologies-policy-a/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-orig-topologies-policy-a_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-new1/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-new1_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new1/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-new1_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-new1a/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-new1a_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new1a/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-new1a_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-new2/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-new2_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new2/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-new2_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-new3/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-new3_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new3/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-new3_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-old1/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-old1_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-old1/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-old1_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-old2/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-old2_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-old2/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-old2_connlist_output.txt
diff --git a/tests/semanticDiff-same-topologies-old3/connlist_output.txt b/test_outputs/connlist/semanticDiff-same-topologies-old3_connlist_output.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-old3/connlist_output.txt
rename to test_outputs/connlist/semanticDiff-same-topologies-old3_connlist_output.txt
diff --git a/tests/test_with_named_ports_changed_netpol_2/connlist_output.txt b/test_outputs/connlist/test_with_named_ports_changed_netpol_2_connlist_output.txt
similarity index 100%
rename from tests/test_with_named_ports_changed_netpol_2/connlist_output.txt
rename to test_outputs/connlist/test_with_named_ports_changed_netpol_2_connlist_output.txt
diff --git a/tests/test_with_named_ports_changed_netpol/connlist_output.txt b/test_outputs/connlist/test_with_named_ports_changed_netpol_connlist_output.txt
similarity index 100%
rename from tests/test_with_named_ports_changed_netpol/connlist_output.txt
rename to test_outputs/connlist/test_with_named_ports_changed_netpol_connlist_output.txt
diff --git a/tests/test_with_named_ports/connlist_output.txt b/test_outputs/connlist/test_with_named_ports_connlist_output.txt
similarity index 100%
rename from tests/test_with_named_ports/connlist_output.txt
rename to test_outputs/connlist/test_with_named_ports_connlist_output.txt
diff --git a/tests/with_end_port_example/connlist_output.txt b/test_outputs/connlist/with_end_port_example_connlist_output.txt
similarity index 100%
rename from tests/with_end_port_example/connlist_output.txt
rename to test_outputs/connlist/with_end_port_example_connlist_output.txt
diff --git a/tests/with_end_port_example_new/connlist_output.txt b/test_outputs/connlist/with_end_port_example_new_connlist_output.txt
similarity index 100%
rename from tests/with_end_port_example_new/connlist_output.txt
rename to test_outputs/connlist/with_end_port_example_new_connlist_output.txt
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.csv b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.csv
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.csv
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.csv
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot.png b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.png
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot.png
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.png
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot.svg b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.svg
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.dot.svg
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.svg
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.md b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.md
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.md
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.md
diff --git a/tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.txt b/test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.txt
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/TsetOutputWithArgNamesOption.txt
rename to test_outputs/diff/TsetOutputWithArgNamesOption_diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.txt
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.csv b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.csv
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.csv
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.csv
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot.png b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot.png
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot.png
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot.png
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot.svg b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot.svg
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.dot.svg
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.dot.svg
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.md b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.md
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.md
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.md
diff --git a/tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.txt b/test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.txt
similarity index 100%
rename from tests/acs-security-demos-added-workloads/diff_output_from_acs-security-demos.txt
rename to test_outputs/diff/diff_between_acs-security-demos-added-workloads_and_acs-security-demos.txt
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.csv b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.csv
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.csv
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.csv
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot.png b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot.png
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot.png
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot.png
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot.svg b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot.svg
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.dot.svg
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.dot.svg
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.md b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.md
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.md
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.md
diff --git a/tests/acs-security-demos-new/diff_output_from_acs-security-demos.txt b/test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.txt
similarity index 100%
rename from tests/acs-security-demos-new/diff_output_from_acs-security-demos.txt
rename to test_outputs/diff/diff_between_acs-security-demos-new_and_acs-security-demos.txt
diff --git a/tests/acs-security-demos-no-routes/diff_output_from_acs-security-demos.txt b/test_outputs/diff/diff_between_acs-security-demos-no-routes_and_acs-security-demos.txt
similarity index 100%
rename from tests/acs-security-demos-no-routes/diff_output_from_acs-security-demos.txt
rename to test_outputs/diff/diff_between_acs-security-demos-no-routes_and_acs-security-demos.txt
diff --git a/tests/deny_all_to_from_a_deployment_changed_netpol/diff_output_from_deny_all_to_from_a_deployment.txt b/test_outputs/diff/diff_between_deny_all_to_from_a_deployment_changed_netpol_and_deny_all_to_from_a_deployment.txt
similarity index 100%
rename from tests/deny_all_to_from_a_deployment_changed_netpol/diff_output_from_deny_all_to_from_a_deployment.txt
rename to test_outputs/diff/diff_between_deny_all_to_from_a_deployment_changed_netpol_and_deny_all_to_from_a_deployment.txt
diff --git a/tests/ipblockstest_2/diff_output_from_ipblockstest.txt b/test_outputs/diff/diff_between_ipblockstest_2_and_ipblockstest.txt
similarity index 100%
rename from tests/ipblockstest_2/diff_output_from_ipblockstest.txt
rename to test_outputs/diff/diff_between_ipblockstest_2_and_ipblockstest.txt
diff --git a/tests/ipblockstest_3/diff_output_from_ipblockstest.txt b/test_outputs/diff/diff_between_ipblockstest_3_and_ipblockstest.txt
similarity index 100%
rename from tests/ipblockstest_3/diff_output_from_ipblockstest.txt
rename to test_outputs/diff/diff_between_ipblockstest_3_and_ipblockstest.txt
diff --git a/tests/ipblockstest_3/diff_output_from_ipblockstest_2.txt b/test_outputs/diff/diff_between_ipblockstest_3_and_ipblockstest_2.txt
similarity index 100%
rename from tests/ipblockstest_3/diff_output_from_ipblockstest_2.txt
rename to test_outputs/diff/diff_between_ipblockstest_3_and_ipblockstest_2.txt
diff --git a/tests/ipblockstest_4/diff_output_from_ipblockstest.txt b/test_outputs/diff/diff_between_ipblockstest_4_and_ipblockstest.txt
similarity index 100%
rename from tests/ipblockstest_4/diff_output_from_ipblockstest.txt
rename to test_outputs/diff/diff_between_ipblockstest_4_and_ipblockstest.txt
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.csv b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.csv
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.csv
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.csv
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot.png b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot.png
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot.png
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot.png
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot.svg b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot.svg
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.dot.svg
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.dot.svg
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.md b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.md
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.md
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.md
diff --git a/tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.txt b/test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.txt
similarity index 100%
rename from tests/k8s_ingress_test_new/diff_output_from_k8s_ingress_test.txt
rename to test_outputs/diff/diff_between_k8s_ingress_test_new_and_k8s_ingress_test.txt
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.csv b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.csv
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.csv
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.csv
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot.png b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot.png
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot.png
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot.png
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot.svg b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot.svg
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.dot.svg
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.dot.svg
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.md b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.md
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.md
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.md
diff --git a/tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.txt b/test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.txt
similarity index 100%
rename from tests/multiple_ingress_objects_with_different_ports_new/diff_output_from_multiple_ingress_objects_with_different_ports.txt
rename to test_outputs/diff/diff_between_multiple_ingress_objects_with_different_ports_new_and_multiple_ingress_objects_with_different_ports.txt
diff --git a/tests/multiple_topology_resources_2/diff_output_from_multiple_topology_resources_1.txt b/test_outputs/diff/diff_between_multiple_topology_resources_2_and_multiple_topology_resources_1.txt
similarity index 100%
rename from tests/multiple_topology_resources_2/diff_output_from_multiple_topology_resources_1.txt
rename to test_outputs/diff/diff_between_multiple_topology_resources_2_and_multiple_topology_resources_1.txt
diff --git a/tests/multiple_topology_resources_4/diff_output_from_multiple_topology_resources_3.txt b/test_outputs/diff/diff_between_multiple_topology_resources_4_and_multiple_topology_resources_3.txt
similarity index 100%
rename from tests/multiple_topology_resources_4/diff_output_from_multiple_topology_resources_3.txt
rename to test_outputs/diff/diff_between_multiple_topology_resources_4_and_multiple_topology_resources_3.txt
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.csv b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.csv
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.csv
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.csv
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot.png b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot.png
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot.png
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot.png
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot.svg b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot.svg
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.dot.svg
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.dot.svg
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.md b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.md
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.md
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.md
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.txt b/test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.txt
similarity index 100%
rename from tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.txt
rename to test_outputs/diff/diff_between_netpol-diff-example-minimal_and_netpol-analysis-example-minimal.txt
diff --git a/tests/new_online_boutique_synthesis/diff_output_from_new_online_boutique.txt b/test_outputs/diff/diff_between_new_online_boutique_synthesis_and_new_online_boutique.txt
similarity index 100%
rename from tests/new_online_boutique_synthesis/diff_output_from_new_online_boutique.txt
rename to test_outputs/diff/diff_between_new_online_boutique_synthesis_and_new_online_boutique.txt
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.csv b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.csv
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.csv
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.csv
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot.png b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.png
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot.png
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.png
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot.svg b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.svg
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.dot.svg
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.dot.svg
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.md b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.md
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.md
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.md
diff --git a/tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.txt b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.txt
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols/diff_output_from_onlineboutique_workloads.txt
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_onlineboutique_workloads.txt
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.csv b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.csv
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.csv
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.csv
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot.png b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot.png
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot.png
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot.png
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot.svg b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot.svg
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.dot.svg
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.dot.svg
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.md b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.md
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.md
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.md
diff --git a/tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.txt b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.txt
similarity index 100%
rename from tests/onlineboutique_workloads_changed_netpols_and_workloads/diff_output_from_onlineboutique_workloads.txt
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_netpols_and_workloads_and_onlineboutique_workloads.txt
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.csv b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.csv
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.csv
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.csv
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot.png b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot.png
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot.png
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot.png
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot.svg b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot.svg
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.dot.svg
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.dot.svg
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.md b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.md
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.md
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.md
diff --git a/tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.txt b/test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.txt
similarity index 100%
rename from tests/onlineboutique_workloads_changed_workloads/diff_output_from_onlineboutique_workloads.txt
rename to test_outputs/diff/diff_between_onlineboutique_workloads_changed_workloads_and_onlineboutique_workloads.txt
diff --git a/tests/onlineboutique_workloads_with_ingress/diff_output_from_onlineboutique_workloads.csv b/test_outputs/diff/diff_between_onlineboutique_workloads_with_ingress_and_onlineboutique_workloads.csv
similarity index 100%
rename from tests/onlineboutique_workloads_with_ingress/diff_output_from_onlineboutique_workloads.csv
rename to test_outputs/diff/diff_between_onlineboutique_workloads_with_ingress_and_onlineboutique_workloads.csv
diff --git a/tests/semanticDiff-different-topologies-policy-a/diff_output_from_semanticDiff-different-topologies-policy-b.txt b/test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-a_and_semanticDiff-different-topologies-policy-b.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-a/diff_output_from_semanticDiff-different-topologies-policy-b.txt
rename to test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-a_and_semanticDiff-different-topologies-policy-b.txt
diff --git a/tests/semanticDiff-different-topologies-policy-a/diff_output_from_semanticDiff-same-topologies-old1.txt b/test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-a_and_semanticDiff-same-topologies-old1.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-a/diff_output_from_semanticDiff-same-topologies-old1.txt
rename to test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-a_and_semanticDiff-same-topologies-old1.txt
diff --git a/tests/semanticDiff-different-topologies-policy-b-with-ipblock/diff_output_from_semanticDiff-different-topologies-policy-a-with-ipblock.txt b/test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-b-with-ipblock_and_semanticDiff-different-topologies-policy-a-with-ipblock.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-b-with-ipblock/diff_output_from_semanticDiff-different-topologies-policy-a-with-ipblock.txt
rename to test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-b-with-ipblock_and_semanticDiff-different-topologies-policy-a-with-ipblock.txt
diff --git a/tests/semanticDiff-different-topologies-policy-b/diff_output_from_semanticDiff-different-topologies-policy-a.txt b/test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-b_and_semanticDiff-different-topologies-policy-a.txt
similarity index 100%
rename from tests/semanticDiff-different-topologies-policy-b/diff_output_from_semanticDiff-different-topologies-policy-a.txt
rename to test_outputs/diff/diff_between_semanticDiff-different-topologies-policy-b_and_semanticDiff-different-topologies-policy-a.txt
diff --git a/tests/semanticDiff-orig-topologies-policy-a/diff_output_from_semanticDiff-orig-topologies-no-policy.txt b/test_outputs/diff/diff_between_semanticDiff-orig-topologies-policy-a_and_semanticDiff-orig-topologies-no-policy.txt
similarity index 100%
rename from tests/semanticDiff-orig-topologies-policy-a/diff_output_from_semanticDiff-orig-topologies-no-policy.txt
rename to test_outputs/diff/diff_between_semanticDiff-orig-topologies-policy-a_and_semanticDiff-orig-topologies-no-policy.txt
diff --git a/tests/semanticDiff-same-topologies-new1/diff_output_from_semanticDiff-same-topologies-old1.txt b/test_outputs/diff/diff_between_semanticDiff-same-topologies-new1_and_semanticDiff-same-topologies-old1.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new1/diff_output_from_semanticDiff-same-topologies-old1.txt
rename to test_outputs/diff/diff_between_semanticDiff-same-topologies-new1_and_semanticDiff-same-topologies-old1.txt
diff --git a/tests/semanticDiff-same-topologies-new1a/diff_output_from_semanticDiff-same-topologies-old1.txt b/test_outputs/diff/diff_between_semanticDiff-same-topologies-new1a_and_semanticDiff-same-topologies-old1.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new1a/diff_output_from_semanticDiff-same-topologies-old1.txt
rename to test_outputs/diff/diff_between_semanticDiff-same-topologies-new1a_and_semanticDiff-same-topologies-old1.txt
diff --git a/tests/semanticDiff-same-topologies-new2/diff_output_from_semanticDiff-same-topologies-old2.txt b/test_outputs/diff/diff_between_semanticDiff-same-topologies-new2_and_semanticDiff-same-topologies-old2.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new2/diff_output_from_semanticDiff-same-topologies-old2.txt
rename to test_outputs/diff/diff_between_semanticDiff-same-topologies-new2_and_semanticDiff-same-topologies-old2.txt
diff --git a/tests/semanticDiff-same-topologies-new3/diff_output_from_semanticDiff-same-topologies-old3.txt b/test_outputs/diff/diff_between_semanticDiff-same-topologies-new3_and_semanticDiff-same-topologies-old3.txt
similarity index 100%
rename from tests/semanticDiff-same-topologies-new3/diff_output_from_semanticDiff-same-topologies-old3.txt
rename to test_outputs/diff/diff_between_semanticDiff-same-topologies-new3_and_semanticDiff-same-topologies-old3.txt
diff --git a/tests/test_with_named_ports_changed_netpol_3/diff_output_from_test_with_named_ports_changed_netpol_2.txt b/test_outputs/diff/diff_between_test_with_named_ports_changed_netpol_3_and_test_with_named_ports_changed_netpol_2.txt
similarity index 100%
rename from tests/test_with_named_ports_changed_netpol_3/diff_output_from_test_with_named_ports_changed_netpol_2.txt
rename to test_outputs/diff/diff_between_test_with_named_ports_changed_netpol_3_and_test_with_named_ports_changed_netpol_2.txt
diff --git a/tests/test_with_named_ports_changed_netpol/diff_output_from_test_with_named_ports.txt b/test_outputs/diff/diff_between_test_with_named_ports_changed_netpol_and_test_with_named_ports.txt
similarity index 100%
rename from tests/test_with_named_ports_changed_netpol/diff_output_from_test_with_named_ports.txt
rename to test_outputs/diff/diff_between_test_with_named_ports_changed_netpol_and_test_with_named_ports.txt
diff --git a/tests/with_end_port_example_new/diff_output_from_with_end_port_example.csv b/test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.csv
similarity index 100%
rename from tests/with_end_port_example_new/diff_output_from_with_end_port_example.csv
rename to test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.csv
diff --git a/tests/with_end_port_example_new/diff_output_from_with_end_port_example.dot b/test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.dot
similarity index 100%
rename from tests/with_end_port_example_new/diff_output_from_with_end_port_example.dot
rename to test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.dot
diff --git a/tests/with_end_port_example_new/diff_output_from_with_end_port_example.md b/test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.md
similarity index 100%
rename from tests/with_end_port_example_new/diff_output_from_with_end_port_example.md
rename to test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.md
diff --git a/tests/with_end_port_example_new/diff_output_from_with_end_port_example.txt b/test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.txt
similarity index 100%
rename from tests/with_end_port_example_new/diff_output_from_with_end_port_example.txt
rename to test_outputs/diff/diff_between_with_end_port_example_new_and_with_end_port_example.txt
diff --git a/tests/demo_app_with_routes_and_ingress/connlist_output.dot.png b/tests/demo_app_with_routes_and_ingress/connlist_output.dot.png
deleted file mode 100644
index 8619c557..00000000
Binary files a/tests/demo_app_with_routes_and_ingress/connlist_output.dot.png and /dev/null differ
diff --git a/tests/deny_all_to_from_a_deployment/connlist_output.txt b/tests/deny_all_to_from_a_deployment/connlist_output.txt
deleted file mode 100644
index d27c2b31..00000000
--- a/tests/deny_all_to_from_a_deployment/connlist_output.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-0.0.0.0-255.255.255.255 => default/deployment2[Deployment] : All Connections
-default/deployment2[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
\ No newline at end of file
diff --git a/tests/deny_all_to_from_a_deployment_changed_netpol/connlist_output.txt b/tests/deny_all_to_from_a_deployment_changed_netpol/connlist_output.txt
deleted file mode 100644
index 1e144112..00000000
--- a/tests/deny_all_to_from_a_deployment_changed_netpol/connlist_output.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-0.0.0.0-255.255.255.255 => default/deployment2[Deployment] : All Connections
-default/deployment2[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
-default/deployment2[Deployment] => default/deployment1[Deployment] : All Connections
\ No newline at end of file
diff --git a/tests/bad_yamls/document_with_syntax_error.yaml b/tests/document_with_syntax_error/document_with_syntax_error.yaml
similarity index 100%
rename from tests/bad_yamls/document_with_syntax_error.yaml
rename to tests/document_with_syntax_error/document_with_syntax_error.yaml
diff --git a/tests/k8s_ingress_test_new/connlist_output.txt b/tests/k8s_ingress_test_new/connlist_output.txt
deleted file mode 100644
index 2e1d879e..00000000
--- a/tests/k8s_ingress_test_new/connlist_output.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-0.0.0.0-255.255.255.255 => default/unicorn[Deployment] : All Connections
-default/reviews-v1-545db77b95[ReplicaSet] => default/productpage-v1-6b746f74dc[ReplicaSet] : TCP 9080
-default/reviews-v1-545db77b95[ReplicaSet] => default/ratings-v1-b6994bb9[ReplicaSet] : TCP 9080
-default/reviews-v2-7bf8c9648f[ReplicaSet] => default/productpage-v1-6b746f74dc[ReplicaSet] : TCP 9080
-default/reviews-v2-7bf8c9648f[ReplicaSet] => default/ratings-v1-b6994bb9[ReplicaSet] : TCP 9080
-default/reviews-v3-84779c7bbc[ReplicaSet] => default/productpage-v1-6b746f74dc[ReplicaSet] : TCP 9080
-default/reviews-v3-84779c7bbc[ReplicaSet] => default/ratings-v1-b6994bb9[ReplicaSet] : TCP 9080
-default/unicorn[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
-default/unicorn[Deployment] => default/details-v1-79f774bdb9[ReplicaSet] : TCP 9080
-{ingress-controller} => default/details-v1-79f774bdb9[ReplicaSet] : TCP 9080
-{ingress-controller} => default/unicorn[Deployment] : TCP 8080
\ No newline at end of file
diff --git a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.svg b/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.svg
deleted file mode 100644
index fee40b31..00000000
--- a/tests/netpol-diff-example-minimal/diff_output_from_netpol-analysis-example-minimal.svg
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
diff --git a/tests/onlineboutique_workloads_with_configmap/connlist_output.txt b/tests/onlineboutique_workloads_with_configmap/connlist_output.txt
deleted file mode 100644
index 85516d56..00000000
--- a/tests/onlineboutique_workloads_with_configmap/connlist_output.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-0.0.0.0-255.255.255.255 => default/redis-cart[Deployment] : All Connections
-default/checkoutservice[Deployment] => default/cartservice[Deployment] : TCP 7070
-default/checkoutservice[Deployment] => default/currencyservice[Deployment] : TCP 7000
-default/checkoutservice[Deployment] => default/emailservice[Deployment] : TCP 8080
-default/checkoutservice[Deployment] => default/paymentservice[Deployment] : TCP 50051
-default/checkoutservice[Deployment] => default/productcatalogservice[Deployment] : TCP 3550
-default/checkoutservice[Deployment] => default/shippingservice[Deployment] : TCP 50051
-default/frontend[Deployment] => default/adservice[Deployment] : TCP 9555
-default/frontend[Deployment] => default/cartservice[Deployment] : TCP 7070
-default/frontend[Deployment] => default/checkoutservice[Deployment] : TCP 5050
-default/frontend[Deployment] => default/currencyservice[Deployment] : TCP 7000
-default/frontend[Deployment] => default/productcatalogservice[Deployment] : TCP 3550
-default/frontend[Deployment] => default/recommendationservice[Deployment] : TCP 8080
-default/frontend[Deployment] => default/shippingservice[Deployment] : TCP 50051
-default/loadgenerator[Deployment] => default/frontend[Deployment] : TCP 8080
-default/recommendationservice[Deployment] => default/productcatalogservice[Deployment] : TCP 3550
-default/redis-cart[Deployment] => 0.0.0.0-255.255.255.255 : All Connections
\ No newline at end of file