mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 03:39:52 +00:00
[test] add code spell check and correct wrong spelling (#9066)
This commit is contained in:
@@ -118,7 +118,7 @@ class Cert_5_3_3_AddressQuery(thread_cert.TestCase):
|
||||
self.assertTrue(self.nodes[MED1].ping(router3_mleid))
|
||||
|
||||
# 3
|
||||
# Wait the finish of address resolution traffic triggerred by previous
|
||||
# Wait the finish of address resolution traffic triggered by previous
|
||||
# ping.
|
||||
self.simulator.go(5)
|
||||
|
||||
@@ -126,7 +126,7 @@ class Cert_5_3_3_AddressQuery(thread_cert.TestCase):
|
||||
self.assertTrue(self.nodes[ROUTER1].ping(med1_mleid))
|
||||
|
||||
# 4
|
||||
# Wait the finish of address resolution traffic triggerred by previous
|
||||
# Wait the finish of address resolution traffic triggered by previous
|
||||
# ping.
|
||||
self.simulator.go(5)
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ class Cert_5_3_09_AddressQuery(thread_cert.TestCase):
|
||||
self.assertTrue(self.nodes[SED1].ping(router3_addr))
|
||||
self.simulator.go(1)
|
||||
|
||||
# 6 DUT_ROUTER2: Power off ROUTER3 and wait 580s to alow LEADER to
|
||||
# 6 DUT_ROUTER2: Power off ROUTER3 and wait 580s to allow LEADER to
|
||||
# expire its Router ID
|
||||
self.nodes[ROUTER3].stop()
|
||||
self.simulator.go(580)
|
||||
@@ -233,7 +233,7 @@ class Cert_5_3_09_AddressQuery(thread_cert.TestCase):
|
||||
must_next()
|
||||
|
||||
# Step 3: Router_1 sends an ICMPv6 Echo Request to SED using GUA 2001::
|
||||
# addresss
|
||||
# address
|
||||
# The DUT MUST respond to the Address Query Request with a properly
|
||||
# formatted Address Notification Message:
|
||||
# CoAP URI-Path
|
||||
|
||||
@@ -239,7 +239,7 @@ class Cert_5_3_10_AddressQuery(thread_cert.TestCase):
|
||||
must_next()
|
||||
|
||||
# Step 4: Border Router sends an ICMPv6 Echo Request to MED using GUA 2003::
|
||||
# addresss
|
||||
# address
|
||||
# The DUT MUST respond to the Address Query Request with a properly
|
||||
# formatted Address Notification Message:
|
||||
# CoAP URI-Path
|
||||
|
||||
@@ -175,7 +175,7 @@ class Cert_5_7_03_CoapDiagCommands_Base(thread_cert.TestCase):
|
||||
# TLV Type 8 – IPv6 address list
|
||||
# TLV Type 17 – Channel Pagesi
|
||||
#
|
||||
# if DUT is Router, contianing the following as well:
|
||||
# if DUT is Router, containing the following as well:
|
||||
# TLV Type 4 – Connectivity
|
||||
# TLV Type 5 – Route64
|
||||
# TLV Type 16 – Child Table
|
||||
|
||||
@@ -49,7 +49,7 @@ THREAD_NODE = 4
|
||||
# requires an External Commissioner which is currently not part of Thread
|
||||
# Certification.
|
||||
#
|
||||
# Notes: Due to the packet parsing compatiable issue for supporting Thread 1.2
|
||||
# Notes: Due to the packet parsing compatible issue for supporting Thread 1.2
|
||||
# and 1.1, the security policy values can be fetched only in the unknown
|
||||
# field.
|
||||
#
|
||||
|
||||
@@ -161,7 +161,7 @@ class BBR_5_11_01(thread_cert.TestCase):
|
||||
and ipv6.src.is_link_local
|
||||
""")
|
||||
|
||||
# Commissioner registers MA3 with deafult timeout
|
||||
# Commissioner registers MA3 with default timeout
|
||||
pkts.filter_wpan_src64(COMMISSIONER).filter_coap_request('/n/mr').must_next().must_verify(f"""
|
||||
thread_meshcop.tlv.ipv6_addr == ['{MA3}']
|
||||
and thread_bl.tlv.timeout is null
|
||||
|
||||
@@ -211,7 +211,7 @@ class TestNdProxy(thread_cert.TestCase):
|
||||
PBBR_ETH = pv.vars['PBBR_ETH']
|
||||
PBBR2_ETH = pv.vars['PBBR2_ETH']
|
||||
|
||||
# Verify that SBBR should not foward any Ping Request to the Thread network.
|
||||
# Verify that SBBR should not forward any Ping Request to the Thread network.
|
||||
# Use `ipv6.hlim == 63` to avoid false fails because SBBR might still forward Ping Request from PBBR to ROUTER1
|
||||
pkts.filter_wpan_src64(SBBR).filter_ping_request().filter('ipv6.hlim == 63').must_not_next()
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class Nat64SingleBorderRouter(thread_cert.TestCase):
|
||||
if ready[0]:
|
||||
return sock.recv(1024)
|
||||
else:
|
||||
raise AssertionError("No data recevied")
|
||||
raise AssertionError("No data received")
|
||||
|
||||
def listen_udp(self, addr, port):
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
|
||||
@@ -33,7 +33,7 @@ import config
|
||||
import thread_cert
|
||||
|
||||
# Test description:
|
||||
# This test verifies bi-directional connectivity accross multiple Thread networks.
|
||||
# This test verifies bi-directional connectivity across multiple Thread networks.
|
||||
#
|
||||
# Topology:
|
||||
# -------------(eth)----------------
|
||||
|
||||
@@ -682,7 +682,7 @@ def check_joiner_router_commissioning_messages(commissioning_messages):
|
||||
|
||||
|
||||
def check_payload_same(tp1, tp2):
|
||||
"""Verfiy two payloads are totally the same.
|
||||
"""Verify two payloads are totally the same.
|
||||
A payload is a tuple of tlvs.
|
||||
"""
|
||||
assert len(tp1) == len(tp2)
|
||||
|
||||
@@ -330,7 +330,7 @@ def create_deafult_network_tlvs_factories():
|
||||
network_layer.TlvType.XTAL_ACCURACY:
|
||||
network_layer.XtalAccuracyFactory(),
|
||||
# Routing information are distributed in a Thread network by MLE Routing TLV
|
||||
# which is in fact MLE Route64 TLV. Thread specificaton v1.1. - Chapter 5.20
|
||||
# which is in fact MLE Route64 TLV. Thread specification v1.1. - Chapter 5.20
|
||||
network_layer.TlvType.MLE_ROUTING:
|
||||
create_default_mle_tlv_route64_factory(),
|
||||
network_layer.TlvType.IPv6_ADDRESSES:
|
||||
|
||||
@@ -622,7 +622,7 @@ class FragmentHeader(ExtensionHeader):
|
||||
| Next Header | Reserved | Fragment Offset | Res | M | Identification |
|
||||
+-------------+----------+-----------------+-----+---+----------------+
|
||||
|
||||
Fragment extention header consists of:
|
||||
Fragment extension header consists of:
|
||||
- next_header type (8 bit)
|
||||
- fragment offset which is multiple of 8 (13 bit)
|
||||
- more_flag to indicate further data (1 bit)
|
||||
@@ -1010,7 +1010,7 @@ class HopByHopFactory(PacketFactory):
|
||||
hdr_ext_len = ord(data.read(1))
|
||||
|
||||
# Note! Two bytes were read (next_header and hdr_ext_len) so they must
|
||||
# be substracted from header length
|
||||
# be subtracted from header length
|
||||
hop_by_hop_length = (self._calculate_extension_header_length(hdr_ext_len) - 2)
|
||||
|
||||
hop_by_hop_data = data.read(hop_by_hop_length)
|
||||
|
||||
@@ -57,7 +57,7 @@ def if_indextoname(index):
|
||||
ifname = ctypes.create_string_buffer(32)
|
||||
ifname = libc.if_indextoname(index, ifname)
|
||||
if not ifname:
|
||||
raise RuntimeError("Inavlid Index")
|
||||
raise RuntimeError("Invalid Index")
|
||||
return ifname
|
||||
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ class LinkQualityAndRouteData(object):
|
||||
return (self.output == other.output and self.input == other.input and self.route == other.route)
|
||||
|
||||
def __repr__(self):
|
||||
return "LinkQualityAndRouteData(ouput={}, input={}, route={})".format(self.output, self.input, self.route)
|
||||
return "LinkQualityAndRouteData(output={}, input={}, route={})".format(self.output, self.input, self.route)
|
||||
|
||||
|
||||
class LinkQualityAndRouteDataFactory:
|
||||
|
||||
@@ -3173,7 +3173,7 @@ class NodeImpl:
|
||||
def _parse_linkmetrics_query_result(self, lines):
|
||||
"""Parse link metrics query result"""
|
||||
|
||||
# Exmaple of command output:
|
||||
# Example of command output:
|
||||
# ['Received Link Metrics Report from: fe80:0:0:0:146e:a00:0:1',
|
||||
# '- PDU Counter: 1 (Count/Summation)',
|
||||
# '- LQI: 0 (Exponential Moving Average)',
|
||||
|
||||
@@ -140,11 +140,11 @@ def which_mergecap() -> str:
|
||||
|
||||
|
||||
def colon_hex(hexstr, interval) -> str:
|
||||
""" Convert hexstr to colon seperated string every interval
|
||||
""" Convert hexstr to colon separated string every interval
|
||||
|
||||
:param hexstr: The hex string to convert.
|
||||
:param interval: The interval number.
|
||||
:return: The colon seperated string.
|
||||
:return: The colon separated string.
|
||||
"""
|
||||
assert len(hexstr) % interval == 0
|
||||
return ':'.join(hexstr[i:i + interval] for i in range(0, len(hexstr), interval))
|
||||
|
||||
@@ -137,7 +137,7 @@ class TestDomainUnicastAddress(thread_cert.TestCase):
|
||||
|
||||
def __check_dua_registration(self, node, iid, dp_cid):
|
||||
''' Check whether or not the specified Domain Unicast Address is registered in Address
|
||||
Registraion TLV.
|
||||
Registration TLV.
|
||||
|
||||
Args:
|
||||
node (int) : The device id
|
||||
|
||||
@@ -165,13 +165,13 @@ class TestDomainUnicastAddressRegistration(thread_cert.TestCase):
|
||||
'''
|
||||
return ''.join(ipaddress.ip_address(address).exploded.split(':')[4:])
|
||||
|
||||
def __check_dua_registration_tmf(self, node, occurences=1, ml_eid=None):
|
||||
def __check_dua_registration_tmf(self, node, occurrences=1, ml_eid=None):
|
||||
|
||||
messages = self.simulator.get_messages_sent_by(node)
|
||||
for i in range(occurences):
|
||||
for i in range(occurrences):
|
||||
msg = messages.next_coap_message('0.02', '/n/dr', False)
|
||||
assert msg, 'Expected {}, but {}th not found\n node: {}(extaddr: {})'.format(
|
||||
occurences, i + 1, node, self.nodes[node].get_addr64())
|
||||
occurrences, i + 1, node, self.nodes[node].get_addr64())
|
||||
if ml_eid:
|
||||
ml_eid_tlv = msg.get_coap_message_tlv(network_layer.MlEid)
|
||||
self.assertEqual(ml_eid, ml_eid_tlv.ml_eid.hex())
|
||||
|
||||
@@ -891,7 +891,7 @@ class TestMulticastListenerRegistration(thread_cert.TestCase):
|
||||
self.simulator.go(WAIT_REDUNDANCE)
|
||||
self.__check_send_mlr_req(parent_id, MA1, should_send=True, expect_mlr_rsp=True)
|
||||
|
||||
# Parent should not register MA1 of Child 1 because it's already registerd
|
||||
# Parent should not register MA1 of Child 1 because it's already registered
|
||||
self.flush_all()
|
||||
self.nodes[meds[0]].add_ipmaddr(MA1)
|
||||
self.simulator.go(PARENT_AGGREGATE_DELAY + WAIT_REDUNDANCE)
|
||||
|
||||
@@ -144,7 +144,7 @@ class TestMulticastRegistration(thread_cert.TestCase):
|
||||
in_address_registration=True):
|
||||
''' Check whether or not the addition of the multicast address on the specific node
|
||||
would trigger Child Update Request for multicast address registration via Address
|
||||
Registraion TLV.
|
||||
Registration TLV.
|
||||
|
||||
Args:
|
||||
node (int) : The device id
|
||||
|
||||
Reference in New Issue
Block a user