mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
[scripts] update cert tests to use thread_cert.TestCase (#4874)
- Update all test cases to inherit thread_cert.TestCase and update topologies accordingly. The topologies should all be correct because they are automatically generated, not hand written. - Use default Thread version: 1.1 - Cleanup node tmp files in tmp directory according to the current PORT_OFFSET in setUp. This is required by test_reed_address_solicit_rejected.py and test_coap_observe.py since they define multiple test functions in one TestCase. - Removed call to set_extaddr64 because it's not necessary and causing failures.
This commit is contained in:
@@ -30,37 +30,26 @@
|
||||
import unittest
|
||||
|
||||
import config
|
||||
import node
|
||||
import thread_cert
|
||||
|
||||
LEADER = 1
|
||||
ROUTER = 2
|
||||
|
||||
|
||||
class TestCoaps(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.simulator = config.create_default_simulator()
|
||||
|
||||
self.nodes = {}
|
||||
for i in range(1, 3):
|
||||
self.nodes[i] = node.Node(i, simulator=self.simulator)
|
||||
|
||||
self.nodes[LEADER].set_panid(0xface)
|
||||
self.nodes[LEADER].set_mode('rsdn')
|
||||
self.nodes[LEADER].add_whitelist(self.nodes[ROUTER].get_addr64())
|
||||
self.nodes[LEADER].enable_whitelist()
|
||||
|
||||
self.nodes[ROUTER].set_panid(0xface)
|
||||
self.nodes[ROUTER].set_mode('rsdn')
|
||||
self.nodes[ROUTER].add_whitelist(self.nodes[LEADER].get_addr64())
|
||||
self.nodes[ROUTER].enable_whitelist()
|
||||
self.nodes[ROUTER].set_router_selection_jitter(1)
|
||||
|
||||
def tearDown(self):
|
||||
for n in list(self.nodes.values()):
|
||||
n.stop()
|
||||
n.destroy()
|
||||
self.simulator.stop()
|
||||
class TestCoaps(thread_cert.TestCase):
|
||||
topology = {
|
||||
LEADER: {
|
||||
'mode': 'rsdn',
|
||||
'panid': 0xface,
|
||||
'whitelist': [ROUTER]
|
||||
},
|
||||
ROUTER: {
|
||||
'mode': 'rsdn',
|
||||
'panid': 0xface,
|
||||
'router_selection_jitter': 1,
|
||||
'whitelist': [LEADER]
|
||||
},
|
||||
}
|
||||
|
||||
def test(self):
|
||||
self.nodes[LEADER].start()
|
||||
|
||||
Reference in New Issue
Block a user