mirror of
https://github.com/espressif/openthread.git
synced 2026-09-01 06:49:54 +00:00
[mac] remove beacons payload (#7472)
Thread Specification v1.2.1 removes support for Thread Beacons payload.
This commit is contained in:
@@ -102,10 +102,10 @@ expect_line "Done"
|
||||
send "dataset pskc\n"
|
||||
expect "00112233445566778899aabbccddeeff"
|
||||
expect_line "Done"
|
||||
send "dataset securitypolicy 678 onrcb\n"
|
||||
send "dataset securitypolicy 678 onrc\n"
|
||||
expect_line "Done"
|
||||
send "dataset securitypolicy\n"
|
||||
expect "678 onrcb"
|
||||
expect "678 onrc"
|
||||
expect_line "Done"
|
||||
send "dataset pendingtimestamp 100\n"
|
||||
expect_line "Done"
|
||||
@@ -135,7 +135,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect "Security Policy: 678 onrc"
|
||||
expect_line "Done"
|
||||
send "dataset pending -x\n"
|
||||
expect "dataset pending -x"
|
||||
@@ -161,7 +161,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect "Security Policy: 678 onrc"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 30
|
||||
@@ -183,7 +183,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect "Security Policy: 678 onrc"
|
||||
expect_line "Done"
|
||||
send "dataset clear\n"
|
||||
expect_line "Done"
|
||||
@@ -203,7 +203,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect "Security Policy: 678 onrc"
|
||||
expect_line "Done"
|
||||
send "dataset init pending\n"
|
||||
expect "Error 23: NotFound"
|
||||
|
||||
@@ -43,7 +43,9 @@ wait_for "state" "leader"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
send "ifconfig up\n"
|
||||
expect_line "Done"
|
||||
send "discover\n"
|
||||
expect "Thread Network"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -58,7 +60,7 @@ wait_for "state" "leader"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
send "discover\n"
|
||||
expect "Thread 网络"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -73,7 +75,7 @@ wait_for "state" "leader"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
send "discover\n"
|
||||
expect "スレッド"
|
||||
expect_line "Done"
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ expect_line "Done"
|
||||
|
||||
switch_node 3
|
||||
send "scan $channel\n"
|
||||
expect "| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+---+------------------+------------------+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| \\d \\| $network +\\| $extpan \\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
expect "| PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
wait_for "" "Done"
|
||||
send "scan energy 100\n"
|
||||
expect "| Ch | RSSI |"
|
||||
@@ -83,9 +83,9 @@ expect "Error 13: InvalidState"
|
||||
send "ifconfig up\n"
|
||||
expect_line "Done"
|
||||
send "discover $channel\n"
|
||||
expect "| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+---+------------------+------------------+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| \\d \\| $network +\\| $extpan \\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
expect "| Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+------------------+------------------+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| $network +\\| $extpan \\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
wait_for "" "Done"
|
||||
send "discover something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
@@ -49,17 +49,6 @@ expect "panid"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set pan $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
send "extpanid\n"
|
||||
expect "extpanid"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extpan $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
expect "> "
|
||||
send "networkname\n"
|
||||
expect "networkname"
|
||||
expect -re {[\r\n]([^\r\n]+)[\r\n]}
|
||||
set network $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
send "channel\n"
|
||||
expect "channel"
|
||||
expect -re {(\d+)}
|
||||
@@ -68,9 +57,9 @@ expect_line "Done"
|
||||
|
||||
spawn_node 2 "rcp" "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=--sleep-to-tx&forkpty-arg=2"
|
||||
send "scan\n"
|
||||
expect "| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+---+------------------+------------------+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| \\d \\| $network +\\| $extpan \\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
expect "| PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+------+------------------+----+-----+-----+"
|
||||
wait_for "" "\\| $pan \\| $extaddr \\| +$channel \\| +-?\\d+ \\| +\\d \\|"
|
||||
wait_for "" "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -77,7 +77,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
'timestamp': 1,
|
||||
'channel': 19,
|
||||
'network_key': '00112233445566778899aabbccddeeff',
|
||||
'security_policy': [3600, 'onrcb']
|
||||
'security_policy': [3600, 'onrc']
|
||||
},
|
||||
'mode': 'rdn',
|
||||
},
|
||||
@@ -87,7 +87,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
'timestamp': 1,
|
||||
'channel': 19,
|
||||
'network_key': '00112233445566778899aabbccddeeff',
|
||||
'security_policy': [3600, 'onrcb']
|
||||
'security_policy': [3600, 'onrc']
|
||||
},
|
||||
'mode': 'rdn',
|
||||
'allowlist': [LEADER]
|
||||
@@ -103,7 +103,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
'timestamp': 1,
|
||||
'channel': 19,
|
||||
'network_key': '00112233445566778899aabbccddeeff',
|
||||
'security_policy': [3600, 'onrcb']
|
||||
'security_policy': [3600, 'onrc']
|
||||
},
|
||||
'mode': 'rdn',
|
||||
},
|
||||
@@ -130,10 +130,10 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
self.simulator.go(5)
|
||||
|
||||
# Step 5
|
||||
# Disabling O-Bit security_policy = [3600, 0b01111000]
|
||||
# Disabling O-Bit security_policy = [3600, 0b01110000]
|
||||
self.nodes[COMMISSIONER_1].send_mgmt_active_set(
|
||||
active_timestamp=15,
|
||||
security_policy=[3600, 'nrcb'],
|
||||
security_policy=[3600, 'nrc'],
|
||||
)
|
||||
self.simulator.go(5)
|
||||
|
||||
@@ -143,10 +143,10 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
self.simulator.go(5)
|
||||
|
||||
# Step 9
|
||||
# Disabling N-Bit security_policy = [3600, 0b10111000]
|
||||
# Disabling N-Bit security_policy = [3600, 0b10110000]
|
||||
self.nodes[COMMISSIONER_1].send_mgmt_active_set(
|
||||
active_timestamp=20,
|
||||
security_policy=[3600, 'orcb'],
|
||||
security_policy=[3600, 'orc'],
|
||||
)
|
||||
self.simulator.go(5)
|
||||
|
||||
@@ -173,10 +173,10 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
self.simulator.go(20)
|
||||
|
||||
# Step 17
|
||||
# Disabling R-Bit security_policy = [3600, 0b11011000]
|
||||
# Disabling R-Bit security_policy = [3600, 0b11010000]
|
||||
self.nodes[COMMISSIONER_1].send_mgmt_active_set(
|
||||
active_timestamp=30,
|
||||
security_policy=[3600, 'oncb'],
|
||||
security_policy=[3600, 'onc'],
|
||||
)
|
||||
self.simulator.go(5)
|
||||
|
||||
@@ -209,7 +209,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
# 2.04 Changed
|
||||
# CoAP Payload
|
||||
# Security Policy TLV
|
||||
# Bits “O”,”N”,”R”,”C”,”B” should be set to 1
|
||||
# Bits “O”,”N”,”R”,”C” should be set to 1
|
||||
pkts.filter_wpan_src64(LEADER).\
|
||||
filter_ipv6_dst(COMMISSIONER_1_RLOC).\
|
||||
filter_coap_ack(MGMT_ACTIVE_GET_URI).\
|
||||
@@ -217,9 +217,8 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
p.thread_meshcop.tlv.sec_policy_o == 1 and
|
||||
p.thread_meshcop.tlv.sec_policy_n == 1 and
|
||||
p.thread_meshcop.tlv.sec_policy_r == 1 and
|
||||
p.thread_meshcop.tlv.sec_policy_c == 1 and
|
||||
p.thread_meshcop.tlv.sec_policy_b == 1) or
|
||||
(p.thread_meshcop.tlv.unknown == '0e10ff')).\
|
||||
p.thread_meshcop.tlv.sec_policy_c == 1) or
|
||||
(p.thread_meshcop.tlv.unknown == '0e10f7')).\
|
||||
must_next()
|
||||
|
||||
# Step 5: Commissioner_1 sends MGMT_ACTIVE_SET.req to Leader
|
||||
@@ -239,7 +238,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
} == set(p.thread_meshcop.tlv.type) and\
|
||||
p.thread_meshcop.tlv.active_tstamp == 15 and\
|
||||
(p.thread_meshcop.tlv.sec_policy_o == 0 or
|
||||
p.thread_meshcop.tlv.unknown == '0e107f')).\
|
||||
p.thread_meshcop.tlv.unknown == '0e1077')).\
|
||||
must_next()
|
||||
|
||||
# Step 6: Leader MUST send MGMT_ACTIVE_SET.rsp to the Commissioner_1
|
||||
@@ -292,7 +291,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
} == set(p.thread_meshcop.tlv.type) and\
|
||||
p.thread_meshcop.tlv.active_tstamp == 20 and\
|
||||
(p.thread_meshcop.tlv.sec_policy_n == 0 or
|
||||
p.thread_meshcop.tlv.unknown == '0e10bf')).\
|
||||
p.thread_meshcop.tlv.unknown == '0e10b7')).\
|
||||
must_next()
|
||||
|
||||
# Step 10: Leader MUST send MGMT_ACTIVE_SET.rsp to the Commissioner_1
|
||||
@@ -376,7 +375,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
} == set(p.thread_meshcop.tlv.type) and\
|
||||
p.thread_meshcop.tlv.active_tstamp == 30 and\
|
||||
(p.thread_meshcop.tlv.sec_policy_r == 0 or
|
||||
p.thread_meshcop.tlv.unknown == '0e10df')).\
|
||||
p.thread_meshcop.tlv.unknown == '0e10d7')).\
|
||||
must_next()
|
||||
|
||||
# Step 18: Leader MUST send MGMT_ACTIVE_SET.rsp to the Commissioner_1
|
||||
@@ -407,7 +406,7 @@ class Cert_5_8_04_SecurityPolicyTLV(thread_cert.TestCase):
|
||||
filter(lambda p:
|
||||
p.mle.tlv.active_tstamp == 30 and\
|
||||
(p.thread_meshcop.tlv.sec_policy_r == 0 or
|
||||
p.thread_meshcop.tlv.unknown == '0e10df')).\
|
||||
p.thread_meshcop.tlv.unknown == '0e10d7')).\
|
||||
must_next()
|
||||
|
||||
|
||||
|
||||
@@ -2085,15 +2085,11 @@ class NodeImpl:
|
||||
if result == 1:
|
||||
networks = []
|
||||
for line in self._expect_command_output()[2:]:
|
||||
_, J, networkname, extpanid, panid, extaddr, channel, dbm, lqi, _ = map(str.strip, line.split('|'))
|
||||
J = bool(int(J))
|
||||
_, panid, extaddr, channel, dbm, lqi, _ = map(str.strip, line.split('|'))
|
||||
panid = int(panid, 16)
|
||||
channel, dbm, lqi = map(int, (channel, dbm, lqi))
|
||||
|
||||
networks.append({
|
||||
'joinable': J,
|
||||
'networkname': networkname,
|
||||
'extpanid': extpanid,
|
||||
'panid': panid,
|
||||
'extaddr': extaddr,
|
||||
'channel': channel,
|
||||
|
||||
@@ -70,8 +70,6 @@ class Test_MacScan(thread_cert.TestCase):
|
||||
self.assertEqual(len(results), 1)
|
||||
network = results[0]
|
||||
self.assertEqual(network['extaddr'], self.nodes[ROUTER].get_addr64())
|
||||
self.assertEqual(network['extpanid'], self.nodes[ROUTER].get_extpanid())
|
||||
self.assertEqual(network['networkname'], self.nodes[ROUTER].get_network_name())
|
||||
self.assertEqual(network['channel'], CHANNEL)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user