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
3 changes: 2 additions & 1 deletion framework/python/src/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion framework/python/src/net_orc/ip_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions framework/python/src/net_orc/network_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions testing/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down