Skip to content

Commit

Permalink
fixed run_all_tests path problem
Browse files Browse the repository at this point in the history
Signed-off-by: Shmulik Froimovich <[email protected]>
  • Loading branch information
shmfr committed Jun 22, 2023
1 parent dea4134 commit c4761fc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
final fw rules for query: , config: testcase8-networkpolicy1.yaml:
src: 0.0.0.0/0 dst_ns: [default,kube-system,kube-system-dummy-to-ignore,vendor-system] dst_pods: [*] conn: All connections
src_ns: [default,kube-system,kube-system-dummy-to-ignore,vendor-system] src_pods: [*] dst: 0.0.0.0/0 conn: All connections
src_ns: [default,kube-system,kube-system-dummy-to-ignore,vendor-system] src_pods: [*] dst_ns: [default,kube-system,kube-system-dummy-to-ignore,vendor-system] dst_pods: [*] conn: All connections

Configurations affecting the connectivity between (src)default/cog-agents(DaemonSet) and (dst)default/cog-agents(DaemonSet):

(src)default/cog-agents(DaemonSet):
Policy Configurations:
Default-Policy
Resource Configurations:
default/cog-agents(DaemonSet): line 5 in file ./k8s_testcases/example_podlist/pods_list.json

(dst)default/cog-agents(DaemonSet):
Policy Configurations:
allow-traffic-from-vendor-system-to-default-on-all-ports-typo: line 6 in file ./k8s_testcases/example_policies/testcase8/testcase8-networkpolicy1.yaml
Resource Configurations:
default/cog-agents(DaemonSet): line 67 in file ./k8s_testcases/example_podlist/pods_list.json
7 changes: 6 additions & 1 deletion tests/run_all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def __init__(self, args, base_dir=None):
def _fix_path_args_with_base_dir(self, base_dir):
for idx, arg in enumerate(self.args):
if '/' in arg and not arg.startswith(('https://github', 'https://raw.githubusercontent')):
self.args[idx] = os.path.join(base_dir, arg)
# exclude cases where the arg is not a path
if self.args[idx - 1] in ['--explain', '-expl']:
continue
full_path = os.path.join(base_dir, arg)
self.args[idx] = full_path


def get_arg_value(self, arg_str_list):
for index, arg in enumerate(self.args):
Expand Down

0 comments on commit c4761fc

Please sign in to comment.