Skip to content
Merged
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
11 changes: 8 additions & 3 deletions framework/python/src/net_orc/network_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import json
import os
from scapy.all import sniff, wrpcap, BOOTP, AsyncSniffer
from scapy.error import Scapy_Exception
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -306,9 +307,13 @@ def _start_device_monitor(self, device):

if not self._ip_ctrl.check_interface_status(
self._session.get_device_interface()):
sniffer.stop()
self._session.set_status(TestrunStatus.CANCELLED)
LOGGER.error('Device interface disconnected, cancelling Testrun')
try:
sniffer.stop()
except Scapy_Exception:
LOGGER.error('Device adapter disconnected whilst monitoring.')
finally:
self._session.set_status(TestrunStatus.CANCELLED)
LOGGER.error('Device interface disconnected, cancelling Testrun')

LOGGER.debug('Writing packets to monitor.pcap')
wrpcap(os.path.join(device_runtime_dir, 'monitor.pcap'),
Expand Down