Set of this host's IPv4 addresses (no CIDR), across all interfaces. Used to validate an mtr source ('start point') binding.
()
| 124 | cmd = ['ping', '-n', '-c', str(count), '-w', str(deadline)] |
| 125 | if interface: |
| 126 | if not _valid_iface(interface) or interface not in _list_iface_names(include_virtual=True): |
| 127 | return {'success': False, 'output': '', 'summary': {}, |
| 128 | 'error': f'Unknown interface: {interface}'} |
| 129 | cmd += ['-I', interface] |
| 130 | res = _run(cmd + [target], timeout=deadline + 5) |
| 131 | out = res['out'] or res['err'] |
| 132 | summary = {} |
| 133 | m = re.search(r'(\d+) packets transmitted, (\d+) received.*?([\d.]+)% packet loss', out, re.S) |
| 134 | if m: |
| 135 | summary['transmitted'] = int(m.group(1)) |
| 136 | summary['received'] = int(m.group(2)) |
| 137 | summary['loss_pct'] = float(m.group(3)) |
no test coverage detected