diff --git a/framework/python/src/common/util.py b/framework/python/src/common/util.py index e588640ae..856217add 100644 --- a/framework/python/src/common/util.py +++ b/framework/python/src/common/util.py @@ -46,7 +46,8 @@ def run_command(cmd, output=True): LOGGER.debug('Command succeeded: ' + cmd) if output: out = stdout.strip().decode('utf-8') - LOGGER.debug('Command output: ' + out) + if out is not None and len(out) != 0: + LOGGER.debug('Command output: ' + out) return out, stderr else: return success diff --git a/framework/python/src/net_orc/ip_control.py b/framework/python/src/net_orc/ip_control.py index 1eeafc1a9..84296112e 100644 --- a/framework/python/src/net_orc/ip_control.py +++ b/framework/python/src/net_orc/ip_control.py @@ -42,7 +42,7 @@ def add_namespace(self, namespace): return success def check_interface_status(self, interface_name): - output = util.run_command(cmd=f'ip link show {interface_name}',output=True) + output = util.run_command(cmd=f'ip link show {interface_name}', output=True) if 'state DOWN ' in output[0]: return False else: diff --git a/framework/python/src/net_orc/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py index aa23f1918..0ea342bad 100644 --- a/framework/python/src/net_orc/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -258,6 +258,8 @@ def _start_device_monitor(self, device): sniffer.stop() self._session.set_status('Cancelled') LOGGER.error('Device interface disconnected, cancelling Testrun') + + LOGGER.debug('Writing packets to monitor.pcap') wrpcap(os.path.join(device_runtime_dir, 'monitor.pcap'), self._monitor_packets) self._monitor_in_progress = False diff --git a/testing/api/test_api.py b/testing/api/test_api.py index b5a4f7978..871a016d5 100644 --- a/testing/api/test_api.py +++ b/testing/api/test_api.py @@ -236,11 +236,7 @@ def test_get_system_interfaces(testrun): def test_modify_device(testing_devices, testrun): - with open( - os.path.join( - DEVICES_DIRECTORY, testing_devices[1] - ) - ) as f: + with open(testing_devices[1], encoding="utf-8") as f: local_device = json.load(f) mac_addr = local_device["mac_addr"]