Lines Matching +full:- +full:s

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 - &')
210 logging.info("Destroying %s", self)
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]:
262 logging.info("%s $ %s", self, cmd)
263 proc = subprocess.Popen(['docker', 'exec', '-i', self._docker_name, 'bash', '-c', cmd],
280 logging.info("%s $ %r", self, line.rstrip('\r\n'))
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' % (
663 print("%s" % cmd)
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' % (
746 print("%s" % cmd)
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,}"
882 dummy_format_str = br"\[THCI\].*?type=%s.*?"
903 res = re.search(br"type=\S+", log)
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:]
926 print("%d: %s" % (self.nodeid, cmd))
945 PROMPT = 'spinel-cli > ' if self.node_type == 'ncp-sim' else '> '
963 return self._expect_results(r'\S+')
966 cmd = 'mode %s' % mode
1042 cmd = 'commissioner joiner add %s %s' % (addr, psk)
1047 cmd = 'commissioner provisioningurl %s' % provisioning_url
1052 cmd = 'joiner start %s %s' % (pskd, provisioning_url)
1072 cmd = 'macfilter addr add %s' % addr
1075 cmd += ' %s' % rssi
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'
1499 'instance:\"%s\", name:\"%s\", state:%s, port:%d, priority:%d, weight:%d"'
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]:
1635 for line in self._expect_results("\S+ \d+"):
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)
1694 cmd = 'macfilter addr remove %s' % addr
1700 rloc16 = self._expect_result(r'[0-9a-fA-F]{4}')
1709 return self._expect_result('[0-9a-fA-F]{16}')
1715 self.send_command('extaddr %s' % addr64)
1720 return self._expect_result('[0-9a-fA-F]{16}')
1723 self.send_command('extpanid %s' % extpanid)
1728 return self._expect_result('[0-9a-fA-F]{16}')
1735 self.send_command('prefix meshlocal %s' % mesh_local_prefix)
1740 return self._expect_result('[0-9a-fA-F]{16}')
1753 return self._expect_result('[0-9a-fA-F]{32}')
1756 cmd = 'networkkey %s' % networkkey
1788 string (str): UTF-8 input string.
1795 string = string.replace(char, '\\%s' % char)
1800 return self._expect_result([r'\S+'])
1803 cmd = 'networkname %s' % self._escape_escapable(network_name)
1809 result = self._expect_result('0x[0-9a-fA-F]{4}')
1869 return self._expect_key_value_pairs(r'\S+')
1901 def get_router_downgrade_threshold(self) -> int:
1910 def get_router_eligible(self) -> bool:
1931 cmd = 'state %s' % state
1965 cmd = 'ipaddr add %s' % ipaddr
1970 cmd = 'ipaddr del %s' % ipaddr
1975 cmd = 'ipmaddr add %s' % ipmaddr
1980 cmd = 'ipmaddr del %s' % ipmaddr
1985 self.send_command('ipaddr' + (' -v' if verbose else ''))
1987 return self._expect_results(r'\S+(:\S*)+')
1991 return self._expect_result(r'\S+(:\S*)+')
1995 return self._expect_result(r'\S+(:\S*)+')
1999 return self._expect_result(r'\S+(:\S*)+')
2002 network = ipaddress.ip_network(u'%s' % str(prefix))
2026 return self._expect_results(r'\S+(:\S*)+')
2053 for line in self._expect_results(r'([a-fA-F0-9\:]+) ([a-fA-F0-9]+)'):
2059 cmd = 'service add %s %s %s' % (
2068 cmd = 'service remove %s %s' % (enterpriseNumber, serviceData)
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]:
2245 cmd = 'prefix add %s %s %s' % (prefix, flags, prf)
2250 cmd = 'prefix remove %s' % prefix
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]:
2303 if 'a' in flags and 'o' in flags and 's' in flags and 'D' not in flags:
2379 …r'\|\s+([a-f0-9]+)\s+\|\s+(.+)\s+\|\s+(.+)\s+\|\s+(\d+)s\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+…
2406 … m = re.match(r'\|\s+\|\s+(.+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|', line)
2432 … m = re.match(r'\|\s+(.+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|', line)
2446 m = re.match(r'\|\s+(.+)\s+\|\s+(\d+)\s+\|\s+(\d+)\s+\|', line)
2500 cmd = 'route add %s ' % prefix
2502 cmd += 's'
2505 cmd += ' %s' % prf
2510 cmd = 'route remove %s' % prefix
2538 def netdata_publish_route(self, prefix, flags='s', prf='med'):
2542 def netdata_publish_replace(self, old_prefix, prefix, flags='s', prf='med'):
2551 …self.send_command('networkdiagnostic get %s %s' % (addr, ' '.join([str(t.value) for t in tlv_types…
2562 …self.send_command('networkdiagnostic reset %s %s' % (addr, ' '.join([str(t.value) for t in tlv_typ…
2573 cmd = 'commissioner energy %d %d %d %d %s' % (
2591 cmd = 'commissioner panid %d %d %s' % (panid, mask, ipaddr)
2638 args = f'-I {interface} {args}'
2649 # ncp-sim doesn't print Done
2650 done = (self.node_type == 'ncp-sim')
2654 i = self._expect([r'from (\S+):', r'Done'], timeout=0.1)
2732 cmd = 'dataset extpanid %s' % extended_panid
2737 cmd = 'dataset meshlocalprefix %s' % mesh_local_prefix
2742 cmd = 'dataset networkkey %s' % network_key
2747 cmd = 'dataset networkname %s' % network_name
2757 cmd = 'dataset pskc %s' % pskc
2763 cmd = 'dataset securitypolicy %s %s' % (
2768 cmd += ' %s' % (str(security_policy[2]))
2803 self.send_command('dataset meshlocalprefix %s' % config.MESH_LOCAL_PREFIX.split('/')[0])
2824 cmd = 'dataset securitypolicy %d %s ' % (security_policy[0], security_policy[1])
2839 cmd = 'commissioner announce %d %d %d %s' % (
2873 cmd += 'extpanid %s ' % extended_panid
2879 cmd += 'networkkey %s ' % network_key
2882 cmd += 'localprefix %s ' % mesh_local
2885 cmd += 'networkname %s ' % self._escape_escapable(network_name)
2888 cmd += 'securitypolicy %d %s ' % (security_policy[0], security_policy[1])
2893 cmd += '-x %s ' % binary
2907 cmd += ' -x '
2922 cmd += ' -x '
2956 cmd += 'networkkey %s ' % network_key
2959 cmd += 'localprefix %s ' % mesh_local
2962 cmd += 'networkname %s ' % self._escape_escapable(network_name)
3027 cmd = 'coap %s %s %s' % (method, ipaddr, uri)
3034 cmd += ' %s' % payload
3043 cmd = 'coap %s %s %s' % (method, ipaddr, uri)
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')
3138 cmd = 'coap resource %s' % path
3146 cmd = 'coap resource %s %d' % (path, count)
3154 cmd = 'coap set %s' % content
3182 cmd = 'coaps psk %s %s' % (psk, pskIdentity)
3200 cmd = 'coaps resource %s' % path
3217 cmd = 'coaps connect %s' % ipaddr
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)
3300 self._expect([r'(\d+)((\s\d+)*)'])
3322 print("unexpected line %d: %s" % (i, line))
3326 line = line[1:][:-1]
3329 print("unexpected line %d: %s" % (i, line))
3336 print("unexpected line %d: %s" % (i, line))
3363 cmd = 'linkmetrics request %s %s single %s' % (mode, dst_addr, linkmetrics_flags)
3369 cmd = 'linkmetrics request %s %s forward %d' % (mode, dst_addr, series_id)
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)
3403 cmd = cmd + (" register %s %s" % (metrics_flags, ext_flags))
3415 …cmd = "linkmetrics config %s %s forward %d %s %s" % (mode, dst_addr, series_id, series_flags, metr…
3420 cmd = "linkmetrics probe %s %d %d" % (dst_addr, series_id, length)
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(' ')
3491 ….*Port:(\d+), Priority:(\d+), Weight:(\d+), TTL:(\d+)\s+Host:(.*?)\s+HostAddress:(\S+) TTL:(\d+)\s
3535 raise Exception('dns resolve service failed: %s.%s' % (instance, service))
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',
3757 for line in self._expect_results(r'\S+'):
3758 if re.match(r'.*:\s.*', line):
3798 return self._expect_key_value_pairs(r'\S+')
3843 logging.debug('%s: get_ether_addrs: %r', self, addrs)
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 ""
4108 prefix %s
4111 AdvAutonomous %s;
4135 prefix %s
4173 node_type = 'otbr-docker'
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]: