[tests] add 5_7_01 network diagnostic test cases (#4663)

This commit adds Network Diagnostic TLV parsing and 5.7.01 test case.
This commit is contained in:
kangping
2020-04-28 13:37:21 -07:00
committed by GitHub
parent 0778831ecd
commit 80285206d2
5 changed files with 651 additions and 9 deletions
+24
View File
@@ -901,6 +901,30 @@ class Node:
self.send_command('netdataregister')
self._expect('Done')
def send_network_diag_get(self, addr, tlv_types):
self.send_command('networkdiagnostic get %s %s' %
(addr, ' '.join([str(t.value) for t in tlv_types])))
if isinstance(self.simulator, simulator.VirtualTime):
self.simulator.go(8)
timeout = 1
else:
timeout = 8
self._expect('Done', timeout=timeout)
def send_network_diag_reset(self, addr, tlv_types):
self.send_command('networkdiagnostic reset %s %s' %
(addr, ' '.join([str(t.value) for t in tlv_types])))
if isinstance(self.simulator, simulator.VirtualTime):
self.simulator.go(8)
timeout = 1
else:
timeout = 8
self._expect('Done', timeout=timeout)
def energy_scan(self, mask, count, period, scan_duration, ipaddr):
cmd = 'commissioner energy %d %d %d %d %s' % (
mask,