diff --git a/framework/python/src/core/testrun.py b/framework/python/src/core/testrun.py index 6e3a6da5d..3a35be624 100644 --- a/framework/python/src/core/testrun.py +++ b/framework/python/src/core/testrun.py @@ -84,17 +84,18 @@ def __init__(self, # Create session self._session = TestRunSession(config_file=self._config_file) + # Register runtime parameters if single_intf: self._session.add_runtime_param('single_intf') if net_only: self._session.add_runtime_param('net_only') + if not validate: + self._session.add_runtime_param('no-validate') self._load_all_devices() self._net_orc = net_orc.NetworkOrchestrator( - session=self._session, - validate=validate, - single_intf = self._single_intf) + session=self._session) self._test_orc = test_orc.TestOrchestrator( self._session, self._net_orc) diff --git a/framework/python/src/net_orc/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py index 19cf0081a..4abdb9651 100644 --- a/framework/python/src/net_orc/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -47,13 +47,11 @@ class NetworkOrchestrator: """Manage and controls a virtual testing network.""" - def __init__(self, session, validate=True, single_intf=False): + def __init__(self, + session): self._session = session self._monitor_in_progress = False - self._validate = validate - self._single_intf = single_intf - self._listener = None self._net_modules = [] @@ -73,8 +71,6 @@ def start(self): LOGGER.debug('Starting network orchestrator') - self._host_user = util.get_host_user() - # Get all components ready self.load_network_modules() @@ -123,7 +119,7 @@ def start_network(self): self.create_net() self.start_network_services() - if self._validate: + if 'no-validate' not in self._session.get_runtime_params(): # Start the validator after network is ready self.validator.start() @@ -179,7 +175,7 @@ def _device_discovered(self, mac_addr): shutil.rmtree(device_runtime_dir, ignore_errors=True) os.makedirs(device_runtime_dir, exist_ok=True) - util.run_command(f'chown -R {self._host_user} {device_runtime_dir}') + util.run_command(f'chown -R {util.get_host_user()} {device_runtime_dir}') packet_capture = sniff(iface=self._session.get_device_interface(), timeout=self._session.get_startup_timeout(), @@ -324,9 +320,8 @@ def _ci_post_network_create(self): def create_net(self): LOGGER.info('Creating baseline network') - # TODO: This is not just for CI - #if self._single_intf: - #self._ci_pre_network_create() + if os.getenv('GITHUB_ACTIONS'): + self._ci_pre_network_create() # Setup the virtual network if not self._ovs.create_baseline_net(verify=True): @@ -334,9 +329,8 @@ def create_net(self): self.stop() sys.exit(1) - # TODO: This is not just for CI - #if self._single_intf: - #self._ci_post_network_create() + if os.getenv("GITHUB_ACTIONS"): + self._ci_post_network_create() self._create_private_net() @@ -469,7 +463,7 @@ def _start_network_service(self, net_module): privileged=True, detach=True, mounts=net_module.mounts, - environment={'HOST_USER': self._host_user}) + environment={'HOST_USER': util.get_host_user()}) except docker.errors.ContainerError as error: LOGGER.error('Container run error') LOGGER.error(error) diff --git a/modules/test/conn/python/requirements.txt b/modules/test/conn/python/requirements.txt index c523787b9..c2275b3e0 100644 --- a/modules/test/conn/python/requirements.txt +++ b/modules/test/conn/python/requirements.txt @@ -1,2 +1,2 @@ -pyOpenSSL +pyOpenSSL scapy \ No newline at end of file diff --git a/testing/tests/test_tests b/testing/tests/test_tests index be7a3cef3..193b57184 100755 --- a/testing/tests/test_tests +++ b/testing/tests/test_tests @@ -112,7 +112,7 @@ for tester in $TESTERS; do sudo docker kill $tester sudo docker logs $tester | cat - cp runtime/test/${ethmac//:/}/results.json $TEST_DIR/$tester.json + cp runtime/test/${ethmac//:/}/report.json $TEST_DIR/$tester.json more $TEST_DIR/$tester.json more $testrun_log