Lines Matching +full:otbr +full:- +full:agent_

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)
157 … logging.info("OTBR Docker %s on %s Is Ready!", self._docker_name, self.backbone_network)
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'
229 # Upload OTBR code coverage if OTBR_COVERAGE=1, otherwise OpenThread code coverage.
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]:
1485 """Encodes the TXT entry to the DNS-SD TXT record format as a HEX string.
1488 self._encode_txt_entries(['abc']) -> '03616263'
1489 self._encode_txt_entries(['def=']) -> '046465663d'
1490 self._encode_txt_entries(['xyz=XYZ']) -> '0778797a3d58595a'
1501 'instance': 'my-service',
1524 """Parse anycast locate result as list of ml-eid and rloc16.
1554 def is_primary_backbone_router(self) -> bool:
1562 output = g[0].decode("utf-8")
1567 z = re.search(r'seqno:\s+([0-9]+)', l)
1571 z = re.search(r'delay:\s+([0-9]+)', l)
1575 z = re.search(r'timeout:\s+([0-9]+)', l)
1630 def multicast_listener_list(self) -> Dict[IPv6Address, int]:
1678 assert failed_num == len(lines) - 1
1684 cmd = 'macfilter rss add-lqi %s %s' % (addr, lqi)
1689 cmd = 'macfilter rss add-lqi * %s' % (lqi)
1700 rloc16 = self._expect_result(r'[0-9a-fA-F]{4}')
1709 return self._expect_result('[0-9a-fA-F]{16}')
1720 return self._expect_result('[0-9a-fA-F]{16}')
1728 return self._expect_result('[0-9a-fA-F]{16}')
1740 return self._expect_result('[0-9a-fA-F]{16}')
1753 return self._expect_result('[0-9a-fA-F]{32}')
1788 string (str): UTF-8 input string.
1809 result = self._expect_result('0x[0-9a-fA-F]{4}')
1901 def get_router_downgrade_threshold(self) -> int:
1910 def get_router_eligible(self) -> bool:
1985 self.send_command('ipaddr' + (' -v' if verbose else ''))
2053 for line in self._expect_results(r'([a-fA-F0-9\:]+) ([a-fA-F0-9]+)'):
2072 def get_child_table(self) -> Dict[int, Dict[str, Any]]:
2081 …# +-----+--------+------------+------------+-------+------+-+-+-+---+---+-------+-------+---------…
2119 def __split_table_row(self, row: str) -> List[str]:
2124 fields = [x.strip() for x in fields[1:-1]]
2127 def __get_table_col(self, colname: str, headers: List[str], fields: List[str]) -> str:
2184 def __getDua(self) -> Optional[str]:
2191 def get_ip6_address_by_prefix(self, prefix: Union[str, IPv6Network]) -> List[IPv6Address]:
2270 def get_br_peers(self) -> List[str]:
2278 def get_br_peers_rloc16s(self) -> List[int]:
2287 def get_br_routers(self) -> List[str]:
2289 …# 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)
2290 # fe80:0:0:0:42:acff:fe14:2 (M:0 O:0 S:1) ms-since-rx:45179 reachable:yes age:00:17:36
2295 def get_br_routers_ip_addresses(self) -> List[IPv6Address]:
2379 …r'\|\s+([a-f0-9]+)\s+\|\s+(.+)\s+\|\s+(.+)\s+\|\s+(\d+)s\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+…
2638 args = f'-I {interface} {args}'
2649 # ncp-sim doesn't print Done
2650 done = (self.node_type == 'ncp-sim')
2893 cmd += '-x %s ' % binary
2907 cmd += ' -x '
2922 cmd += ' -x '
3045 cmd += ' block-%d' % size
3063 self._expect(r'coap response from ([\da-f:]+)(?: OBS=(\d+))?'
3064 r'(?: with payload: ([\da-f]+))?\b',
3067 source = source.decode('UTF-8')
3074 payload = binascii.a2b_hex(payload).decode('UTF-8')
3091 self._expect(r'coap request from ([\da-f:]+)(?: OBS=(\d+))?'
3092 r'(?: with payload: ([\da-f]+))?\b',
3095 source = source.decode('UTF-8')
3101 payload = binascii.a2b_hex(payload).decode('UTF-8')
3128 self._expect(r'Received ACK in reply to notification from ([\da-f:]+)\b', timeout=timeout)
3130 source = source.decode('UTF-8')
3249 cmd += ' -x %s' % tlvs_binary
3254 cmd = 'commissioner mgmtset -x %s' % tlvs_binary
3272 cmd = 'udp bind %s %s %s' % ("-u" if bind_unspecified else "", local_ipaddr, local_port)
3282 cmd = 'udp send %s %d -s %d ' % (ipaddr, port, bytes)
3326 line = line[1:][:-1]
3379 # '- PDU Counter: 1 (Count/Summation)',
3380 # '- LQI: 0 (Exponential Moving Average)',
3381 # '- Margin: 80 (dB) (Exponential Moving Average)',
3382 # '- RSSI: -20 (dBm) (Exponential Moving Average)']
3388 if line.startswith('- '):
3401 cmd = "linkmetrics config %s %s enhanced-ack" % (mode, dst_addr)
3475 …# example output: "DNS response for host1.default.service.arpa. - fd00:db8:0:0:fd3d:d471:1e8c:b60 …
3477 addrs = dns_resp.strip().split(' - ')[1].split(' ')
3539 def __parse_hex_string(hexstr: str) -> bytes:
3620 'partition-id': '1318093703'
3627 'partition-id': '1318093703'
3637 age, info = entry.split(' -> ')
3658 'rss': '-20',
3684 'tx-success': 'yes',
3725 def get_channel_monitor_info(self) -> Dict:
3731 'threshold': '-75',
3849 # link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
3857 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/mcast6.py {self.ETH_DEV…
3860 …ping_ether(self, ipaddr, num_responses=1, size=None, timeout=5, ttl=None, interface='eth0') -> int:
3862 cmd = f'ping -6 {ipaddr} -I {interface} -c {num_responses} -W {timeout}'
3864 cmd += f' -s {size}'
3867 cmd += f' -t {ttl}'
3900 def _getBackboneGua(self) -> Optional[str]:
3907 def _getInfraUla(self) -> Optional[str]:
3917 def _getInfraGua(self) -> Optional[str]:
3924 def _getInfraLinkLocalAddress(self) -> Optional[str]:
3925 … """ Returns the link-local address autoconfigured on the infra link, which is started with "fe80".
3946 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/udp_send_host.py {ipadd…
3958 self.bash(f'ip -6 neigh list dev {self.ETH_DEV}')
3959 self.bash(f'ip -6 neigh flush nud all nud failed nud noarp dev {self.ETH_DEV}')
3960 …self.bash('ip -6 neigh list nud all dev %s | cut -d " " -f1 | sudo xargs -I{} ip -6 neigh delete {…
3962 self.bash(f'ip -6 neigh list dev {self.ETH_DEV}')
3972 :param txt: a dictionary containing the key-value pairs of the TXT record.
3975 …self.bash(f'avahi-publish -s {instance_name} {service_type} {port} -H {host_name}.local {txt_stri…
3986 self.bash(f'avahi-publish -a {hostname}.local {address} &')
3991 :param name: the service type name in format of '<service-name>.<protocol>'.
3996 self.bash(f'dns-sd -Z {name} local. > /tmp/{name} 2>&1 &')
3998 self.bash('pkill dns-sd')
4004 instances.append(elements[2][:-len('.' + name)])
4011 :param name: the service name in format of '<service-name>.<protocol>'.
4023 self.bash(f'dns-sd -Z {name} local. > {service_data_file} 2>&1 &')
4036 self.bash(f'dns-sd -G v6 {host_name}.local. > {host_name_file} 2>&1 &')
4039 self.bash('pkill dns-sd')
4048 …# 9:38:09.274 Add 23 48 my-host.local. 2001:0000:0000:0000:0000:0000:…
4062 # _ipps._tcp PTR my-service._ipps._tcp
4063 …# my-service._ipps._tcp SRV 0 0 12345 my-host.local. ; Replace with …
4064 # my-service._ipps._tcp TXT ""
4172 is_bbr = True # OTBR is also BBR
4173 node_type = 'otbr-docker'
4176 return f'Otbr<{self.nodeid}>'
4184 cmd = f'ip -6 addr add {addr}/64 dev {self.TUN_DEV}'
4188 …cmd = f'python3 /app/third_party/openthread/repo/tests/scripts/thread-cert/mcast6.py {self.TUN_DEV…
4205 self.bash('service otbr-agent stop')
4217 def get_addrs(self) -> List[str]: