Lines Matching +full:channel +full:- +full:manager +full:- +full:csl
82 … self._socat_proc = subprocess.Popen(['socat', '-d', '-d', 'pty,raw,echo=0', 'pty,raw,echo=0'],
103 # We expect ot-rcp not to quit in 1 second.
106 raise Exception(f"ot-rcp {nodeid} exited unexpectedly!")
108 def _get_ot_rcp_path(self) -> str:
110 path = '%s/examples/apps/ncp/ot-rcp' % srcdir
111 logging.info("ot-rcp path: %s", path)
116 subprocess.check_call(f"docker rm -f {self._docker_name} || true", shell=True)
118 dns = ['--dns=127.0.0.1'] if INFRA_DNS64 == 1 else ['--dns=8.8.8.8']
119 nat64_prefix = ['--nat64-prefix', '2001:db8:1:ffff::/96'] if INFRA_DNS64 == 1 else []
123 '--rm',
124 '--name',
126 '--network',
129 '-i',
130 '--sysctl',
132 '--privileged',
133 '--cap-add=NET_ADMIN',
134 '--volume',
136 '-v',
139 '-B',
141 '--trel-url',
155 … subprocess.check_call(f'docker exec -i {self._docker_name} ot-ctl state', shell=True)
171 self.bash('service otbr-agent start')
177 self.bash('service otbr-agent stop')
180 … self.bash('service avahi-daemon stop; service mdns stop; !(cat /proc/net/udp | grep -i :14E9)')
183 … self.bash('service avahi-daemon start; service mdns start; cat /proc/net/udp | grep -i :14E9')
186 cmd = f'docker exec -i {self._docker_name} ot-ctl'
199 timeout -= 0.1
207 self.bash(f'socat -u UDP6-LISTEN:{port},bindtodevice=wpan0 - &')
223 unique_node_id = f'{test_name}-{PORT_OFFSET}-{self.nodeid}'
226 self.bash('service otbr-agent stop')
228 cov_file_path = f'/tmp/coverage/coverage-{unique_node_id}.info'
231 codecov_cmd = f'lcov --directory . --capture --output-file {cov_file_path}'
233 … codecov_cmd = ('lcov --directory build/otbr/third_party/openthread/repo --capture '
234 f'--output-file {cov_file_path}')
241 … f'docker cp {self._docker_name}:/usr/sbin/otbr-agent ./otbr-agent_{unique_node_id}', shell=True)
244 subprocess.check_call(f"docker rm -f {self._docker_name}", shell=True)
261 def bash(self, cmd: str, encoding='ascii') -> List[str]:
263 proc = subprocess.Popen(['docker', 'exec', '-i', self._docker_name, 'bash', '-c', cmd],
317 output = self.bash(f'dig -6 @{server} \'{name}\' {qtype}', encoding='raw_unicode_escape')
329 if line.startswith(';; ->>HEADER<<- '):
330 headers = line[len(';; ->>HEADER<<- '):].split(', ')
379 …self.bash(f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/call_dbus_method.py…
526 … value = [new_counters[key][0] - old_counters[key][0], new_counters[key][1] - old_counters[key][1]]
535 def __unescape_dns_instance_name(name: str) -> str:
585 self._cmd_prefix = '/usr/bin/env GCOV_PREFIX=%s/ot-run/%s/ot-gcda.%d ' % (os.getenv(
599 elif self.node_type == 'ncp-sim':
600 # TODO use mode after ncp-mtd is available.
614 cmd = './ot-cli-%s' % (mode)
616 # For Thread 1.2 MTD node, use ot-cli-mtd build regardless of OT_CLI_PATH
619 cmd = '%s/examples/apps/cli/ot-cli-%s %d' % (srcdir, mode, nodeid)
630 cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
638 cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
641 …cmd += ' --real-time-signal=+1 -v spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVIC…
654 cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
657 cmd += ' --real-time-signal=+1 -v spinel+hdlc+uart://%s?forkpty-arg=%d' % (
675 timeout -= 0.1
681 cmd = 'spinel-cli.py -p ./ot-ncp-%s -n' % mode
686 …args = ' --real-time-signal=+1 spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVICE'],
696 cmd = 'spinel-cli.py -p "%s%s" -n' % (
702 cmd = '%s/examples/apps/ncp/ot-ncp-%s' % (srcdir, mode)
703 cmd = 'spinel-cli.py -p "%s%s" -n' % (
711 cmd = 'spinel-cli.py -p "%s%s" -n' % (
717 cmd = '%s/examples/apps/ncp/ot-ncp-%s' % (srcdir, mode)
718 cmd = 'spinel-cli.py -p "%s%s" -n' % (
726 …args = ' --real-time-signal=+1 spinel+hdlc+uart://%s?forkpty-arg=%d' % (os.environ['RADIO_DEVICE_1…
733 cmd = 'spinel-cli.py -p "%s%s" -n' % (
739 cmd = '%s/examples/apps/ncp/ot-ncp-%s' % (srcdir, mode)
740 cmd = 'spinel-cli.py -p "%s%s" -n' % (
752 self._expect('spinel-cli >')
756 """ Initialize a System-on-a-chip node connected via UART. """
759 serialPort = '/dev/ttyUSB%d' % ((nodeid - 1) * 2)
792 def _expect(self, pattern, timeout=-1, *args, **kwargs):
794 if timeout == -1:
803 timeout -= 0.1
808 def _expect_done(self, timeout=-1):
873 def __is_logging_line(self, line: str) -> bool:
874 return len(line) >= 3 and line[:3] in {'[D]', '[I]', '[N]', '[W]', '[C]', '[-]'}
876 def read_cert_messages_in_commissioning_log(self, timeout=-1):
879 format_str = br"=+?\[\[THCI\].*?type=%s.*?\].*?=+?[\s\S]+?-{40,}"
914 hex_pattern = br"\|(\s([0-9a-fA-F]{2}|\.\.))+?\s+?\|"
919 … data = [int(hex, 16) for hex in res.group(0)[1:-1].split(b' ') if hex and hex != b'..']
921 log = log[res.end() - 1:]
945 PROMPT = 'spinel-cli > ' if self.node_type == 'ncp-sim' else '> '
1080 def radiofilter_is_enabled(self) -> bool:
1104 def get_rcp_version(self) -> str:
1150 'fullname': 'my-host.default.service.arpa.',
1151 'name': 'my-host',
1184 self.srp_server_get_host("my-host")
1197 'fullname': 'my-service._ipps._tcp.default.service.arpa.',
1198 'instance': 'my-service',
1206 'key-lease': '7200',
1208 'host_fullname': 'my-host.default.service.arpa.',
1209 'host': 'my-host',
1234 # 'subtypes', port', 'priority', 'weight', 'ttl', 'lease', and 'key-lease'
1259 self.srp_server_get_service("my-service", "_ipps._tcp")
1359 txt_record = '-'
1385 def srp_client_get_lease_interval(self) -> int:
1395 def srp_client_get_key_lease_interval(self) -> int:
1405 def srp_client_get_ttl(self) -> int:
1419 def is_trel_enabled(self) -> Union[None, bool]:
1475 """Encodes the TXT entry to the DNS-SD TXT record format as a HEX string.
1478 self._encode_txt_entries(['abc']) -> '03616263'
1479 self._encode_txt_entries(['def=']) -> '046465663d'
1480 self._encode_txt_entries(['xyz=XYZ']) -> '0778797a3d58595a'
1491 'instance': 'my-service',
1514 """Parse anycast locate result as list of ml-eid and rloc16.
1544 def is_primary_backbone_router(self) -> bool:
1552 output = g[0].decode("utf-8")
1557 z = re.search(r'seqno:\s+([0-9]+)', l)
1561 z = re.search(r'delay:\s+([0-9]+)', l)
1565 z = re.search(r'timeout:\s+([0-9]+)', l)
1620 def multicast_listener_list(self) -> Dict[IPv6Address, int]:
1668 assert failed_num == len(lines) - 1
1674 cmd = 'macfilter rss add-lqi %s %s' % (addr, lqi)
1679 cmd = 'macfilter rss add-lqi * %s' % (lqi)
1690 rloc16 = self._expect_result(r'[0-9a-fA-F]{4}')
1699 return self._expect_result('[0-9a-fA-F]{16}')
1710 return self._expect_result('[0-9a-fA-F]{16}')
1718 return self._expect_result('[0-9a-fA-F]{16}')
1730 return self._expect_result('[0-9a-fA-F]{16}')
1733 self.send_command('channel')
1736 def set_channel(self, channel): argument
1737 cmd = 'channel %d' % channel
1743 return self._expect_result('[0-9a-fA-F]{32}')
1778 string (str): UTF-8 input string.
1799 result = self._expect_result('0x[0-9a-fA-F]{4}')
1858 self.send_command('csl')
1862 self.send_command('csl channel %d' % csl_channel)
1866 self.send_command('csl period %d' % csl_period)
1870 self.send_command('csl timeout %d' % csl_timeout)
1891 def get_router_downgrade_threshold(self) -> int:
1900 def get_router_eligible(self) -> bool:
1975 self.send_command('ipaddr' + (' -v' if verbose else ''))
2043 for line in self._expect_results(r'([a-fA-F0-9\:]+) ([a-fA-F0-9]+)'):
2062 def get_child_table(self) -> Dict[int, Dict[str, Any]]:
2070 …# | ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|D|N|Ver|CSL|QMsgCnt|Suprvsn| Extended…
2071 …# +-----+--------+------------+------------+-------+------+-+-+-+---+---+-------+-------+---------…
2102 'csl': bool(int(col('CSL'))),
2109 def __split_table_row(self, row: str) -> List[str]:
2114 fields = [x.strip() for x in fields[1:-1]]
2117 def __get_table_col(self, colname: str, headers: List[str], fields: List[str]) -> str:
2174 def __getDua(self) -> Optional[str]:
2181 def get_ip6_address_by_prefix(self, prefix: Union[str, IPv6Network]) -> List[IPv6Address]:
2260 def get_br_peers(self) -> List[str]:
2268 def get_br_peers_rloc16s(self) -> List[int]:
2277 def get_br_routers(self) -> List[str]:
2279 …# fe80:0:0:0:42:acff:fe14:3 (M:0 O:0 S:1) ms-since-rx:144160 reachable:yes age:00:17:36 (peer BR)
2280 # fe80:0:0:0:42:acff:fe14:2 (M:0 O:0 S:1) ms-since-rx:45179 reachable:yes age:00:17:36
2285 def get_br_routers_ip_addresses(self) -> List[IPv6Address]:
2369 …r'\|\s+([a-f0-9]+)\s+\|\s+(.+)\s+\|\s+(.+)\s+\|\s+(\d+)s\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+…
2600 _, panid, extaddr, channel, dbm, lqi, _ = map(str.strip, line.split('|'))
2602 channel, dbm, lqi = map(int, (channel, dbm, lqi))
2607 'channel': channel,
2618 _, channel, rssi, _ = line.split('|')
2620 'channel': int(channel.strip()),
2628 args = f'-I {interface} {args}'
2639 # ncp-sim doesn't print Done
2640 done = (self.node_type == 'ncp-sim')
2688 channel=None, argument
2711 if channel is not None:
2712 cmd = 'dataset channel %d' % channel
2765 …def set_pending_dataset(self, pendingtimestamp, activetimestamp, panid=None, channel=None, delay=N… argument
2782 if channel is not None:
2783 cmd = 'dataset channel %d' % channel
2799 def start_dataset_updater(self, panid=None, channel=None, security_policy=None, delay=None): argument
2808 if channel is not None:
2809 cmd = 'dataset channel %d' % channel
2841 channel=None, argument
2856 if channel is not None:
2857 cmd += 'channel %d ' % channel
2883 cmd += '-x %s ' % binary
2897 cmd += ' -x '
2912 cmd += ' -x '
2923 channel=None, argument
2939 if channel is not None:
2940 cmd += 'channel %d ' % channel
3035 cmd += ' block-%d' % size
3053 self._expect(r'coap response from ([\da-f:]+)(?: OBS=(\d+))?'
3054 r'(?: with payload: ([\da-f]+))?\b',
3057 source = source.decode('UTF-8')
3064 payload = binascii.a2b_hex(payload).decode('UTF-8')
3081 self._expect(r'coap request from ([\da-f:]+)(?: OBS=(\d+))?'
3082 r'(?: with payload: ([\da-f]+))?\b',
3085 source = source.decode('UTF-8')
3091 payload = binascii.a2b_hex(payload).decode('UTF-8')
3118 self._expect(r'Received ACK in reply to notification from ([\da-f:]+)\b', timeout=timeout)
3120 source = source.decode('UTF-8')
3239 cmd += ' -x %s' % tlvs_binary
3244 cmd = 'commissioner mgmtset -x %s' % tlvs_binary
3262 cmd = 'udp bind %s %s %s' % ("-u" if bind_unspecified else "", local_ipaddr, local_port)
3272 cmd = 'udp send %s %d -s %d ' % (ipaddr, port, bytes)
3316 line = line[1:][:-1]
3369 # '- PDU Counter: 1 (Count/Summation)',
3370 # '- LQI: 0 (Exponential Moving Average)',
3371 # '- Margin: 80 (dB) (Exponential Moving Average)',
3372 # '- RSSI: -20 (dBm) (Exponential Moving Average)']
3378 if line.startswith('- '):
3391 cmd = "linkmetrics config %s %s enhanced-ack" % (mode, dst_addr)
3465 …# example output: "DNS response for host1.default.service.arpa. - fd00:db8:0:0:fd3d:d471:1e8c:b60 …
3467 addrs = dns_resp.strip().split(' - ')[1].split(' ')
3529 def __parse_hex_string(hexstr: str) -> bytes:
3610 'partition-id': '1318093703'
3617 'partition-id': '1318093703'
3627 age, info = entry.split(' -> ')
3648 'rss': '-20',
3674 'tx-success': 'yes',
3715 def get_channel_monitor_info(self) -> Dict:
3718 Dict of channel monitor info, e.g.
3721 'threshold': '-75',
3745 self.send_command('channel monitor')
3756 # channel occupancies
3763 self.send_command(f'channel manager auto {int(enable)}')
3767 self.send_command(f'channel manager autocsl {int(enable)}')
3771 self.send_command(f'channel manager supported {int(channel_mask)}')
3775 self.send_command(f'channel manager favored {int(channel_mask)}')
3779 self.send_command(f'channel manager interval {interval}')
3783 self.send_command(f'channel manager threshold {hex_value}')
3787 self.send_command('channel manager')
3839 # link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
3847 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/mcast6.py {self.ETH_DEV…
3850 …ping_ether(self, ipaddr, num_responses=1, size=None, timeout=5, ttl=None, interface='eth0') -> int:
3852 cmd = f'ping -6 {ipaddr} -I {interface} -c {num_responses} -W {timeout}'
3854 cmd += f' -s {size}'
3857 cmd += f' -t {ttl}'
3890 def _getBackboneGua(self) -> Optional[str]:
3897 def _getInfraUla(self) -> Optional[str]:
3907 def _getInfraGua(self) -> Optional[str]:
3914 def _getInfraLinkLocalAddress(self) -> Optional[str]:
3915 … """ Returns the link-local address autoconfigured on the infra link, which is started with "fe80".
3936 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/udp_send_host.py {ipadd…
3948 self.bash(f'ip -6 neigh list dev {self.ETH_DEV}')
3949 self.bash(f'ip -6 neigh flush nud all nud failed nud noarp dev {self.ETH_DEV}')
3950 …self.bash('ip -6 neigh list nud all dev %s | cut -d " " -f1 | sudo xargs -I{} ip -6 neigh delete {…
3952 self.bash(f'ip -6 neigh list dev {self.ETH_DEV}')
3962 :param txt: a dictionary containing the key-value pairs of the TXT record.
3965 …self.bash(f'avahi-publish -s {instance_name} {service_type} {port} -H {host_name}.local {txt_stri…
3976 self.bash(f'avahi-publish -a {hostname}.local {address} &')
3981 :param name: the service type name in format of '<service-name>.<protocol>'.
3986 self.bash(f'dns-sd -Z {name} local. > /tmp/{name} 2>&1 &')
3988 self.bash('pkill dns-sd')
3994 instances.append(elements[2][:-len('.' + name)])
4001 :param name: the service name in format of '<service-name>.<protocol>'.
4013 self.bash(f'dns-sd -Z {name} local. > {service_data_file} 2>&1 &')
4026 self.bash(f'dns-sd -G v6 {host_name}.local. > {host_name_file} 2>&1 &')
4029 self.bash('pkill dns-sd')
4038 …# 9:38:09.274 Add 23 48 my-host.local. 2001:0000:0000:0000:0000:0000:…
4054 # _ipps._tcp PTR my-service._ipps._tcp
4055 …# my-service._ipps._tcp SRV 0 0 12345 my-host.local. ; Replace with …
4056 # my-service._ipps._tcp TXT ""
4165 node_type = 'otbr-docker'
4176 cmd = f'ip -6 addr add {addr}/64 dev {self.TUN_DEV}'
4180 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/mcast6.py {self.TUN_DEV…
4197 self.bash('service otbr-agent stop')
4209 def get_addrs(self) -> List[str]: