Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions framework/python/src/core/testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 9 additions & 15 deletions framework/python/src/net_orc/network_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand All @@ -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()

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -324,19 +320,17 @@ 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):
LOGGER.error('Baseline network validation failed.')
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()

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/test/conn/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pyOpenSSL
pyOpenSSL
scapy
2 changes: 1 addition & 1 deletion testing/tests/test_tests
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down