[thread-cert] Thread 1.2 CI with OTBR and Backbone link (#5489)

Thread 1.2 CI with OTBR and Backbone link:
- Run OTBR in Dockers with Backbone link
- Enhance node.py to work with OTBR Docker
- Add Packet Verification for 5.11.1
  - incomplete, some steps can not pass yet, just to make sure
    Backbone traffic verification works
- Support running multiple tests simultaneously (default: each test
  run 3 instances)
- Build OTBR Docker using OpenThread PR code
- Upload code coverage in Docker

Some implementation details:
- Most existing code of node.py is shared by OTBR Docker
- Backbone related test scripts are found in
  tests/scripts/thread-cert/backbone
- A new script tests/scripts/thread-cert/run_bbr_tests.py is added to
  manage multiple running tests
- Test configuration differs according to PORT_OFFSET
  - Backbone interface name: Backbone{PORT_OFFSET}
  - Backbone network prefix: 91{PORT_OFFSET:02x}::/64
  - Docker instance name: otbr_{PORT_OFFSET}_{nodeid}
  - Output Files:
    - Pcap:
      - Thread: {test_name}_{PORT_OFFSET}.pcap
      - Backbone: {test_name}_{PORT_OFFSET}_backbone.pcap
      - Merged: {test_name}_{PORT_OFFSET}_merged.pcap
    - Log: {test_name}_{PORT_OFFSET}.log
This commit is contained in:
Simon Lin
2020-09-24 20:16:27 -07:00
committed by GitHub
parent 2daa097bb4
commit ce336257ee
14 changed files with 1011 additions and 114 deletions
+10 -7
View File
@@ -91,9 +91,9 @@ class BaseSimulator(object):
class RealTime(BaseSimulator):
def __init__(self):
def __init__(self, use_message_factory=True):
super(RealTime, self).__init__()
self._sniffer = config.create_default_thread_sniffer()
self._sniffer = config.create_default_thread_sniffer(use_message_factory=use_message_factory)
self._sniffer.start()
def set_lowpan_context(self, cid, prefix):
@@ -147,7 +147,7 @@ class VirtualTime(BaseSimulator):
RADIO_ONLY = os.getenv('RADIO_DEVICE') is not None
NCP_SIM = os.getenv('NODE_TYPE', 'sim') == 'ncp-sim'
def __init__(self):
def __init__(self, use_message_factory=True):
super(VirtualTime, self).__init__()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@@ -169,7 +169,8 @@ class VirtualTime(BaseSimulator):
self.current_nodeid = None
self._pause_time = 0
self._message_factory = config.create_default_thread_message_factory()
if use_message_factory:
self._message_factory = config.create_default_thread_message_factory()
def __del__(self):
if self.sock:
@@ -189,8 +190,9 @@ class VirtualTime(BaseSimulator):
# Ignore any exceptions
try:
messages = self._message_factory.create(io.BytesIO(message_obj))
self.devices[addr]['msgs'] += messages
if self._message_factory is not None:
messages = self._message_factory.create(io.BytesIO(message_obj))
self.devices[addr]['msgs'] += messages
except message.DropPacketException:
print('Drop current packet because it cannot be handled in test scripts')
@@ -200,7 +202,8 @@ class VirtualTime(BaseSimulator):
traceback.print_exc()
def set_lowpan_context(self, cid, prefix):
self._message_factory.set_lowpan_context(cid, prefix)
if self._message_factory is not None:
self._message_factory.set_lowpan_context(cid, prefix)
def get_messages_sent_by(self, nodeid):
""" Get sniffed messages.