mirror of
https://github.com/espressif/openthread.git
synced 2026-08-26 04:09:52 +00:00
[test] add posix verification for OT 1.2 (#6070)
This change: 1. Adds new github action to verify posix app for OT 1.2. 2. Only enable compile flag OT_SIMULATION_VIRTUAL_TIME_UART in script/test for ot-rcp build target. 3. Allow mix use of posix node and ot-cli-mtd node by changing python test script to accept node type as parameter. 4. Remove CSL test from expect as it is covered by thread-1-2-posix tests.
This commit is contained in:
@@ -345,8 +345,13 @@ class OtCli:
|
||||
# Default command if no match below, will be overridden if below conditions are met.
|
||||
cmd = './ot-cli-%s' % (mode)
|
||||
|
||||
# For Thread 1.2 MTD node, use ot-cli-mtd build regardless of OT_CLI_PATH
|
||||
if self.version == '1.2' and mode == 'mtd' and 'top_builddir' in os.environ:
|
||||
srcdir = os.environ['top_builddir']
|
||||
cmd = '%s/examples/apps/cli/ot-cli-%s %d' % (srcdir, mode, nodeid)
|
||||
|
||||
# If Thread version of node matches the testing environment version.
|
||||
if self.version == self.env_version:
|
||||
elif self.version == self.env_version:
|
||||
# Load Thread 1.2 BBR device when testing Thread 1.2 scenarios
|
||||
# which requires device with Backbone functionality.
|
||||
if self.version == '1.2' and self.is_bbr:
|
||||
@@ -367,6 +372,7 @@ class OtCli:
|
||||
if 'RADIO_DEVICE' in os.environ:
|
||||
cmd += ' --real-time-signal=+1 -v spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVICE'],
|
||||
nodeid)
|
||||
self.is_posix = True
|
||||
else:
|
||||
cmd += ' %d' % nodeid
|
||||
|
||||
@@ -382,6 +388,7 @@ class OtCli:
|
||||
if 'RADIO_DEVICE_1_1' in os.environ:
|
||||
cmd += ' --real-time-signal=+1 -v spinel+hdlc+uart://%s?forkpty-arg=%d' % (
|
||||
os.environ['RADIO_DEVICE_1_1'], nodeid)
|
||||
self.is_posix = True
|
||||
else:
|
||||
cmd += ' %d' % nodeid
|
||||
|
||||
@@ -410,6 +417,7 @@ class OtCli:
|
||||
if 'RADIO_DEVICE' in os.environ:
|
||||
args = ' --real-time-signal=+1 spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVICE'],
|
||||
nodeid)
|
||||
self.is_posix = True
|
||||
else:
|
||||
args = ''
|
||||
|
||||
@@ -449,6 +457,7 @@ class OtCli:
|
||||
if 'RADIO_DEVICE_1_1' in os.environ:
|
||||
args = ' --real-time-signal=+1 spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVICE_1_1'],
|
||||
nodeid)
|
||||
self.is_posix = True
|
||||
else:
|
||||
args = ''
|
||||
|
||||
@@ -502,6 +511,7 @@ class NodeImpl:
|
||||
def __init__(self, nodeid, name=None, simulator=None, **kwargs):
|
||||
self.nodeid = nodeid
|
||||
self.name = name or ('Node%d' % nodeid)
|
||||
self.is_posix = False
|
||||
|
||||
self.simulator = simulator
|
||||
if self.simulator:
|
||||
|
||||
@@ -144,7 +144,6 @@ class VirtualTime(BaseSimulator):
|
||||
|
||||
BLOCK_TIMEOUT = 10
|
||||
|
||||
RADIO_ONLY = os.getenv('RADIO_DEVICE') is not None
|
||||
NCP_SIM = os.getenv('NODE_TYPE', 'sim') == 'ncp-sim'
|
||||
|
||||
_message_factory = None
|
||||
@@ -246,7 +245,7 @@ class VirtualTime(BaseSimulator):
|
||||
return (addr[0], addr[1] - self.BASE_PORT)
|
||||
|
||||
def _core_addr_from(self, nodeid):
|
||||
if self.RADIO_ONLY:
|
||||
if self._nodes[nodeid].is_posix:
|
||||
return ('127.0.0.1', self.BASE_PORT + self.port + nodeid)
|
||||
else:
|
||||
return ('127.0.0.1', self.port + nodeid)
|
||||
|
||||
@@ -61,6 +61,7 @@ class LowPower_5_3_01_SSEDAttachment(thread_cert.TestCase):
|
||||
SSED_1: {
|
||||
'version': '1.2',
|
||||
'name': 'SSED_1',
|
||||
'is_mtd': True,
|
||||
'mode': '-',
|
||||
'panid': 0xface,
|
||||
'allowlist': [LEADER],
|
||||
|
||||
@@ -47,6 +47,7 @@ class SSED_CslTransmission(thread_cert.TestCase):
|
||||
},
|
||||
SSED_1: {
|
||||
'version': '1.2',
|
||||
'is_mtd': True,
|
||||
'mode': '-',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user