From 604ade791f7bd33b37f64916befba27a2ea08b5b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 17 Jul 2020 15:57:07 -0700 Subject: [PATCH 01/80] add ping parser --- jc/parsers/ping.py | 325 ++++++++++++++++++ .../centos-7.7/ping-hostname-O-D-p-s.out | 26 ++ .../fixtures/centos-7.7/ping-hostname-O-p.out | 26 ++ tests/fixtures/centos-7.7/ping-hostname-O.out | 25 ++ .../centos-7.7/ping6-hostname-O-D-p-s.out | 26 ++ .../centos-7.7/ping6-hostname-O-p.out | 26 ++ tests/fixtures/centos-7.7/ping6-ip-O-D-p.out | 26 ++ tests/fixtures/centos-7.7/ping6-ip-O-p.out | 26 ++ 8 files changed, 506 insertions(+) create mode 100644 jc/parsers/ping.py create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.out create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O-p.out create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O.out create mode 100644 tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out create mode 100644 tests/fixtures/centos-7.7/ping6-hostname-O-p.out create mode 100644 tests/fixtures/centos-7.7/ping6-ip-O-D-p.out create mode 100644 tests/fixtures/centos-7.7/ping6-ip-O-p.out diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py new file mode 100644 index 00000000..13b91e3c --- /dev/null +++ b/jc/parsers/ping.py @@ -0,0 +1,325 @@ +"""jc - JSON CLI output utility ping Parser + +Usage: + + specify --ping as the first argument if the piped input is coming from ping + +Compatibility: + + 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + +Examples: + + $ ping | jc --ping -p + [] + + $ ping | jc --ping -p -r + [] +""" +import string +import jc.utils + + +class info(): + version = '1.0' + description = 'ping command parser' + author = 'Kelly Brazil' + author_email = 'kellyjonbrazil@gmail.com' + # details = 'enter any other details here' + + # compatible options: linux, darwin, cygwin, win32, aix, freebsd + compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] + magic_commands = ['ping', 'ping6'] + + +__version__ = info.version + + +def process(proc_data): + """ + Final processing to conform to the schema. + + Parameters: + + proc_data: (dictionary) raw structured data to process + + Returns: + + List of dictionaries. Structured data with the following schema: + + [ + { + "ping": string, + "bar": boolean, + "baz": integer + } + ] + """ + + # rebuild output for added semantic information + return proc_data + + +def linux_parse(data): + raw_output = {} + ping_responses = [] + pattern = None + footer = False + + linedata = data.splitlines() + + # check for PATTERN + if linedata[0].startswith('PATTERN: '): + pattern = linedata.pop(0).split(': ')[1] + + ipv4 = True if 'bytes of data' in linedata[0] else False + + if ipv4 and linedata[0][5] not in string.digits: + hostname = True + elif ipv4 and linedata[0][5] in string.digits: + hostname = False + elif not ipv4 and ' (' in linedata[0]: + hostname = True + else: + hostname = False + + for line in filter(None, linedata): + if line.startswith('PING '): + if ipv4 and not hostname: + dst_ip, dta_byts = (2, 3) + elif ipv4 and hostname: + dst_ip, dta_byts = (2, 3) + elif not ipv4 and not hostname: + dst_ip, dta_byts = (2, 3) + else: + dst_ip, dta_byts = (3, 4) + + line = line.replace('(', ' ').replace(')', ' ') + raw_output.update( + { + 'destination_ip': line.split()[dst_ip].lstrip('(').rstrip(')'), + 'data_bytes': line.split()[dta_byts], + 'pattern': pattern + } + ) + continue + + if line.startswith('---'): + footer = True + raw_output['destination'] = line.split()[1] + continue + + if footer: + if 'packets transmitted' in line: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[5].rstrip('%'), + 'time_ms': line.split()[9].replace('ms', '') + } + ) + continue + + else: + split_line = line.split(' = ')[1] + split_line = split_line.split('/') + raw_output.update( + { + 'round_trip_ms_min': split_line[0], + 'round_trip_ms_avg': split_line[1], + 'round_trip_ms_max': split_line[2], + 'round_trip_ms_stddev': split_line[3].replace(' ms', '') + } + ) + + # ping response lines + else: + # request timeout + if 'no answer yet for icmp_seq=' in line: + timestamp = False + isequence = 5 + + # if timestamp option is specified, then shift icmp sequence field right by one + if line[0] == '[': + timestamp = True + isequence = 6 + + response = { + 'request_timeout': True, + 'timestamp': line.split()[0].lstrip('[').rstrip(']') if timestamp else None, + 'icmp_seq': line.replace('=', ' ').split()[isequence] + } + ping_responses.append(response) + continue + + # normal responses + else: + hostname = True if '(' in line else False + line = line.replace('(', ' ').replace(')', ' ').replace('=', ' ') + + # positions of items depend on whether ipv4/ipv6 and/or ip/hostname is used + if ipv4 and not hostname: + bts, rip, iseq, t2l, tms = (0, 3, 5, 7, 9) + elif ipv4 and hostname: + bts, rip, iseq, t2l, tms = (0, 4, 7, 9, 11) + elif not ipv4 and not hostname: + bts, rip, iseq, t2l, tms = (0, 3, 5, 7, 9) + elif not ipv4 and hostname: + bts, rip, iseq, t2l, tms = (0, 4, 7, 9, 11) + + # if timestamp option is specified, then shift everything right by one + timestamp = False + if line[0] == '[': + timestamp = True + bts, rip, iseq, t2l, tms = (bts + 1, rip + 1, iseq + 1, t2l + 1, tms + 1) + + response = { + 'request_timeout': False, + 'timestamp': line.split()[0].lstrip('[').rstrip(']') if timestamp else None, + 'bytes': line.split()[bts], + 'response_ip': line.split()[rip].rstrip(':'), + 'icmp_seq': line.split()[iseq], + 'ttl': line.split()[t2l], + 'time_ms': line.split()[tms] + } + ping_responses.append(response) + continue + + raw_output['responses'] = ping_responses + + return raw_output + + +def bsd_parse(data): + raw_output = {} + ping_responses = [] + footer = False + + for line in filter(None, data.splitlines()): + if line.startswith('PING '): + raw_output.update( + { + 'destination_ip': line.split()[2].lstrip('(').rstrip(':').rstrip(')'), + 'data_bytes': line.split()[3] + } + ) + continue + + if line.startswith('PING6('): + line = line.replace('(', ' ').replace(')', ' ').replace('=', ' ') + raw_output.update( + { + 'source_ip': line.split()[4], + 'destination_ip': line.split()[6], + 'data_bytes': line.split()[1] + } + ) + continue + + if line.startswith('---'): + footer = True + raw_output['destination'] = line.split()[1] + continue + + if footer: + if 'packets transmitted' in line: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[6].rstrip('%') + } + ) + continue + + else: + split_line = line.split(' = ')[1] + split_line = split_line.split('/') + raw_output.update( + { + 'round_trip_ms_min': split_line[0], + 'round_trip_ms_avg': split_line[1], + 'round_trip_ms_max': split_line[2], + 'round_trip_ms_stddev': split_line[3].replace(' ms', '') + } + ) + + # ping response lines + else: + # ipv4 lines + if ',' not in line: + + # request timeout + if line.startswith('Request timeout for '): + response = { + 'request_timeout': True, + 'icmp_seq': line.split()[4] + } + ping_responses.append(response) + continue + + # normal response + else: + line = line.replace(':', ' ').replace('=', ' ') + response = { + 'request_timeout': False, + 'bytes': line.split()[0], + 'response_ip': line.split()[3], + 'icmp_seq': line.split()[5], + 'ttl': line.split()[7], + 'time_ms': line.split()[9] + } + ping_responses.append(response) + continue + + # ipv6 lines + else: + line = line.replace(',', ' ').replace('=', ' ') + response = { + 'request_timeout': False, + 'bytes': line.split()[0], + 'response_ip': line.split()[3], + 'icmp_seq': line.split()[5], + 'ttl': line.split()[7], + 'time_ms': line.split()[9] + } + ping_responses.append(response) + continue + + raw_output['responses'] = ping_responses + + return raw_output + + +def parse(data, raw=False, quiet=False): + """ + Main text parsing function + + Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + + Returns: + + List of dictionaries. Raw or processed structured data. + """ + if not quiet: + jc.utils.compatibility(__name__, info.compatible) + + raw_output = {} + + if jc.utils.has_data(data): + + if 'time' in data.splitlines()[-2]: + raw_output = linux_parse(data) + else: + raw_output = bsd_parse(data) + + if raw: + return raw_output + else: + return process(raw_output) + diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.out b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.out new file mode 100644 index 00000000..968ece83 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.189.67) 1400(1428) bytes of data. +[1594978465.914536] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=1 ttl=59 time=31.4 ms +[1594978465.993009] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=2 ttl=59 time=30.3 ms +[1594978467.010196] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=3 ttl=59 time=32.0 ms +[1594978468.033743] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=4 ttl=59 time=38.8 ms +[1594978469.051227] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=5 ttl=59 time=38.0 ms +[1594978470.048764] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=6 ttl=59 time=29.9 ms +[1594978471.051945] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=7 ttl=59 time=28.9 ms +[1594978472.064206] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=8 ttl=59 time=37.4 ms +[1594978473.062587] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=9 ttl=59 time=31.5 ms +[1594978474.074343] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=10 ttl=59 time=38.3 ms +[1594978475.079703] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=11 ttl=59 time=38.8 ms +[1594978476.076383] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=12 ttl=59 time=30.7 ms +[1594978477.084119] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=13 ttl=59 time=30.7 ms +[1594978478.092207] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=14 ttl=59 time=31.6 ms +[1594978479.104358] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=15 ttl=59 time=37.7 ms +[1594978480.106907] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=16 ttl=59 time=37.5 ms +[1594978481.115580] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=17 ttl=59 time=37.3 ms +[1594978482.119872] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=18 ttl=59 time=33.8 ms +[1594978483.131901] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=19 ttl=59 time=37.0 ms +[1594978484.141117] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=20 ttl=59 time=36.9 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19146ms +rtt min/avg/max/mdev = 28.960/34.468/38.892/3.497 ms diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-p.out b/tests/fixtures/centos-7.7/ping-hostname-O-p.out new file mode 100644 index 00000000..ea26b2e3 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.129.67) 56(84) bytes of data. +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=1 ttl=59 time=24.4 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=2 ttl=59 time=23.3 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=3 ttl=59 time=32.6 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=4 ttl=59 time=32.6 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=5 ttl=59 time=26.9 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=6 ttl=59 time=24.1 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=7 ttl=59 time=24.6 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=8 ttl=59 time=33.9 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=9 ttl=59 time=32.7 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=10 ttl=59 time=31.2 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=11 ttl=59 time=25.7 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=12 ttl=59 time=33.8 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=13 ttl=59 time=23.7 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=14 ttl=59 time=23.9 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=15 ttl=59 time=33.6 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=16 ttl=59 time=24.5 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=17 ttl=59 time=30.1 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=18 ttl=59 time=24.1 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=19 ttl=59 time=32.2 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=20 ttl=59 time=31.0 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19233ms +rtt min/avg/max/mdev = 23.359/28.495/33.979/4.081 ms diff --git a/tests/fixtures/centos-7.7/ping-hostname-O.out b/tests/fixtures/centos-7.7/ping-hostname-O.out new file mode 100644 index 00000000..4eab9054 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O.out @@ -0,0 +1,25 @@ +PING turner-tls.map.fastly.net (151.101.189.67) 56(84) bytes of data. +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=1 ttl=59 time=29.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=2 ttl=59 time=30.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=3 ttl=59 time=35.5 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=4 ttl=59 time=35.5 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=5 ttl=59 time=34.9 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=6 ttl=59 time=29.9 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=7 ttl=59 time=27.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=8 ttl=59 time=28.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=9 ttl=59 time=35.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=10 ttl=59 time=34.4 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=11 ttl=59 time=35.9 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=12 ttl=59 time=35.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=13 ttl=59 time=34.4 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=14 ttl=59 time=35.5 ms +no answer yet for icmp_seq=15 +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=16 ttl=59 time=36.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=17 ttl=59 time=34.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=18 ttl=59 time=34.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=19 ttl=59 time=36.7 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=20 ttl=59 time=34.3 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19125ms +rtt min/avg/max/mdev = 27.656/33.717/36.758/2.814 ms diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out new file mode 100644 index 00000000..5303338a --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2d::323 (2a04:4e42:2d::323)) 1400 data bytes +[1594978345.609669] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=1 ttl=59 time=32.4 ms +[1594978346.585420] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=2 ttl=59 time=39.9 ms +[1594978347.594128] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=3 ttl=59 time=42.3 ms +[1594978348.595221] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=4 ttl=59 time=40.2 ms +[1594978349.600372] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=5 ttl=59 time=43.2 ms +[1594978350.590676] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=6 ttl=59 time=31.8 ms +[1594978351.601527] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=7 ttl=59 time=41.8 ms +[1594978352.604195] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=8 ttl=59 time=41.7 ms +[1594978353.607212] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=9 ttl=59 time=42.0 ms +[1594978354.610771] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=10 ttl=59 time=40.7 ms +[1594978355.613729] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=11 ttl=59 time=40.4 ms +[1594978356.611887] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=12 ttl=59 time=32.6 ms +[1594978357.624810] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=13 ttl=59 time=40.1 ms +[1594978358.629185] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=14 ttl=59 time=42.0 ms +[1594978359.634854] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=15 ttl=59 time=41.2 ms +[1594978360.638344] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=16 ttl=59 time=40.6 ms +[1594978361.640968] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=17 ttl=59 time=40.7 ms +[1594978362.645739] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=18 ttl=59 time=39.9 ms +[1594978363.646700] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=19 ttl=59 time=37.5 ms +[1594978364.650853] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=20 ttl=59 time=33.6 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19077ms +rtt min/avg/max/mdev = 31.845/39.274/43.243/3.522 ms diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-p.out b/tests/fixtures/centos-7.7/ping6-hostname-O-p.out new file mode 100644 index 00000000..3fe6163a --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2d::323 (2a04:4e42:2d::323)) 56 data bytes +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=1 ttl=59 time=30.9 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=2 ttl=59 time=39.0 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=3 ttl=59 time=32.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=4 ttl=59 time=38.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=5 ttl=59 time=38.8 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=6 ttl=59 time=42.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=7 ttl=59 time=30.7 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=8 ttl=59 time=39.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=9 ttl=59 time=39.3 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=10 ttl=59 time=38.9 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=11 ttl=59 time=38.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=12 ttl=59 time=38.2 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=13 ttl=59 time=39.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=14 ttl=59 time=37.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=15 ttl=59 time=33.7 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=16 ttl=59 time=39.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=17 ttl=59 time=38.9 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=18 ttl=59 time=41.3 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=19 ttl=59 time=32.2 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=20 ttl=59 time=38.4 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19164ms +rtt min/avg/max/mdev = 30.757/37.455/42.652/3.338 ms diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-D-p.out b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.out new file mode 100644 index 00000000..89f7f619 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +[1594976827.240914] 64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=28.7 ms +[1594976828.254930] 64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=37.2 ms +[1594976829.252877] 64 bytes from 2a04:4e42:600::323: icmp_seq=3 ttl=59 time=29.7 ms +[1594976830.262654] 64 bytes from 2a04:4e42:600::323: icmp_seq=4 ttl=59 time=37.7 ms +[1594976831.265626] 64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=34.8 ms +[1594976832.269834] 64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=35.6 ms +[1594976833.268059] 64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=28.4 ms +[1594976834.274292] 64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=28.1 ms +[1594976835.287123] 64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=34.9 ms +[1594976836.287707] 64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=34.4 ms +[1594976837.290589] 64 bytes from 2a04:4e42:600::323: icmp_seq=11 ttl=59 time=35.2 ms +[1594976838.293514] 64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=35.4 ms +[1594976839.290914] 64 bytes from 2a04:4e42:600::323: icmp_seq=13 ttl=59 time=29.8 ms +[1594976840.292897] 64 bytes from 2a04:4e42:600::323: icmp_seq=14 ttl=59 time=28.5 ms +[1594976842.269238] no answer yet for icmp_seq=15 +[1594976842.301450] 64 bytes from 2a04:4e42:600::323: icmp_seq=16 ttl=59 time=31.8 ms +[1594976843.312998] 64 bytes from 2a04:4e42:600::323: icmp_seq=17 ttl=59 time=39.8 ms +[1594976844.314228] 64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=35.7 ms +[1594976845.315518] 64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=35.1 ms +[1594976846.321706] 64 bytes from 2a04:4e42:600::323: icmp_seq=20 ttl=59 time=35.4 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19074ms +rtt min/avg/max/mdev = 28.150/33.534/39.843/3.489 ms diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-p.out b/tests/fixtures/centos-7.7/ping6-ip-O-p.out new file mode 100644 index 00000000..934ff078 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=27.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=28.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=3 ttl=59 time=36.0 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=4 ttl=59 time=28.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=35.8 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=34.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=30.7 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=28.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=36.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=36.3 ms +no answer yet for icmp_seq=11 +64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=37.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=13 ttl=59 time=30.7 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=14 ttl=59 time=36.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=15 ttl=59 time=35.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=16 ttl=59 time=36.3 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=17 ttl=59 time=37.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=36.2 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=27.0 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=20 ttl=59 time=38.1 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19067ms +rtt min/avg/max/mdev = 27.064/33.626/38.146/3.803 ms From cc60f3674822c644933f286a0364b09d7e2a60b3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 18 Jul 2020 12:35:46 -0700 Subject: [PATCH 02/80] add ping parser --- docgen.sh | 1 + docs/parsers/ping.md | 64 ++++++++++++++++++++++++++++++++++++++++++++ jc/cli.py | 3 ++- 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 docs/parsers/ping.md diff --git a/docgen.sh b/docgen.sh index f7ab0bab..78ed7beb 100755 --- a/docgen.sh +++ b/docgen.sh @@ -37,6 +37,7 @@ pydocmd simple jc.parsers.mount+ > ../docs/parsers/mount.md pydocmd simple jc.parsers.netstat+ > ../docs/parsers/netstat.md pydocmd simple jc.parsers.ntpq+ > ../docs/parsers/ntpq.md pydocmd simple jc.parsers.passwd+ > ../docs/parsers/passwd.md +pydocmd simple jc.parsers.ping+ > ../docs/parsers/ping.md pydocmd simple jc.parsers.pip_list+ > ../docs/parsers/pip_list.md pydocmd simple jc.parsers.pip_show+ > ../docs/parsers/pip_show.md pydocmd simple jc.parsers.ps+ > ../docs/parsers/ps.md diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md new file mode 100644 index 00000000..fe15ae1c --- /dev/null +++ b/docs/parsers/ping.md @@ -0,0 +1,64 @@ +# jc.parsers.ping +jc - JSON CLI output utility ping Parser + +Usage: + + specify --ping as the first argument if the piped input is coming from ping + +Compatibility: + + 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + +Examples: + + $ ping | jc --ping -p + [] + + $ ping | jc --ping -p -r + [] + +## info +```python +info(self, /, *args, **kwargs) +``` + +## process +```python +process(proc_data) +``` + +Final processing to conform to the schema. + +Parameters: + + proc_data: (dictionary) raw structured data to process + +Returns: + + List of dictionaries. Structured data with the following schema: + + [ + { + "ping": string, + "bar": boolean, + "baz": integer + } + ] + +## parse +```python +parse(data, raw=False, quiet=False) +``` + +Main text parsing function + +Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + +Returns: + + List of dictionaries. Raw or processed structured data. + diff --git a/jc/cli.py b/jc/cli.py index aedc17c4..1acd599e 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -21,7 +21,7 @@ import jc.appdirs as appdirs class info(): - version = '1.12.1' + version = '1.13.0' description = 'JSON conversion tool for CLI output' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -63,6 +63,7 @@ parsers = [ 'netstat', 'ntpq', 'passwd', + 'ping', 'pip-list', 'pip-show', 'ps', From f9eb18b9271b2428dd82f2dc26d3fa0435dad81d Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 12:56:34 -0700 Subject: [PATCH 03/80] change 'request_timeout' field to 'type', fix compatibility, other formatting fixes --- jc/parsers/ping.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 13b91e3c..7f0d2275 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -6,7 +6,7 @@ Usage: Compatibility: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + 'linux', 'darwin', 'cygwin', 'freebsd' Examples: @@ -28,7 +28,7 @@ class info(): # details = 'enter any other details here' # compatible options: linux, darwin, cygwin, win32, aix, freebsd - compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] + compatible = ['linux', 'darwin', 'cygwin', 'freebsd'] magic_commands = ['ping', 'ping6'] @@ -146,7 +146,7 @@ def linux_parse(data): isequence = 6 response = { - 'request_timeout': True, + 'type': 'timeout', 'timestamp': line.split()[0].lstrip('[').rstrip(']') if timestamp else None, 'icmp_seq': line.replace('=', ' ').split()[isequence] } @@ -155,7 +155,7 @@ def linux_parse(data): # normal responses else: - hostname = True if '(' in line else False + line = line.replace('(', ' ').replace(')', ' ').replace('=', ' ') # positions of items depend on whether ipv4/ipv6 and/or ip/hostname is used @@ -175,7 +175,7 @@ def linux_parse(data): bts, rip, iseq, t2l, tms = (bts + 1, rip + 1, iseq + 1, t2l + 1, tms + 1) response = { - 'request_timeout': False, + 'type': 'reply', 'timestamp': line.split()[0].lstrip('[').rstrip(']') if timestamp else None, 'bytes': line.split()[bts], 'response_ip': line.split()[rip].rstrip(':'), @@ -253,7 +253,7 @@ def bsd_parse(data): # request timeout if line.startswith('Request timeout for '): response = { - 'request_timeout': True, + 'type': 'timeout', 'icmp_seq': line.split()[4] } ping_responses.append(response) @@ -263,7 +263,7 @@ def bsd_parse(data): else: line = line.replace(':', ' ').replace('=', ' ') response = { - 'request_timeout': False, + 'type': 'reply', 'bytes': line.split()[0], 'response_ip': line.split()[3], 'icmp_seq': line.split()[5], @@ -277,7 +277,7 @@ def bsd_parse(data): else: line = line.replace(',', ' ').replace('=', ' ') response = { - 'request_timeout': False, + 'type': 'reply', 'bytes': line.split()[0], 'response_ip': line.split()[3], 'icmp_seq': line.split()[5], @@ -322,4 +322,3 @@ def parse(data, raw=False, quiet=False): return raw_output else: return process(raw_output) - From fe36f5a98cd3ee7753e250b6553e4453d971f929 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 12:56:53 -0700 Subject: [PATCH 04/80] add fixtures for ping --- tests/fixtures/centos-7.7/ping-ip-O-D.out | 25 ++++++++++++++++++ tests/fixtures/centos-7.7/ping-ip-O.out | 25 ++++++++++++++++++ tests/fixtures/create_fixtures.sh | 12 +++++++++ .../ubuntu-18.04/ping-hostname-O-D-p-s.out | 26 +++++++++++++++++++ .../ubuntu-18.04/ping-hostname-O-p.out | 26 +++++++++++++++++++ .../fixtures/ubuntu-18.04/ping-hostname-O.out | 25 ++++++++++++++++++ tests/fixtures/ubuntu-18.04/ping-ip-O-D.out | 25 ++++++++++++++++++ tests/fixtures/ubuntu-18.04/ping-ip-O.out | 25 ++++++++++++++++++ .../ubuntu-18.04/ping6-hostname-O-D-p-s.out | 26 +++++++++++++++++++ .../ubuntu-18.04/ping6-hostname-O-D-p.out | 26 +++++++++++++++++++ .../ubuntu-18.04/ping6-hostname-O-p.out | 26 +++++++++++++++++++ .../fixtures/ubuntu-18.04/ping6-ip-O-D-p.out | 26 +++++++++++++++++++ tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out | 25 ++++++++++++++++++ 13 files changed, 318 insertions(+) create mode 100644 tests/fixtures/centos-7.7/ping-ip-O-D.out create mode 100644 tests/fixtures/centos-7.7/ping-ip-O.out create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.out create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O-p.out create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O.out create mode 100644 tests/fixtures/ubuntu-18.04/ping-ip-O-D.out create mode 100644 tests/fixtures/ubuntu-18.04/ping-ip-O.out create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.out create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.out create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.out create mode 100644 tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.out create mode 100644 tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out diff --git a/tests/fixtures/centos-7.7/ping-ip-O-D.out b/tests/fixtures/centos-7.7/ping-ip-O-D.out new file mode 100644 index 00000000..d09e205e --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-O-D.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +[1595037214.261953] 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.041 ms +[1595037215.264798] 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.048 ms +[1595037216.272296] 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.047 ms +[1595037217.275851] 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.062 ms +[1595037218.284242] 64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.045 ms +[1595037219.283712] 64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.043 ms +[1595037220.290949] 64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.046 ms +[1595037221.295962] 64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.044 ms +[1595037222.307020] 64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.048 ms +[1595037223.313919] 64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.081 ms +[1595037224.313679] 64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.043 ms +[1595037225.320748] 64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.044 ms +[1595037226.324322] 64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.045 ms +[1595037227.325835] 64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.046 ms +[1595037228.327028] 64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.046 ms +[1595037229.329891] 64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.052 ms +[1595037230.333891] 64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.044 ms +[1595037231.338137] 64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.046 ms +[1595037232.340475] 64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.048 ms +[1595037233.343058] 64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.045 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19081ms +rtt min/avg/max/mdev = 0.041/0.048/0.081/0.009 ms diff --git a/tests/fixtures/centos-7.7/ping-ip-O.out b/tests/fixtures/centos-7.7/ping-ip-O.out new file mode 100644 index 00000000..18d63afd --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-O.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.038 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.044 ms +64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.052 ms +64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.080 ms +64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.047 ms +64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.040 ms +64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.052 ms +64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.044 ms +64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.045 ms +64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.062 ms +64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.046 ms +64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.046 ms +64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.045 ms +64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.044 ms +64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.044 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19070ms +rtt min/avg/max/mdev = 0.038/0.047/0.080/0.011 ms diff --git a/tests/fixtures/create_fixtures.sh b/tests/fixtures/create_fixtures.sh index 3b79b265..a07bcf15 100644 --- a/tests/fixtures/create_fixtures.sh +++ b/tests/fixtures/create_fixtures.sh @@ -101,3 +101,15 @@ sudo lastb > lastb.out cat /etc/group > group.out sudo cat /etc/gshadow > gshadow.out + +ping -4 www.cnn.com -c 20 -O > ping-hostname-O.out +ping -4 www.cnn.com -c 20 -O -p abcd > ping-hostname-O-p.out +ping -4 www.cnn.com -c 20 -O -D -p abcd -s 1400 > ping-hostname-O-D-p-s.out +ping 127.0.0.1 -c 20 -O > ping-ip-O.out +ping 127.0.0.1 -c 20 -O -D > ping-ip-O-D.out +ping6 2a04:4e42:600::323 -c 20 -O -p abcd > ping6-ip-O-p.out +ping6 2a04:4e42:600::323 -c 20 -O -D -p abcd > ping6-ip-O-D-p.out +ping6 www.cnn.com -c 20 -O -D -p abcd -s 1400 > ping6-hostname-O-D-p-s.out +ping6 www.cnn.com -c 20 -O -D -p abcd > ping6-hostname-O-D-p.out +ping6 www.cnn.com -c 20 -O -p abcd > ping6-hostname-O-p.out + diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.out b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.out new file mode 100644 index 00000000..57b2d09e --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.189.67) 1400(1428) bytes of data. +[1595103464.996693] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=1 ttl=59 time=26.7 ms +[1595103466.001289] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=2 ttl=59 time=28.5 ms +[1595103467.004316] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=3 ttl=59 time=28.8 ms +[1595103468.009966] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=4 ttl=59 time=33.2 ms +[1595103469.013655] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=5 ttl=59 time=34.4 ms +[1595103470.014253] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=6 ttl=59 time=34.2 ms +[1595103471.026530] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=7 ttl=59 time=44.1 ms +[1595103472.019493] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=8 ttl=59 time=34.9 ms +[1595103473.021432] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=9 ttl=59 time=35.6 ms +[1595103474.015603] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=10 ttl=59 time=27.4 ms +[1595103475.026760] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=11 ttl=59 time=36.9 ms +[1595103476.026930] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=12 ttl=59 time=35.7 ms +[1595103477.031093] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=13 ttl=59 time=36.8 ms +[1595103478.028918] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=14 ttl=59 time=33.1 ms +[1595103479.032238] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=15 ttl=59 time=35.6 ms +[1595103480.032097] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=16 ttl=59 time=33.3 ms +[1595103481.034546] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=17 ttl=59 time=34.8 ms +[1595103482.037939] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=18 ttl=59 time=35.7 ms +[1595103483.041514] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=19 ttl=59 time=35.8 ms +[1595103484.039110] 1408 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=20 ttl=59 time=29.3 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19040ms +rtt min/avg/max/mdev = 26.767/33.782/44.159/3.954 ms diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.out b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.out new file mode 100644 index 00000000..897770d7 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.189.67) 56(84) bytes of data. +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=1 ttl=59 time=26.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=2 ttl=59 time=26.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=3 ttl=59 time=34.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=4 ttl=59 time=34.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=5 ttl=59 time=32.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=6 ttl=59 time=25.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=7 ttl=59 time=33.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=8 ttl=59 time=34.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=9 ttl=59 time=27.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=10 ttl=59 time=32.9 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=11 ttl=59 time=32.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=12 ttl=59 time=32.0 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=13 ttl=59 time=24.7 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=14 ttl=59 time=34.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=15 ttl=59 time=35.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=16 ttl=59 time=33.3 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=17 ttl=59 time=74.5 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=18 ttl=59 time=31.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=19 ttl=59 time=85.3 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=20 ttl=59 time=143 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19052ms +rtt min/avg/max/mdev = 24.785/41.856/143.789/27.768 ms diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O.out b/tests/fixtures/ubuntu-18.04/ping-hostname-O.out new file mode 100644 index 00000000..fc94183b --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O.out @@ -0,0 +1,25 @@ +PING turner-tls.map.fastly.net (151.101.189.67) 56(84) bytes of data. +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=1 ttl=59 time=26.3 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=2 ttl=59 time=24.3 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=3 ttl=59 time=32.5 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=4 ttl=59 time=33.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=5 ttl=59 time=32.5 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=6 ttl=59 time=26.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=7 ttl=59 time=34.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=8 ttl=59 time=24.6 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=9 ttl=59 time=34.7 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=10 ttl=59 time=33.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=11 ttl=59 time=33.9 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=12 ttl=59 time=28.4 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=13 ttl=59 time=33.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=14 ttl=59 time=26.3 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=15 ttl=59 time=27.0 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=16 ttl=59 time=33.8 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=17 ttl=59 time=35.2 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=18 ttl=59 time=26.4 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=19 ttl=59 time=34.1 ms +64 bytes from 151.101.189.67 (151.101.189.67): icmp_seq=20 ttl=59 time=27.1 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19290ms +rtt min/avg/max/mdev = 24.330/30.420/35.259/3.840 ms diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O-D.out b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.out new file mode 100644 index 00000000..8a9e3378 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +[1595102903.313934] 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.017 ms +[1595102904.333410] 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.033 ms +[1595102905.357910] 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.041 ms +[1595102906.381400] 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.039 ms +[1595102907.406752] 64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.050 ms +[1595102908.430739] 64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.050 ms +[1595102909.454753] 64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.051 ms +[1595102910.478765] 64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.050 ms +[1595102911.501150] 64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.027 ms +[1595102912.525888] 64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.051 ms +[1595102913.550088] 64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.050 ms +[1595102914.574405] 64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.040 ms +[1595102915.598696] 64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.050 ms +[1595102916.622554] 64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.049 ms +[1595102917.646755] 64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.050 ms +[1595102918.670765] 64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.051 ms +[1595102919.693157] 64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.050 ms +[1595102920.717034] 64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.038 ms +[1595102921.741629] 64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.050 ms +[1595102922.766421] 64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.050 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19452ms +rtt min/avg/max/mdev = 0.017/0.044/0.051/0.010 ms diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O.out b/tests/fixtures/ubuntu-18.04/ping-ip-O.out new file mode 100644 index 00000000..82b1ea46 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.020 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.027 ms +64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.041 ms +64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.052 ms +64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.057 ms +64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.051 ms +64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.049 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19434ms +rtt min/avg/max/mdev = 0.020/0.047/0.057/0.010 ms diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.out b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.out new file mode 100644 index 00000000..6f92efc7 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2d::323 (2a04:4e42:2d::323)) 1400 data bytes +[1595102963.207191] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=1 ttl=59 time=162 ms +[1595102964.072572] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=2 ttl=59 time=26.2 ms +[1595102965.083093] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=3 ttl=59 time=34.0 ms +[1595102966.086221] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=4 ttl=59 time=34.6 ms +[1595102967.088365] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=5 ttl=59 time=32.9 ms +[1595102968.090956] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=6 ttl=59 time=33.5 ms +[1595102969.088229] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=7 ttl=59 time=27.6 ms +[1595102970.088630] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=8 ttl=59 time=25.0 ms +[1595102971.093828] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=9 ttl=59 time=27.0 ms +[1595102972.104782] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=10 ttl=59 time=35.3 ms +[1595102973.098518] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=11 ttl=59 time=27.1 ms +[1595102974.108744] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=12 ttl=59 time=36.0 ms +[1595102975.104919] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=13 ttl=59 time=30.4 ms +[1595102976.103486] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=14 ttl=59 time=26.1 ms +[1595102977.107027] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=15 ttl=59 time=27.2 ms +[1595102978.111345] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=16 ttl=59 time=28.3 ms +[1595102979.121028] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=17 ttl=59 time=35.9 ms +[1595102980.116465] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=18 ttl=59 time=28.8 ms +[1595102981.126039] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=19 ttl=59 time=34.7 ms +[1595102982.128680] 1408 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=20 ttl=59 time=34.3 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19050ms +rtt min/avg/max/mdev = 25.086/37.398/162.132/28.854 ms diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.out b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.out new file mode 100644 index 00000000..5803d1fc --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2d::323 (2a04:4e42:2d::323)) 56 data bytes +[1595102982.159725] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=1 ttl=59 time=26.9 ms +[1595102983.167501] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=2 ttl=59 time=33.0 ms +[1595102984.169378] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=3 ttl=59 time=33.1 ms +[1595102985.163818] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=4 ttl=59 time=25.7 ms +[1595102986.167583] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=5 ttl=59 time=26.5 ms +[1595102987.175507] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=6 ttl=59 time=32.5 ms +[1595102988.171549] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=7 ttl=59 time=25.8 ms +[1595102989.181855] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=8 ttl=59 time=33.6 ms +[1595102990.176307] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=9 ttl=59 time=24.6 ms +[1595102991.188111] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=10 ttl=59 time=33.0 ms +[1595102993.166385] no answer yet for icmp_seq=11 +[1595102993.198594] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=12 ttl=59 time=32.0 ms +[1595102994.201841] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=13 ttl=59 time=32.8 ms +[1595102996.174060] no answer yet for icmp_seq=14 +[1595102996.207576] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=15 ttl=59 time=33.3 ms +[1595102997.211141] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=16 ttl=59 time=33.6 ms +[1595102998.210588] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=17 ttl=59 time=32.0 ms +[1595102999.205480] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=18 ttl=59 time=25.4 ms +[1595103000.216799] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=19 ttl=59 time=33.5 ms +[1595103001.217993] 64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=20 ttl=59 time=32.8 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 18 received, 10% packet loss, time 19052ms +rtt min/avg/max/mdev = 24.671/30.617/33.654/3.419 ms diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.out b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.out new file mode 100644 index 00000000..8c39522d --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2d::323 (2a04:4e42:2d::323)) 56 data bytes +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=1 ttl=59 time=25.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=2 ttl=59 time=27.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=3 ttl=59 time=26.5 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=4 ttl=59 time=34.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=5 ttl=59 time=27.5 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=6 ttl=59 time=34.5 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=7 ttl=59 time=26.6 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=8 ttl=59 time=35.3 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=9 ttl=59 time=26.8 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=10 ttl=59 time=33.1 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=11 ttl=59 time=33.5 ms +no answer yet for icmp_seq=12 +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=13 ttl=59 time=25.2 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=14 ttl=59 time=25.2 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=15 ttl=59 time=36.5 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=16 ttl=59 time=34.4 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=17 ttl=59 time=35.4 ms +no answer yet for icmp_seq=18 +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=19 ttl=59 time=151 ms +64 bytes from 2a04:4e42:2d::323 (2a04:4e42:2d::323): icmp_seq=20 ttl=59 time=51.5 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 18 received, 10% packet loss, time 19081ms +rtt min/avg/max/mdev = 25.229/38.451/151.911/28.221 ms diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.out b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.out new file mode 100644 index 00000000..b016ec88 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +[1595102942.853155] 64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=28.4 ms +[1595102943.857295] 64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=29.4 ms +[1595102944.861751] 64 bytes from 2a04:4e42:600::323: icmp_seq=3 ttl=59 time=31.2 ms +[1595102946.861681] no answer yet for icmp_seq=4 +[1595102946.891881] 64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=30.0 ms +[1595102947.884818] 64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=22.0 ms +[1595102948.891520] 64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=27.2 ms +[1595102949.897424] 64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=30.5 ms +[1595102950.899820] 64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=29.0 ms +[1595102951.905148] 64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=31.3 ms +[1595102953.901458] no answer yet for icmp_seq=11 +[1595102953.931590] 64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=29.9 ms +[1595102955.918953] no answer yet for icmp_seq=13 +[1595102956.942898] no answer yet for icmp_seq=14 +[1595102956.973463] 64 bytes from 2a04:4e42:600::323: icmp_seq=15 ttl=59 time=30.4 ms +[1595102957.966655] 64 bytes from 2a04:4e42:600::323: icmp_seq=16 ttl=59 time=21.4 ms +[1595102959.981759] no answer yet for icmp_seq=17 +[1595102960.035095] 64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=53.2 ms +[1595102961.106079] 64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=121 ms +[1595102962.145647] 64 bytes from 2a04:4e42:600::323: icmp_seq=20 ttl=59 time=159 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 15 received, 25% packet loss, time 19161ms +rtt min/avg/max/mdev = 21.405/45.041/159.380/38.693 ms diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out new file mode 100644 index 00000000..4b43c026 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out @@ -0,0 +1,25 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=26.8 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=24.6 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=3 ttl=59 time=23.6 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=4 ttl=59 time=21.7 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=28.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=23.0 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=21.4 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=22.3 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=22.3 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=29.3 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=11 ttl=59 time=22.6 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=22.7 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=13 ttl=59 time=29.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=14 ttl=59 time=22.0 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=15 ttl=59 time=30.1 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=16 ttl=59 time=24.2 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=17 ttl=59 time=22.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=24.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=29.9 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19046ms +rtt min/avg/max/mdev = 21.403/24.901/30.176/3.056 ms From 94988d86674293faddc6f7e7c82575738d2dc791 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 13:50:40 -0700 Subject: [PATCH 05/80] add fedora ping fixtures --- .../fedora32/ping-hostname-O-D-p-s.out | 26 +++++++++++++++++++ tests/fixtures/fedora32/ping-hostname-O-p.out | 26 +++++++++++++++++++ tests/fixtures/fedora32/ping-hostname-O.out | 25 ++++++++++++++++++ tests/fixtures/fedora32/ping-ip-O-D.out | 25 ++++++++++++++++++ tests/fixtures/fedora32/ping-ip-O.out | 25 ++++++++++++++++++ .../fedora32/ping6-hostname-O-D-p-s.out | 26 +++++++++++++++++++ .../fedora32/ping6-hostname-O-D-p.out | 26 +++++++++++++++++++ .../fixtures/fedora32/ping6-hostname-O-p.out | 26 +++++++++++++++++++ tests/fixtures/fedora32/ping6-ip-O-D-p.out | 26 +++++++++++++++++++ tests/fixtures/fedora32/ping6-ip-O-p.out | 26 +++++++++++++++++++ 10 files changed, 257 insertions(+) create mode 100644 tests/fixtures/fedora32/ping-hostname-O-D-p-s.out create mode 100644 tests/fixtures/fedora32/ping-hostname-O-p.out create mode 100644 tests/fixtures/fedora32/ping-hostname-O.out create mode 100644 tests/fixtures/fedora32/ping-ip-O-D.out create mode 100644 tests/fixtures/fedora32/ping-ip-O.out create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-D-p-s.out create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-D-p.out create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-p.out create mode 100644 tests/fixtures/fedora32/ping6-ip-O-D-p.out create mode 100644 tests/fixtures/fedora32/ping6-ip-O-p.out diff --git a/tests/fixtures/fedora32/ping-hostname-O-D-p-s.out b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.out new file mode 100644 index 00000000..2f241864 --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.129.67) 1400(1428) bytes of data. +[1595191335.548399] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=1 ttl=59 time=46.1 ms +[1595191336.134174] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=2 ttl=59 time=61.5 ms +[1595191337.101575] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=3 ttl=59 time=26.3 ms +[1595191338.108023] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=4 ttl=59 time=30.9 ms +[1595191339.229213] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=5 ttl=59 time=149 ms +[1595191340.114026] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=6 ttl=59 time=32.4 ms +[1595191341.122628] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=7 ttl=59 time=37.9 ms +[1595191342.110785] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=8 ttl=59 time=26.0 ms +[1595191343.118652] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=9 ttl=59 time=32.3 ms +[1595191344.130300] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=10 ttl=59 time=43.4 ms +[1595191345.162284] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=11 ttl=59 time=71.9 ms +[1595191346.123086] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=12 ttl=59 time=31.1 ms +[1595191347.127689] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=13 ttl=59 time=33.6 ms +[1595191348.142817] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=14 ttl=59 time=45.6 ms +[1595191349.125383] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=15 ttl=59 time=25.9 ms +[1595191350.136294] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=16 ttl=59 time=34.0 ms +[1595191351.135889] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=17 ttl=59 time=31.2 ms +[1595191352.134199] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=18 ttl=59 time=26.2 ms +[1595191353.147391] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=19 ttl=59 time=38.5 ms +[1595191354.150640] 1408 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=20 ttl=59 time=39.5 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19040ms +rtt min/avg/max/mdev = 25.934/43.176/149.271/26.937 ms diff --git a/tests/fixtures/fedora32/ping-hostname-O-p.out b/tests/fixtures/fedora32/ping-hostname-O-p.out new file mode 100644 index 00000000..75e0c991 --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING turner-tls.map.fastly.net (151.101.197.67) 56(84) bytes of data. +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=1 ttl=56 time=38.2 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=2 ttl=56 time=38.5 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=3 ttl=56 time=39.3 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=4 ttl=56 time=49.2 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=5 ttl=56 time=47.4 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=6 ttl=56 time=48.2 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=7 ttl=56 time=53.4 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=8 ttl=56 time=47.1 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=9 ttl=56 time=47.3 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=10 ttl=56 time=51.8 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=11 ttl=56 time=55.1 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=12 ttl=56 time=40.6 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=13 ttl=56 time=39.5 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=14 ttl=56 time=40.1 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=15 ttl=56 time=41.4 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=16 ttl=56 time=57.9 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=17 ttl=56 time=45.7 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=18 ttl=56 time=39.3 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=19 ttl=56 time=37.4 ms +64 bytes from 151.101.197.67 (151.101.197.67): icmp_seq=20 ttl=56 time=40.4 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19026ms +rtt min/avg/max/mdev = 37.406/44.894/57.881/6.101 ms diff --git a/tests/fixtures/fedora32/ping-hostname-O.out b/tests/fixtures/fedora32/ping-hostname-O.out new file mode 100644 index 00000000..1c2e12a4 --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O.out @@ -0,0 +1,25 @@ +PING turner-tls.map.fastly.net (151.101.129.67) 56(84) bytes of data. +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=1 ttl=59 time=27.5 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=2 ttl=59 time=31.5 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=3 ttl=59 time=25.5 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=4 ttl=59 time=65.1 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=5 ttl=59 time=32.4 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=6 ttl=59 time=32.2 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=7 ttl=59 time=156 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=8 ttl=59 time=216 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=9 ttl=59 time=275 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=10 ttl=59 time=25.7 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=11 ttl=59 time=29.5 ms +no answer yet for icmp_seq=12 +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=13 ttl=59 time=25.9 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=14 ttl=59 time=33.0 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=15 ttl=59 time=24.3 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=16 ttl=59 time=35.8 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=17 ttl=59 time=24.8 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=18 ttl=59 time=34.0 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=19 ttl=59 time=30.7 ms +64 bytes from 151.101.129.67 (151.101.129.67): icmp_seq=20 ttl=59 time=45.8 ms + +--- turner-tls.map.fastly.net ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19075ms +rtt min/avg/max/mdev = 24.317/61.577/274.537/69.940 ms diff --git a/tests/fixtures/fedora32/ping-ip-O-D.out b/tests/fixtures/fedora32/ping-ip-O-D.out new file mode 100644 index 00000000..fdbd3b05 --- /dev/null +++ b/tests/fixtures/fedora32/ping-ip-O-D.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +[1595191373.643436] 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.043 ms +[1595191374.662543] 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.083 ms +[1595191375.685291] 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.091 ms +[1595191376.709678] 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.092 ms +[1595191377.734105] 64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.090 ms +[1595191378.758107] 64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.089 ms +[1595191379.781215] 64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.087 ms +[1595191380.806010] 64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.092 ms +[1595191381.829806] 64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.088 ms +[1595191382.853166] 64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.135 ms +[1595191383.876966] 64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.101 ms +[1595191384.900636] 64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.084 ms +[1595191385.925055] 64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.071 ms +[1595191386.949860] 64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.087 ms +[1595191387.973041] 64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.087 ms +[1595191388.997049] 64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.073 ms +[1595191390.021265] 64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.074 ms +[1595191391.044904] 64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.089 ms +[1595191392.069285] 64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.090 ms +[1595191393.093307] 64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.084 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19450ms +rtt min/avg/max/mdev = 0.043/0.086/0.135/0.016 ms diff --git a/tests/fixtures/fedora32/ping-ip-O.out b/tests/fixtures/fedora32/ping-ip-O.out new file mode 100644 index 00000000..8b8c4d98 --- /dev/null +++ b/tests/fixtures/fedora32/ping-ip-O.out @@ -0,0 +1,25 @@ +PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.043 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.070 ms +64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.090 ms +64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.093 ms +64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.078 ms +64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.160 ms +64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.089 ms +64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.155 ms +64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.084 ms +64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.111 ms +64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.079 ms +64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.103 ms +64 bytes from 127.0.0.1: icmp_seq=13 ttl=64 time=0.105 ms +64 bytes from 127.0.0.1: icmp_seq=14 ttl=64 time=0.087 ms +64 bytes from 127.0.0.1: icmp_seq=15 ttl=64 time=0.081 ms +64 bytes from 127.0.0.1: icmp_seq=16 ttl=64 time=0.089 ms +64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.090 ms +64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.089 ms +64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.090 ms +64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.092 ms + +--- 127.0.0.1 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19480ms +rtt min/avg/max/mdev = 0.043/0.093/0.160/0.025 ms diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.out b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.out new file mode 100644 index 00000000..1d905dc2 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:200::323 (2a04:4e42:200::323)) 1400 data bytes +[1595191433.391154] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=1 ttl=59 time=34.6 ms +[1595191434.063086] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=2 ttl=59 time=37.2 ms +[1595191435.071905] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=3 ttl=59 time=44.3 ms +[1595191436.067128] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=4 ttl=59 time=37.3 ms +[1595191437.064550] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=5 ttl=59 time=32.2 ms +[1595191438.065410] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=6 ttl=59 time=30.8 ms +[1595191439.076718] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=7 ttl=59 time=40.6 ms +[1595191440.076357] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=8 ttl=59 time=38.2 ms +[1595191441.079078] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=9 ttl=59 time=39.0 ms +[1595191442.077537] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=10 ttl=59 time=34.3 ms +[1595191443.104345] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=11 ttl=59 time=59.0 ms +[1595191444.083741] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=12 ttl=59 time=36.8 ms +[1595191445.086748] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=13 ttl=59 time=37.6 ms +[1595191446.088958] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=14 ttl=59 time=37.3 ms +[1595191447.086122] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=15 ttl=59 time=30.9 ms +[1595191448.088312] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=16 ttl=59 time=30.8 ms +[1595191449.098353] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=17 ttl=59 time=38.9 ms +[1595191450.099590] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=18 ttl=59 time=38.1 ms +[1595191451.101050] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=19 ttl=59 time=37.8 ms +[1595191452.100239] 1408 bytes from 2a04:4e42:200::323 (2a04:4e42:200::323): icmp_seq=20 ttl=59 time=35.0 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19042ms +rtt min/avg/max/mdev = 30.757/37.536/59.021/5.967 ms diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p.out b/tests/fixtures/fedora32/ping6-hostname-O-D-p.out new file mode 100644 index 00000000..533e6f74 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:2e::323 (2a04:4e42:2e::323)) 56 data bytes +[1595191452.255300] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=1 ttl=56 time=39.1 ms +[1595191453.229184] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=2 ttl=56 time=47.9 ms +[1595191454.229065] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=3 ttl=56 time=46.4 ms +[1595191455.230571] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=4 ttl=56 time=45.1 ms +[1595191456.233811] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=5 ttl=56 time=45.7 ms +[1595191457.228052] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=6 ttl=56 time=38.9 ms +[1595191458.228764] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=7 ttl=56 time=39.0 ms +[1595191459.243633] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=8 ttl=56 time=51.4 ms +[1595191460.243509] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=9 ttl=56 time=49.1 ms +[1595191461.242713] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=10 ttl=56 time=46.6 ms +[1595191462.246016] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=11 ttl=56 time=47.1 ms +[1595191463.240552] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=12 ttl=56 time=38.6 ms +[1595191464.248594] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=13 ttl=56 time=44.3 ms +[1595191465.254128] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=14 ttl=56 time=48.8 ms +[1595191466.253777] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=15 ttl=56 time=45.2 ms +[1595191467.259039] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=16 ttl=56 time=47.3 ms +[1595191468.252991] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=17 ttl=56 time=38.5 ms +[1595191469.263167] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=18 ttl=56 time=47.0 ms +[1595191470.264838] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=19 ttl=56 time=46.3 ms +[1595191471.266951] 64 bytes from 2a04:4e42:2e::323 (2a04:4e42:2e::323): icmp_seq=20 ttl=56 time=45.4 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19043ms +rtt min/avg/max/mdev = 38.533/44.877/51.366/3.830 ms diff --git a/tests/fixtures/fedora32/ping6-hostname-O-p.out b/tests/fixtures/fedora32/ping6-hostname-O-p.out new file mode 100644 index 00000000..7790a546 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING www.cnn.com(2a04:4e42:400::323 (2a04:4e42:400::323)) 56 data bytes +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=1 ttl=59 time=24.0 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=2 ttl=59 time=30.5 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=3 ttl=59 time=23.6 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=4 ttl=59 time=35.8 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=5 ttl=59 time=32.3 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=6 ttl=59 time=32.4 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=7 ttl=59 time=26.5 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=8 ttl=59 time=31.1 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=9 ttl=59 time=33.9 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=10 ttl=59 time=32.5 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=11 ttl=59 time=31.0 ms +no answer yet for icmp_seq=12 +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=13 ttl=59 time=31.9 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=14 ttl=59 time=112 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=15 ttl=59 time=162 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=16 ttl=59 time=223 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=17 ttl=59 time=281 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=18 ttl=59 time=33.4 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=19 ttl=59 time=32.7 ms +64 bytes from 2a04:4e42:400::323 (2a04:4e42:400::323): icmp_seq=20 ttl=59 time=42.3 ms + +--- www.cnn.com ping statistics --- +20 packets transmitted, 19 received, 5% packet loss, time 19049ms +rtt min/avg/max/mdev = 23.598/65.877/281.064/72.640 ms diff --git a/tests/fixtures/fedora32/ping6-ip-O-D-p.out b/tests/fixtures/fedora32/ping6-ip-O-D-p.out new file mode 100644 index 00000000..df7978d1 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-ip-O-D-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +[1595191413.333769] 64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=34.6 ms +[1595191414.342973] 64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=41.9 ms +[1595191415.332214] 64 bytes from 2a04:4e42:600::323: icmp_seq=3 ttl=59 time=28.8 ms +[1595191416.342603] 64 bytes from 2a04:4e42:600::323: icmp_seq=4 ttl=59 time=36.8 ms +[1595191417.344996] 64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=37.6 ms +[1595191418.348619] 64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=37.9 ms +[1595191419.357154] 64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=44.4 ms +[1595191420.350087] 64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=35.1 ms +[1595191421.346691] 64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=29.9 ms +[1595191422.355843] 64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=37.4 ms +[1595191423.397934] 64 bytes from 2a04:4e42:600::323: icmp_seq=11 ttl=59 time=76.7 ms +[1595191424.470798] 64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=148 ms +[1595191425.358652] 64 bytes from 2a04:4e42:600::323: icmp_seq=13 ttl=59 time=33.6 ms +[1595191426.404587] 64 bytes from 2a04:4e42:600::323: icmp_seq=14 ttl=59 time=77.2 ms +[1595191427.359785] 64 bytes from 2a04:4e42:600::323: icmp_seq=15 ttl=59 time=29.7 ms +[1595191428.367539] 64 bytes from 2a04:4e42:600::323: icmp_seq=16 ttl=59 time=34.9 ms +[1595191429.372551] 64 bytes from 2a04:4e42:600::323: icmp_seq=17 ttl=59 time=37.2 ms +[1595191430.364571] 64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=27.9 ms +[1595191431.375232] 64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=37.1 ms +[1595191432.375802] 64 bytes from 2a04:4e42:600::323: icmp_seq=20 ttl=59 time=34.3 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19042ms +rtt min/avg/max/mdev = 27.880/45.072/148.380/27.078 ms diff --git a/tests/fixtures/fedora32/ping6-ip-O-p.out b/tests/fixtures/fedora32/ping6-ip-O-p.out new file mode 100644 index 00000000..3cdd632d --- /dev/null +++ b/tests/fixtures/fedora32/ping6-ip-O-p.out @@ -0,0 +1,26 @@ +PATTERN: 0xabcd +PING 2a04:4e42:600::323(2a04:4e42:600::323) 56 data bytes +64 bytes from 2a04:4e42:600::323: icmp_seq=1 ttl=59 time=34.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=2 ttl=59 time=36.6 ms +no answer yet for icmp_seq=3 +64 bytes from 2a04:4e42:600::323: icmp_seq=4 ttl=59 time=28.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=5 ttl=59 time=36.8 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=6 ttl=59 time=28.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=7 ttl=59 time=39.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=8 ttl=59 time=28.2 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=9 ttl=59 time=28.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=10 ttl=59 time=36.5 ms +no answer yet for icmp_seq=11 +64 bytes from 2a04:4e42:600::323: icmp_seq=12 ttl=59 time=33.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=13 ttl=59 time=28.1 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=14 ttl=59 time=27.6 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=15 ttl=59 time=36.0 ms +no answer yet for icmp_seq=16 +64 bytes from 2a04:4e42:600::323: icmp_seq=17 ttl=59 time=26.6 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=18 ttl=59 time=38.5 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=19 ttl=59 time=43.9 ms +64 bytes from 2a04:4e42:600::323: icmp_seq=20 ttl=59 time=37.9 ms + +--- 2a04:4e42:600::323 ping statistics --- +20 packets transmitted, 17 received, 15% packet loss, time 19193ms +rtt min/avg/max/mdev = 26.566/33.623/43.945/5.029 ms From 51f4e6927c68a7e2a26954f564d10d316b98a984 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 14:18:40 -0700 Subject: [PATCH 06/80] add support for pattern in osx/bsd --- jc/parsers/ping.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 7f0d2275..16f7002f 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -194,14 +194,22 @@ def linux_parse(data): def bsd_parse(data): raw_output = {} ping_responses = [] + pattern = None footer = False - for line in filter(None, data.splitlines()): + linedata = data.splitlines() + + # check for PATTERN + if linedata[0].startswith('PATTERN: '): + pattern = linedata.pop(0).split(': ')[1] + + for line in filter(None, linedata): if line.startswith('PING '): raw_output.update( { 'destination_ip': line.split()[2].lstrip('(').rstrip(':').rstrip(')'), - 'data_bytes': line.split()[3] + 'data_bytes': line.split()[3], + 'pattern': pattern } ) continue @@ -212,7 +220,8 @@ def bsd_parse(data): { 'source_ip': line.split()[4], 'destination_ip': line.split()[6], - 'data_bytes': line.split()[1] + 'data_bytes': line.split()[1], + 'pattern': pattern } ) continue From 91ee6e6701307363336a39f9e16641465ddd05c2 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 14:18:56 -0700 Subject: [PATCH 07/80] add osx ping test fixtures --- tests/fixtures/osx-10.14.6/ping-hostname-p.out | 9 +++++++++ tests/fixtures/osx-10.14.6/ping-hostname-s.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping-hostname.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping-ip-p.out | 9 +++++++++ tests/fixtures/osx-10.14.6/ping-ip-s.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping-ip.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping6-hostname-p.out | 9 +++++++++ tests/fixtures/osx-10.14.6/ping6-hostname-s.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping6-hostname.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping6-ip-p.out | 9 +++++++++ tests/fixtures/osx-10.14.6/ping6-ip-s.out | 8 ++++++++ tests/fixtures/osx-10.14.6/ping6-ip.out | 8 ++++++++ 12 files changed, 100 insertions(+) create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname-p.out create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname-s.out create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname.out create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-p.out create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-s.out create mode 100644 tests/fixtures/osx-10.14.6/ping-ip.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname-p.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname-s.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-p.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-s.out create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip.out diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-p.out b/tests/fixtures/osx-10.14.6/ping-hostname-p.out new file mode 100644 index 00000000..27121259 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING cnn.com (151.101.1.67): 56 data bytes +64 bytes from 151.101.1.67: icmp_seq=0 ttl=59 time=89.422 ms +64 bytes from 151.101.1.67: icmp_seq=1 ttl=59 time=116.712 ms +64 bytes from 151.101.1.67: icmp_seq=2 ttl=59 time=147.964 ms + +--- cnn.com ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 89.422/118.033/147.964/23.918 ms diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-s.out b/tests/fixtures/osx-10.14.6/ping-hostname-s.out new file mode 100644 index 00000000..819e7c29 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname-s.out @@ -0,0 +1,8 @@ +PING cnn.com (151.101.1.67): 1400 data bytes +1408 bytes from 151.101.1.67: icmp_seq=0 ttl=59 time=39.048 ms +1408 bytes from 151.101.1.67: icmp_seq=1 ttl=59 time=29.954 ms +1408 bytes from 151.101.1.67: icmp_seq=2 ttl=59 time=50.674 ms + +--- cnn.com ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 29.954/39.892/50.674/8.480 ms diff --git a/tests/fixtures/osx-10.14.6/ping-hostname.out b/tests/fixtures/osx-10.14.6/ping-hostname.out new file mode 100644 index 00000000..8e723329 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname.out @@ -0,0 +1,8 @@ +PING cnn.com (151.101.1.67): 56 data bytes +64 bytes from 151.101.1.67: icmp_seq=0 ttl=59 time=28.042 ms +64 bytes from 151.101.1.67: icmp_seq=1 ttl=59 time=34.786 ms +64 bytes from 151.101.1.67: icmp_seq=2 ttl=59 time=41.182 ms + +--- cnn.com ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 28.042/34.670/41.182/5.365 ms diff --git a/tests/fixtures/osx-10.14.6/ping-ip-p.out b/tests/fixtures/osx-10.14.6/ping-ip-p.out new file mode 100644 index 00000000..2f2948b4 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING 127.0.0.1 (127.0.0.1): 56 data bytes +64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.050 ms +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.104 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.079 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.050/0.078/0.104/0.022 ms diff --git a/tests/fixtures/osx-10.14.6/ping-ip-s.out b/tests/fixtures/osx-10.14.6/ping-ip-s.out new file mode 100644 index 00000000..2f9471f5 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-s.out @@ -0,0 +1,8 @@ +PING 127.0.0.1 (127.0.0.1): 1400 data bytes +1408 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.053 ms +1408 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.108 ms +1408 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.089 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.053/0.083/0.108/0.023 ms diff --git a/tests/fixtures/osx-10.14.6/ping-ip.out b/tests/fixtures/osx-10.14.6/ping-ip.out new file mode 100644 index 00000000..eecb4cdc --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip.out @@ -0,0 +1,8 @@ +PING 127.0.0.1 (127.0.0.1): 56 data bytes +64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.052 ms +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.095 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.050/0.066/0.095/0.021 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-p.out b/tests/fixtures/osx-10.14.6/ping6-hostname-p.out new file mode 100644 index 00000000..6211b79d --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING6(56=40+8+8 bytes) 2600:1700:bab0:d40:2595:8c97:ad16:749a --> 2a04:4e42:200::323 +16 bytes from 2a04:4e42:200::323, icmp_seq=0 hlim=59 time=32.992 ms +16 bytes from 2a04:4e42:200::323, icmp_seq=1 hlim=59 time=34.757 ms +16 bytes from 2a04:4e42:200::323, icmp_seq=2 hlim=59 time=36.070 ms + +--- cnn.com ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 32.992/34.606/36.070/1.261 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-s.out b/tests/fixtures/osx-10.14.6/ping6-hostname-s.out new file mode 100644 index 00000000..e52949a2 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-s.out @@ -0,0 +1,8 @@ +PING6(128=40+8+80 bytes) 2600:1700:bab0:d40:2595:8c97:ad16:749a --> 2a04:4e42:600::323 +88 bytes from 2a04:4e42:600::323, icmp_seq=0 hlim=59 time=26.292 ms +88 bytes from 2a04:4e42:600::323, icmp_seq=1 hlim=59 time=64.712 ms +88 bytes from 2a04:4e42:600::323, icmp_seq=2 hlim=59 time=25.933 ms + +--- cnn.com ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 25.933/38.979/64.712/18.197 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname.out b/tests/fixtures/osx-10.14.6/ping6-hostname.out new file mode 100644 index 00000000..9a0634ba --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname.out @@ -0,0 +1,8 @@ +PING6(56=40+8+8 bytes) 2600:1700:bab0:d40:2595:8c97:ad16:749a --> 2a04:4e42:200::323 +16 bytes from 2a04:4e42:200::323, icmp_seq=0 hlim=59 time=27.684 ms +16 bytes from 2a04:4e42:200::323, icmp_seq=1 hlim=59 time=31.824 ms +16 bytes from 2a04:4e42:200::323, icmp_seq=2 hlim=59 time=30.000 ms + +--- cnn.com ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 27.684/29.836/31.824/1.694 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-p.out b/tests/fixtures/osx-10.14.6/ping6-ip-p.out new file mode 100644 index 00000000..f1a18f71 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.077 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.156 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.139 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.077/0.124/0.156/0.034 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-s.out b/tests/fixtures/osx-10.14.6/ping6-ip-s.out new file mode 100644 index 00000000..981683d1 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-s.out @@ -0,0 +1,8 @@ +PING6(1448=40+8+1400 bytes) ::1 --> ::1 +1408 bytes from ::1, icmp_seq=0 hlim=64 time=0.093 ms +1408 bytes from ::1, icmp_seq=1 hlim=64 time=0.161 ms +1408 bytes from ::1, icmp_seq=2 hlim=64 time=0.152 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.093/0.135/0.161/0.030 ms diff --git a/tests/fixtures/osx-10.14.6/ping6-ip.out b/tests/fixtures/osx-10.14.6/ping6-ip.out new file mode 100644 index 00000000..8a4d7b59 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip.out @@ -0,0 +1,8 @@ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.071 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.153 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.122 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.071/0.115/0.153/0.034 ms From fb0f3eda04a4b1dbb81da7d5791cbfe746bfd617 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 14:45:50 -0700 Subject: [PATCH 08/80] add ping commands --- tests/fixtures/create_fixtures.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/fixtures/create_fixtures.sh b/tests/fixtures/create_fixtures.sh index a07bcf15..ffca60b1 100644 --- a/tests/fixtures/create_fixtures.sh +++ b/tests/fixtures/create_fixtures.sh @@ -102,6 +102,7 @@ sudo lastb > lastb.out cat /etc/group > group.out sudo cat /etc/gshadow > gshadow.out +# linux: ping -4 www.cnn.com -c 20 -O > ping-hostname-O.out ping -4 www.cnn.com -c 20 -O -p abcd > ping-hostname-O-p.out ping -4 www.cnn.com -c 20 -O -D -p abcd -s 1400 > ping-hostname-O-D-p-s.out @@ -113,3 +114,18 @@ ping6 www.cnn.com -c 20 -O -D -p abcd -s 1400 > ping6-hostname-O-D-p-s.out ping6 www.cnn.com -c 20 -O -D -p abcd > ping6-hostname-O-D-p.out ping6 www.cnn.com -c 20 -O -p abcd > ping6-hostname-O-p.out +# osx/bsd: +ping -c 3 -s 40 127.0.0.1 > ping-ip-s.out +ping -c 3 -s 40 localhost > ping-hostname-s.out +ping -c 3 -p ff 127.0.0.1 > ping-ip-p.out +ping -c 3 127.0.0.1 > ping-ip.out +ping -c 3 -p ff cnn.com > ping-hostname-p.out +ping -c 3 cnn.com > ping-hostname.out +ping6 -c 3 -s 40 localhost > ping6-hostname-s.out +ping6 -c 3 -s 40 ::1 > ping6-ip-s.out +ping6 -c 3 -p ff ::1 > ping6-ip-p.out +ping6 -c 3 ::1 > ping6-ip.out +ping6 -c 3 -p ff localhost > ping6-hostname-p.out +ping6 -c 3 localhost > ping6-hostname.out + + From 14bdd74526e400997c5bc247ea35ed40799e83ff Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 14:46:02 -0700 Subject: [PATCH 09/80] add ping test fixtures --- tests/fixtures/freebsd12/ping-hostname-p.out | 9 +++++++++ tests/fixtures/freebsd12/ping-hostname-s.out | 8 ++++++++ tests/fixtures/freebsd12/ping-hostname.out | 8 ++++++++ tests/fixtures/freebsd12/ping-ip-p.out | 9 +++++++++ tests/fixtures/freebsd12/ping-ip-s.out | 8 ++++++++ tests/fixtures/freebsd12/ping-ip.out | 8 ++++++++ tests/fixtures/freebsd12/ping6-hostname-p.out | 9 +++++++++ tests/fixtures/freebsd12/ping6-hostname-s.out | 8 ++++++++ tests/fixtures/freebsd12/ping6-hostname.out | 8 ++++++++ tests/fixtures/freebsd12/ping6-ip-p.out | 9 +++++++++ tests/fixtures/freebsd12/ping6-ip-s.out | 8 ++++++++ tests/fixtures/freebsd12/ping6-ip.out | 8 ++++++++ 12 files changed, 100 insertions(+) create mode 100644 tests/fixtures/freebsd12/ping-hostname-p.out create mode 100644 tests/fixtures/freebsd12/ping-hostname-s.out create mode 100644 tests/fixtures/freebsd12/ping-hostname.out create mode 100644 tests/fixtures/freebsd12/ping-ip-p.out create mode 100644 tests/fixtures/freebsd12/ping-ip-s.out create mode 100644 tests/fixtures/freebsd12/ping-ip.out create mode 100644 tests/fixtures/freebsd12/ping6-hostname-p.out create mode 100644 tests/fixtures/freebsd12/ping6-hostname-s.out create mode 100644 tests/fixtures/freebsd12/ping6-hostname.out create mode 100644 tests/fixtures/freebsd12/ping6-ip-p.out create mode 100644 tests/fixtures/freebsd12/ping6-ip-s.out create mode 100644 tests/fixtures/freebsd12/ping6-ip.out diff --git a/tests/fixtures/freebsd12/ping-hostname-p.out b/tests/fixtures/freebsd12/ping-hostname-p.out new file mode 100644 index 00000000..a6d2e5ff --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING cnn.com (151.101.1.67): 56 data bytes +64 bytes from 151.101.1.67: icmp_seq=0 ttl=59 time=32.340 ms +64 bytes from 151.101.1.67: icmp_seq=1 ttl=59 time=34.505 ms +64 bytes from 151.101.1.67: icmp_seq=2 ttl=59 time=28.389 ms + +--- cnn.com ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 28.389/31.745/34.505/2.532 ms diff --git a/tests/fixtures/freebsd12/ping-hostname-s.out b/tests/fixtures/freebsd12/ping-hostname-s.out new file mode 100644 index 00000000..deadd8a2 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname-s.out @@ -0,0 +1,8 @@ +PING localhost (127.0.0.1): 40 data bytes +48 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.022 ms +48 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.038 ms +48 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.030 ms + +--- localhost ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.022/0.030/0.038/0.006 ms diff --git a/tests/fixtures/freebsd12/ping-hostname.out b/tests/fixtures/freebsd12/ping-hostname.out new file mode 100644 index 00000000..5f7fdfd3 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname.out @@ -0,0 +1,8 @@ +PING cnn.com (151.101.65.67): 56 data bytes +64 bytes from 151.101.65.67: icmp_seq=0 ttl=59 time=27.010 ms +64 bytes from 151.101.65.67: icmp_seq=1 ttl=59 time=31.978 ms +64 bytes from 151.101.65.67: icmp_seq=2 ttl=59 time=42.506 ms + +--- cnn.com ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 27.010/33.831/42.506/6.461 ms diff --git a/tests/fixtures/freebsd12/ping-ip-p.out b/tests/fixtures/freebsd12/ping-ip-p.out new file mode 100644 index 00000000..bae3b83f --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING 127.0.0.1 (127.0.0.1): 56 data bytes +64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.036 ms +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.042 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.034 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.034/0.037/0.042/0.003 ms diff --git a/tests/fixtures/freebsd12/ping-ip-s.out b/tests/fixtures/freebsd12/ping-ip-s.out new file mode 100644 index 00000000..e0cbf2be --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip-s.out @@ -0,0 +1,8 @@ +PING 127.0.0.1 (127.0.0.1): 40 data bytes +48 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.024 ms +48 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.036 ms +48 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.036 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.024/0.032/0.036/0.006 ms diff --git a/tests/fixtures/freebsd12/ping-ip.out b/tests/fixtures/freebsd12/ping-ip.out new file mode 100644 index 00000000..6774afa5 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip.out @@ -0,0 +1,8 @@ +PING 127.0.0.1 (127.0.0.1): 56 data bytes +64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.022 ms +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.036 ms +64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.041 ms + +--- 127.0.0.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.022/0.033/0.041/0.008 ms diff --git a/tests/fixtures/freebsd12/ping6-hostname-p.out b/tests/fixtures/freebsd12/ping6-hostname-p.out new file mode 100644 index 00000000..4585c8e1 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.036 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.051 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.048 ms + +--- localhost ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.036/0.045/0.051/0.007 ms diff --git a/tests/fixtures/freebsd12/ping6-hostname-s.out b/tests/fixtures/freebsd12/ping6-hostname-s.out new file mode 100644 index 00000000..a0b979d7 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname-s.out @@ -0,0 +1,8 @@ +PING6(88=40+8+40 bytes) ::1 --> ::1 +48 bytes from ::1, icmp_seq=0 hlim=64 time=0.035 ms +48 bytes from ::1, icmp_seq=1 hlim=64 time=0.082 ms +48 bytes from ::1, icmp_seq=2 hlim=64 time=0.051 ms + +--- localhost ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.035/0.056/0.082/0.019 ms diff --git a/tests/fixtures/freebsd12/ping6-hostname.out b/tests/fixtures/freebsd12/ping6-hostname.out new file mode 100644 index 00000000..083270f3 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname.out @@ -0,0 +1,8 @@ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.036 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.041 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.048 ms + +--- localhost ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.036/0.042/0.048/0.005 ms diff --git a/tests/fixtures/freebsd12/ping6-ip-p.out b/tests/fixtures/freebsd12/ping6-ip-p.out new file mode 100644 index 00000000..1eedeb51 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip-p.out @@ -0,0 +1,9 @@ +PATTERN: 0xff +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.036 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.054 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.045 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.036/0.045/0.054/0.007 ms diff --git a/tests/fixtures/freebsd12/ping6-ip-s.out b/tests/fixtures/freebsd12/ping6-ip-s.out new file mode 100644 index 00000000..45a9bc2b --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip-s.out @@ -0,0 +1,8 @@ +PING6(88=40+8+40 bytes) ::1 --> ::1 +48 bytes from ::1, icmp_seq=0 hlim=64 time=0.036 ms +48 bytes from ::1, icmp_seq=1 hlim=64 time=0.088 ms +48 bytes from ::1, icmp_seq=2 hlim=64 time=0.049 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.036/0.058/0.088/0.022 ms diff --git a/tests/fixtures/freebsd12/ping6-ip.out b/tests/fixtures/freebsd12/ping6-ip.out new file mode 100644 index 00000000..3649379d --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip.out @@ -0,0 +1,8 @@ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim=64 time=0.034 ms +16 bytes from ::1, icmp_seq=1 hlim=64 time=0.053 ms +16 bytes from ::1, icmp_seq=2 hlim=64 time=0.045 ms + +--- ::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.034/0.044/0.053/0.008 ms From 60bd42f298f309cbec6d24c9543ea3d51bd73b18 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 15:13:52 -0700 Subject: [PATCH 10/80] add process() logic --- jc/parsers/ping.py | 68 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 16f7002f..dd132795 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -45,18 +45,66 @@ def process(proc_data): Returns: - List of dictionaries. Structured data with the following schema: + Dictionary. Structured data with the following schema: - [ - { - "ping": string, - "bar": boolean, - "baz": integer - } - ] + { + "destination_ip": string, + "data_bytes": integer, + "pattern": string, (null if not set) + "destination": string, + "packets_transmitted": integer, + "packets_received": integer, + "packet_loss_percent": float, + "round_trip_ms_min": float, + "round_trip_ms_avg": float, + "round_trip_ms_max": float, + "round_trip_ms_stddev": float, + "responses": [ + { + "type": string, ('reply' or 'timeout') + "timestamp": float, + "bytes": integer, + "response_ip": string, + "icmp_seq": integer, + "ttl": integer, + "time_ms": float + } + ] + } """ + int_list = ['data_bytes', 'packets_transmitted', 'packets_received', 'bytes', 'icmp_seq', 'ttl'] + float_list = ['packet_loss_percent', 'round_trip_ms_min', 'round_trip_ms_avg', 'round_trip_ms_max', + 'round_trip_ms_stddev', 'timestamp', 'time_ms'] + + for key in proc_data.keys(): + for item in int_list: + if item == key: + try: + proc_data[key] = int(proc_data[key]) + except (ValueError): + proc_data[key] = None + + for item in float_list: + if item == key: + try: + proc_data[key] = float(proc_data[key]) + except (ValueError): + proc_data[key] = None + + if key == 'responses': + for entry in proc_data['responses']: + for k in entry.keys(): + if k in int_list: + try: + entry[k] = int(entry[k]) + except (ValueError): + entry[k] = None + if k in float_list: + try: + entry[k] = float(entry[k]) + except (ValueError): + entry[k] = None - # rebuild output for added semantic information return proc_data @@ -313,7 +361,7 @@ def parse(data, raw=False, quiet=False): Returns: - List of dictionaries. Raw or processed structured data. + Dictionary. Raw or processed structured data. """ if not quiet: jc.utils.compatibility(__name__, info.compatible) From 74211eb0129f6aa655a38ba4d4d8844d81441107 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 15:16:04 -0700 Subject: [PATCH 11/80] add examples --- jc/parsers/ping.py | 85 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index dd132795..91d8b699 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -10,11 +10,88 @@ Compatibility: Examples: - $ ping | jc --ping -p - [] + $ ping -c 3 -p ff cnn.com | jc --ping -p + { + "destination_ip": "151.101.1.67", + "data_bytes": 56, + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": 3, + "packets_received": 3, + "packet_loss_percent": 0.0, + "round_trip_ms_min": 28.015, + "round_trip_ms_avg": 32.848, + "round_trip_ms_max": 39.376, + "round_trip_ms_stddev": 4.79, + "responses": [ + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 0, + "ttl": 59, + "time_ms": 28.015 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 1, + "ttl": 59, + "time_ms": 39.376 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 2, + "ttl": 59, + "time_ms": 31.153 + } + ] + } - $ ping | jc --ping -p -r - [] + + $ ping -c 3 -p ff cnn.com | jc --ping -p -r + { + "destination_ip": "151.101.129.67", + "data_bytes": "56", + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": "3", + "packets_received": "3", + "packet_loss_percent": "0.0", + "round_trip_ms_min": "25.078", + "round_trip_ms_avg": "29.543", + "round_trip_ms_max": "32.553", + "round_trip_ms_stddev": "3.221", + "responses": [ + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "0", + "ttl": "59", + "time_ms": "25.078" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "1", + "ttl": "59", + "time_ms": "30.999" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "2", + "ttl": "59", + "time_ms": "32.553" + } + ] + } """ import string import jc.utils From 8421ec88033e02f472e4961d87551a0352663a16 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 15:19:47 -0700 Subject: [PATCH 12/80] remove cygwin compatibility --- jc/parsers/ping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 91d8b699..f0edada4 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -6,7 +6,7 @@ Usage: Compatibility: - 'linux', 'darwin', 'cygwin', 'freebsd' + 'linux', 'darwin', 'freebsd' Examples: @@ -105,7 +105,7 @@ class info(): # details = 'enter any other details here' # compatible options: linux, darwin, cygwin, win32, aix, freebsd - compatible = ['linux', 'darwin', 'cygwin', 'freebsd'] + compatible = ['linux', 'darwin', 'freebsd'] magic_commands = ['ping', 'ping6'] From 301daa48d0bfc28f97c8e46f028f8c6b875bf34e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 19 Jul 2020 15:30:54 -0700 Subject: [PATCH 13/80] update documentation --- docs/parsers/ping.md | 124 ++++++++++++++++++++++++++++++++++++++----- jc/parsers/ping.py | 2 + 2 files changed, 112 insertions(+), 14 deletions(-) diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index fe15ae1c..27a1b3fe 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -5,17 +5,96 @@ Usage: specify --ping as the first argument if the piped input is coming from ping + Note: Use the ping -c (count) option, otherwise data will not be piped to jc. + Compatibility: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + 'linux', 'darwin', 'freebsd' Examples: - $ ping | jc --ping -p - [] + $ ping -c 3 -p ff cnn.com | jc --ping -p + { + "destination_ip": "151.101.1.67", + "data_bytes": 56, + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": 3, + "packets_received": 3, + "packet_loss_percent": 0.0, + "round_trip_ms_min": 28.015, + "round_trip_ms_avg": 32.848, + "round_trip_ms_max": 39.376, + "round_trip_ms_stddev": 4.79, + "responses": [ + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 0, + "ttl": 59, + "time_ms": 28.015 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 1, + "ttl": 59, + "time_ms": 39.376 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 2, + "ttl": 59, + "time_ms": 31.153 + } + ] + } - $ ping | jc --ping -p -r - [] + + $ ping -c 3 -p ff cnn.com | jc --ping -p -r + { + "destination_ip": "151.101.129.67", + "data_bytes": "56", + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": "3", + "packets_received": "3", + "packet_loss_percent": "0.0", + "round_trip_ms_min": "25.078", + "round_trip_ms_avg": "29.543", + "round_trip_ms_max": "32.553", + "round_trip_ms_stddev": "3.221", + "responses": [ + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "0", + "ttl": "59", + "time_ms": "25.078" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "1", + "ttl": "59", + "time_ms": "30.999" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "2", + "ttl": "59", + "time_ms": "32.553" + } + ] + } ## info ```python @@ -35,15 +114,32 @@ Parameters: Returns: - List of dictionaries. Structured data with the following schema: + Dictionary. Structured data with the following schema: - [ - { - "ping": string, - "bar": boolean, - "baz": integer - } - ] + { + "destination_ip": string, + "data_bytes": integer, + "pattern": string, (null if not set) + "destination": string, + "packets_transmitted": integer, + "packets_received": integer, + "packet_loss_percent": float, + "round_trip_ms_min": float, + "round_trip_ms_avg": float, + "round_trip_ms_max": float, + "round_trip_ms_stddev": float, + "responses": [ + { + "type": string, ('reply' or 'timeout') + "timestamp": float, + "bytes": integer, + "response_ip": string, + "icmp_seq": integer, + "ttl": integer, + "time_ms": float + } + ] + } ## parse ```python @@ -60,5 +156,5 @@ Parameters: Returns: - List of dictionaries. Raw or processed structured data. + Dictionary. Raw or processed structured data. diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index f0edada4..e66ae776 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -4,6 +4,8 @@ Usage: specify --ping as the first argument if the piped input is coming from ping + Note: Use the ping -c (count) option, otherwise data will not be piped to jc. + Compatibility: 'linux', 'darwin', 'freebsd' From 20bb1cdf396abdb3707b34fa146cbe913f9bbd6f Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 11:53:06 -0700 Subject: [PATCH 14/80] add TypeError to except for None values --- jc/parsers/ping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index e66ae776..cf50f217 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -160,14 +160,14 @@ def process(proc_data): if item == key: try: proc_data[key] = int(proc_data[key]) - except (ValueError): + except (ValueError, TypeError): proc_data[key] = None for item in float_list: if item == key: try: proc_data[key] = float(proc_data[key]) - except (ValueError): + except (ValueError, TypeError): proc_data[key] = None if key == 'responses': @@ -176,12 +176,12 @@ def process(proc_data): if k in int_list: try: entry[k] = int(entry[k]) - except (ValueError): + except (ValueError, TypeError): entry[k] = None if k in float_list: try: entry[k] = float(entry[k]) - except (ValueError): + except (ValueError, TypeError): entry[k] = None return proc_data From 3b8371f0208a097cb8a1c026348d3842e6702b9c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 12:49:05 -0700 Subject: [PATCH 15/80] add centos ping tests --- .../centos-7.7/ping-hostname-O-D-p-s.json | 1 + .../centos-7.7/ping-hostname-O-p.json | 1 + .../fixtures/centos-7.7/ping-hostname-O.json | 1 + tests/fixtures/centos-7.7/ping-ip-O-D.json | 1 + tests/fixtures/centos-7.7/ping-ip-O.json | 1 + .../centos-7.7/ping6-hostname-O-D-p-s.json | 1 + .../centos-7.7/ping6-hostname-O-p.json | 1 + tests/fixtures/centos-7.7/ping6-ip-O-D-p.json | 1 + tests/fixtures/centos-7.7/ping6-ip-O-p.json | 1 + tests/test_ping.py | 193 ++++++++++++++++++ 10 files changed, 202 insertions(+) create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O-p.json create mode 100644 tests/fixtures/centos-7.7/ping-hostname-O.json create mode 100644 tests/fixtures/centos-7.7/ping-ip-O-D.json create mode 100644 tests/fixtures/centos-7.7/ping-ip-O.json create mode 100644 tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json create mode 100644 tests/fixtures/centos-7.7/ping6-hostname-O-p.json create mode 100644 tests/fixtures/centos-7.7/ping6-ip-O-D-p.json create mode 100644 tests/fixtures/centos-7.7/ping6-ip-O-p.json create mode 100644 tests/test_ping.py diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json new file mode 100644 index 00000000..261cb4dd --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19146.0, "round_trip_ms_min": 28.96, "round_trip_ms_avg": 34.468, "round_trip_ms_max": 38.892, "round_trip_ms_stddev": 3.497, "responses": [{"type": "reply", "timestamp": 1594978465.914536, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.4}, {"type": "reply", "timestamp": 1594978465.993009, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.3}, {"type": "reply", "timestamp": 1594978467.010196, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1594978468.033743, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": 1594978469.051227, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 38.0}, {"type": "reply", "timestamp": 1594978470.048764, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": 1594978471.051945, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": 1594978472.064206, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": 1594978473.062587, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 31.5}, {"type": "reply", "timestamp": 1594978474.074343, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 38.3}, {"type": "reply", "timestamp": 1594978475.079703, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": 1594978476.076383, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": 1594978477.084119, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": 1594978478.092207, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 31.6}, {"type": "reply", "timestamp": 1594978479.104358, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 37.7}, {"type": "reply", "timestamp": 1594978480.106907, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": 1594978481.11558, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1594978482.119872, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": 1594978483.131901, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 37.0}, {"type": "reply", "timestamp": 1594978484.141117, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 36.9}]} diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-p.json b/tests/fixtures/centos-7.7/ping-hostname-O-p.json new file mode 100644 index 00000000..5fb5aa70 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19233.0, "round_trip_ms_min": 23.359, "round_trip_ms_avg": 28.495, "round_trip_ms_max": 33.979, "round_trip_ms_stddev": 4.081, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 24.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 23.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 26.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 24.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 31.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 23.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 23.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 24.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 24.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 31.0}]} diff --git a/tests/fixtures/centos-7.7/ping-hostname-O.json b/tests/fixtures/centos-7.7/ping-hostname-O.json new file mode 100644 index 00000000..3fe3611c --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-hostname-O.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19125.0, "round_trip_ms_min": 27.656, "round_trip_ms_avg": 33.717, "round_trip_ms_max": 36.758, "round_trip_ms_stddev": 2.814, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 35.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 35.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 28.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 35.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 35.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 15}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 36.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 36.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} diff --git a/tests/fixtures/centos-7.7/ping-ip-O-D.json b/tests/fixtures/centos-7.7/ping-ip-O-D.json new file mode 100644 index 00000000..56748367 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-O-D.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19081.0, "round_trip_ms_min": 0.041, "round_trip_ms_avg": 0.048, "round_trip_ms_max": 0.081, "round_trip_ms_stddev": 0.009, "responses": [{"type": "reply", "timestamp": 1595037214.261953, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": 1595037215.264798, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037216.272296, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.047}, {"type": "reply", "timestamp": 1595037217.275851, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.062}, {"type": "reply", "timestamp": 1595037218.284242, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": 1595037219.283712, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595037220.290949, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037221.295962, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037222.30702, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037223.313919, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.081}, {"type": "reply", "timestamp": 1595037224.313679, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595037225.320748, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037226.324322, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": 1595037227.325835, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037228.327028, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037229.329891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": 1595037230.333891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037231.338137, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037232.340475, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037233.343058, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.045}]} diff --git a/tests/fixtures/centos-7.7/ping-ip-O.json b/tests/fixtures/centos-7.7/ping-ip-O.json new file mode 100644 index 00000000..c4d131b0 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-O.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19070.0, "round_trip_ms_min": 0.038, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.08, "round_trip_ms_stddev": 0.011, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.08}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.047}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.04}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.062}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.044}]} diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json new file mode 100644 index 00000000..79d5400e --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19077.0, "round_trip_ms_min": 31.845, "round_trip_ms_avg": 39.274, "round_trip_ms_max": 43.243, "round_trip_ms_stddev": 3.522, "responses": [{"type": "reply", "timestamp": 1594978345.609669, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": 1594978346.58542, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.9}, {"type": "reply", "timestamp": 1594978347.594128, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 42.3}, {"type": "reply", "timestamp": 1594978348.595221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 40.2}, {"type": "reply", "timestamp": 1594978349.600372, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 43.2}, {"type": "reply", "timestamp": 1594978350.590676, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": 1594978351.601527, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 41.8}, {"type": "reply", "timestamp": 1594978352.604195, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 41.7}, {"type": "reply", "timestamp": 1594978353.607212, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 42.0}, {"type": "reply", "timestamp": 1594978354.610771, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 40.7}, {"type": "reply", "timestamp": 1594978355.613729, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 40.4}, {"type": "reply", "timestamp": 1594978356.611887, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": 1594978357.62481, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 40.1}, {"type": "reply", "timestamp": 1594978358.629185, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 42.0}, {"type": "reply", "timestamp": 1594978359.634854, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 41.2}, {"type": "reply", "timestamp": 1594978360.638344, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 40.6}, {"type": "reply", "timestamp": 1594978361.640968, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 40.7}, {"type": "reply", "timestamp": 1594978362.645739, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 39.9}, {"type": "reply", "timestamp": 1594978363.6467, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": 1594978364.650853, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 33.6}]} diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-p.json b/tests/fixtures/centos-7.7/ping6-hostname-O-p.json new file mode 100644 index 00000000..98470612 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19164.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.455, "round_trip_ms_max": 42.652, "round_trip_ms_stddev": 3.338, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 38.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 42.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 39.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 38.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 38.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 39.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 39.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 41.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.4}]} diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json new file mode 100644 index 00000000..2ec21dba --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19074.0, "round_trip_ms_min": 28.15, "round_trip_ms_avg": 33.534, "round_trip_ms_max": 39.843, "round_trip_ms_stddev": 3.489, "responses": [{"type": "reply", "timestamp": 1594976827.240914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.7}, {"type": "reply", "timestamp": 1594976828.25493, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1594976829.252877, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 29.7}, {"type": "reply", "timestamp": 1594976830.262654, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.7}, {"type": "reply", "timestamp": 1594976831.265626, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": 1594976832.269834, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1594976833.268059, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": 1594976834.274292, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.1}, {"type": "reply", "timestamp": 1594976835.287123, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1594976836.287707, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": 1594976837.290589, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": 1594976838.293514, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 35.4}, {"type": "reply", "timestamp": 1594976839.290914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.8}, {"type": "reply", "timestamp": 1594976840.292897, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 28.5}, {"type": "timeout", "timestamp": 1594976842.269238, "icmp_seq": 15}, {"type": "reply", "timestamp": 1594976842.30145, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": 1594976843.312998, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 39.8}, {"type": "reply", "timestamp": 1594976844.314228, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1594976845.315518, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 35.1}, {"type": "reply", "timestamp": 1594976846.321706, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.4}]} diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-p.json b/tests/fixtures/centos-7.7/ping6-ip-O-p.json new file mode 100644 index 00000000..2be892bd --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19067.0, "round_trip_ms_min": 27.064, "round_trip_ms_avg": 33.626, "round_trip_ms_max": 38.146, "round_trip_ms_stddev": 3.803, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 27.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 36.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.3}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 35.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 36.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 36.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.1}]} diff --git a/tests/test_ping.py b/tests/test_ping.py new file mode 100644 index 00000000..6525be63 --- /dev/null +++ b/tests/test_ping.py @@ -0,0 +1,193 @@ +import os +import unittest +import json +import jc.parsers.ping + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) + + +class MyTests(unittest.TestCase): + + def setUp(self): + # input + + # centos + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-O.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-O-D.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_O_D = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O_D_p_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-O-p.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-O-D-p.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_O_D_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_hostname_O_D_p_s = f.read() + + # ubuntu + + # fedora + + # freebsd + + # osx + + + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping.out'), 'r', encoding='utf-8') as f: + # self.ubuntu_18_4_ping = f.read() + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-a2.out'), 'r', encoding='utf-8') as f: + # self.osx_10_14_6_ping_a2 = f.read() + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-a.out'), 'r', encoding='utf-8') as f: + # self.freebsd_ping_a = f.read() + + # output + + # centos + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-O.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-O-D.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_O_D_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_hostname_O_D_p_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-O-p.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-O-D-p.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_O_D_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + + + + + + + + + + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping.json'), 'r', encoding='utf-8') as f: + # self.ubuntu_18_4_ping_json = json.loads(f.read()) + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-a2.json'), 'r', encoding='utf-8') as f: + # self.osx_10_14_6_ping_a2_json = json.loads(f.read()) + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-a.json'), 'r', encoding='utf-8') as f: + # self.freebsd12_ping_a_json = json.loads(f.read()) + + + + + + def test_ping_nodata(self): + """ + Test 'ping' with no data + """ + self.assertEqual(jc.parsers.ping.parse('', quiet=True), {}) + + def test_ping_ip_O_centos_7_7(self): + """ + Test 'ping -O' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O, quiet=True), self.centos_7_7_ping_ip_O_json) + + def test_ping_ip_O_D_centos_7_7(self): + """ + Test 'ping -O -D' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O_D, quiet=True), self.centos_7_7_ping_ip_O_D_json) + + def test_ping_hostname_O_centos_7_7(self): + """ + Test 'ping -O' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O, quiet=True), self.centos_7_7_ping_hostname_O_json) + + def test_ping_hostname_O_p_centos_7_7(self): + """ + Test 'ping -O -p' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_p, quiet=True), self.centos_7_7_ping_hostname_O_p_json) + + def test_ping_hostname_O_D_p_s_centos_7_7(self): + """ + Test 'ping -O -D -p -s' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping_hostname_O_D_p_s_json) + + def test_ping6_ip_O_p_centos_7_7(self): + """ + Test 'ping6 -O -p' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_p, quiet=True), self.centos_7_7_ping6_ip_O_p_json) + + def test_ping6_ip_O_D_p_centos_7_7(self): + """ + Test 'ping6 -O -D -p' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_D_p, quiet=True), self.centos_7_7_ping6_ip_O_D_p_json) + + def test_ping6_hostname_O_p_centos_7_7(self): + """ + Test 'ping6 -O -p' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_p, quiet=True), self.centos_7_7_ping6_hostname_O_p_json) + + def test_ping6_hostname_O_D_p_s_centos_7_7(self): + """ + Test 'ping6 -O -D -p -s' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping6_hostname_O_D_p_s_json) + + # def test_ping_ubuntu_18_4(self): + # """ + # Test 'ping' on Ubuntu 18.4 + # """ + # self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping, quiet=True), self.ubuntu_18_4_ping_json) + + # def test_ping_a_osx_10_14_6(self): + # """ + # Test 'ping -a' on OSX 10.14.6 + # """ + # self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_a, quiet=True), self.osx_10_14_6_ping_a_json) + + # def test_ping_a_freebsd12(self): + # """ + # Test 'ping -a' on FreeBSD12 + # """ + # self.assertEqual(jc.parsers.ping.parse(self.freebsd_ping_a, quiet=True), self.freebsd12_ping_a_json) + + +if __name__ == '__main__': + unittest.main() From b8deb0426cc23333c0e0a9dc3776d9761d99abb0 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 13:51:39 -0700 Subject: [PATCH 16/80] add ubuntu ping tests --- .../ubuntu-18.04/ping-hostname-O-D-p-s.json | 1 + .../ubuntu-18.04/ping-hostname-O-p.json | 1 + .../ubuntu-18.04/ping-hostname-O.json | 1 + tests/fixtures/ubuntu-18.04/ping-ip-O-D.json | 1 + tests/fixtures/ubuntu-18.04/ping-ip-O.json | 1 + .../ubuntu-18.04/ping6-hostname-O-D-p-s.json | 1 + .../ubuntu-18.04/ping6-hostname-O-D-p.json | 1 + .../ubuntu-18.04/ping6-hostname-O-p.json | 1 + .../fixtures/ubuntu-18.04/ping6-ip-O-D-p.json | 1 + tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json | 1 + tests/test_ping.py | 117 ++++++++++++++++-- 11 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json create mode 100644 tests/fixtures/ubuntu-18.04/ping-hostname-O.json create mode 100644 tests/fixtures/ubuntu-18.04/ping-ip-O-D.json create mode 100644 tests/fixtures/ubuntu-18.04/ping-ip-O.json create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json create mode 100644 tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json create mode 100644 tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json create mode 100644 tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json new file mode 100644 index 00000000..6ba36705 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19040.0, "round_trip_ms_min": 26.767, "round_trip_ms_avg": 33.782, "round_trip_ms_max": 44.159, "round_trip_ms_stddev": 3.954, "responses": [{"type": "reply", "timestamp": 1595103464.996693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.7}, {"type": "reply", "timestamp": 1595103466.001289, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": 1595103467.004316, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595103468.009966, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.2}, {"type": "reply", "timestamp": 1595103469.013655, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": 1595103470.014253, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": 1595103471.02653, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 44.1}, {"type": "reply", "timestamp": 1595103472.019493, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1595103473.021432, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1595103474.015603, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 27.4}, {"type": "reply", "timestamp": 1595103475.02676, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 36.9}, {"type": "reply", "timestamp": 1595103476.02693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1595103477.031093, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595103478.028918, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": 1595103479.032238, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1595103480.032097, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": 1595103481.034546, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": 1595103482.037939, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1595103483.041514, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": 1595103484.03911, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 29.3}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json new file mode 100644 index 00000000..7e24bc15 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19052.0, "round_trip_ms_min": 24.785, "round_trip_ms_avg": 41.856, "round_trip_ms_max": 143.789, "round_trip_ms_stddev": 27.768, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 25.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 27.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 32.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 24.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 74.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 85.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 143.0}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O.json new file mode 100644 index 00000000..f6815a10 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19290.0, "round_trip_ms_min": 24.33, "round_trip_ms_avg": 30.42, "round_trip_ms_max": 35.259, "round_trip_ms_stddev": 3.84, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 24.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 26.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 34.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 34.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 27.1}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json new file mode 100644 index 00000000..89cec649 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19452.0, "round_trip_ms_min": 0.017, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": 1595102903.313934, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.017}, {"type": "reply", "timestamp": 1595102904.33341, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.033}, {"type": "reply", "timestamp": 1595102905.35791, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": 1595102906.3814, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.039}, {"type": "reply", "timestamp": 1595102907.406752, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102908.430739, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102909.454753, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102910.478765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102911.50115, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.027}, {"type": "reply", "timestamp": 1595102912.525888, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102913.550088, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102914.574405, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.04}, {"type": "reply", "timestamp": 1595102915.598696, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102916.622554, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.049}, {"type": "reply", "timestamp": 1595102917.646755, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102918.670765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102919.693157, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102920.717034, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "timestamp": 1595102921.741629, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102922.766421, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.05}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O.json b/tests/fixtures/ubuntu-18.04/ping-ip-O.json new file mode 100644 index 00000000..bd15fefb --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19434.0, "round_trip_ms_min": 0.02, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.057, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.02}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.027}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.057}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.049}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json new file mode 100644 index 00000000..09c151fb --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19050.0, "round_trip_ms_min": 25.086, "round_trip_ms_avg": 37.398, "round_trip_ms_max": 162.132, "round_trip_ms_stddev": 28.854, "responses": [{"type": "reply", "timestamp": 1595102963.207191, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 162.0}, {"type": "reply", "timestamp": 1595102964.072572, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 26.2}, {"type": "reply", "timestamp": 1595102965.083093, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": 1595102966.086221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595102967.088365, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.9}, {"type": "reply", "timestamp": 1595102968.090956, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 33.5}, {"type": "reply", "timestamp": 1595102969.088229, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": 1595102970.08863, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 25.0}, {"type": "reply", "timestamp": 1595102971.093828, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": 1595102972.104782, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 35.3}, {"type": "reply", "timestamp": 1595102973.098518, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 27.1}, {"type": "reply", "timestamp": 1595102974.108744, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.0}, {"type": "reply", "timestamp": 1595102975.104919, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.4}, {"type": "reply", "timestamp": 1595102976.103486, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 26.1}, {"type": "reply", "timestamp": 1595102977.107027, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 27.2}, {"type": "reply", "timestamp": 1595102978.111345, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 28.3}, {"type": "reply", "timestamp": 1595102979.121028, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.9}, {"type": "reply", "timestamp": 1595102980.116465, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595102981.126039, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 34.7}, {"type": "reply", "timestamp": 1595102982.12868, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json new file mode 100644 index 00000000..e9888e9d --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "time_ms": 19052.0, "round_trip_ms_min": 24.671, "round_trip_ms_avg": 30.617, "round_trip_ms_max": 33.654, "round_trip_ms_stddev": 3.419, "responses": [{"type": "reply", "timestamp": 1595102982.159725, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.9}, {"type": "reply", "timestamp": 1595102983.167501, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 33.0}, {"type": "reply", "timestamp": 1595102984.169378, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": 1595102985.163818, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": 1595102986.167583, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": 1595102987.175507, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": 1595102988.171549, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 25.8}, {"type": "reply", "timestamp": 1595102989.181855, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595102990.176307, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": 1595102991.188111, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.0}, {"type": "timeout", "timestamp": 1595102993.166385, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102993.198594, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1595102994.201841, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 32.8}, {"type": "timeout", "timestamp": 1595102996.17406, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102996.207576, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": 1595102997.211141, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595102998.210588, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1595102999.20548, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 25.4}, {"type": "reply", "timestamp": 1595103000.216799, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 33.5}, {"type": "reply", "timestamp": 1595103001.217993, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 32.8}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json new file mode 100644 index 00000000..2bdb9d3e --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "time_ms": 19081.0, "round_trip_ms_min": 25.229, "round_trip_ms_avg": 38.451, "round_trip_ms_max": 151.911, "round_trip_ms_stddev": 28.221, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 25.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 27.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 33.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 25.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 25.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.4}, {"type": "timeout", "timestamp": null, "icmp_seq": 18}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 151.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 51.5}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json new file mode 100644 index 00000000..44d96a1f --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 15, "packet_loss_percent": 25.0, "time_ms": 19161.0, "round_trip_ms_min": 21.405, "round_trip_ms_avg": 45.041, "round_trip_ms_max": 159.38, "round_trip_ms_stddev": 38.693, "responses": [{"type": "reply", "timestamp": 1595102942.853155, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": 1595102943.857295, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 29.4}, {"type": "reply", "timestamp": 1595102944.861751, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 31.2}, {"type": "timeout", "timestamp": 1595102946.861681, "icmp_seq": 4}, {"type": "reply", "timestamp": 1595102946.891881, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 30.0}, {"type": "reply", "timestamp": 1595102947.884818, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 22.0}, {"type": "reply", "timestamp": 1595102948.89152, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.2}, {"type": "reply", "timestamp": 1595102949.897424, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 30.5}, {"type": "reply", "timestamp": 1595102950.89982, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.0}, {"type": "reply", "timestamp": 1595102951.905148, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 31.3}, {"type": "timeout", "timestamp": 1595102953.901458, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102953.93159, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 29.9}, {"type": "timeout", "timestamp": 1595102955.918953, "icmp_seq": 13}, {"type": "timeout", "timestamp": 1595102956.942898, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102956.973463, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.4}, {"type": "reply", "timestamp": 1595102957.966655, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 21.4}, {"type": "timeout", "timestamp": 1595102959.981759, "icmp_seq": 17}, {"type": "reply", "timestamp": 1595102960.035095, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 53.2}, {"type": "reply", "timestamp": 1595102961.106079, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 121.0}, {"type": "reply", "timestamp": 1595102962.145647, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 159.0}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json new file mode 100644 index 00000000..7a61a38c --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19046.0, "round_trip_ms_min": 21.403, "round_trip_ms_avg": 24.901, "round_trip_ms_max": 30.176, "round_trip_ms_stddev": 3.056, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 21.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 23.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 21.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 22.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 22.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 29.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 22.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 22.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 22.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 24.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 22.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 24.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 29.9}]} diff --git a/tests/test_ping.py b/tests/test_ping.py index 6525be63..f4e92e97 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -40,6 +40,32 @@ class MyTests(unittest.TestCase): self.centos_7_7_ping6_hostname_O_D_p_s = f.read() # ubuntu + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_ip_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O-D.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_ip_O_D = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O_D_p_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-ip-O-p.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_ip_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_ip_O_D_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_hostname_O_D_p_s = f.read() # fedora @@ -47,10 +73,9 @@ class MyTests(unittest.TestCase): # osx - - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping.out'), 'r', encoding='utf-8') as f: - # self.ubuntu_18_4_ping = f.read() + + # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-a2.out'), 'r', encoding='utf-8') as f: # self.osx_10_14_6_ping_a2 = f.read() @@ -88,6 +113,34 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: self.centos_7_7_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + # ubunutu + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_ip_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O-D.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_ip_O_D_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping_hostname_O_D_p_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_ip_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_ip_O_D_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.ubuntu_18_4_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + @@ -170,11 +223,59 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping6_hostname_O_D_p_s_json) - # def test_ping_ubuntu_18_4(self): - # """ - # Test 'ping' on Ubuntu 18.4 - # """ - # self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping, quiet=True), self.ubuntu_18_4_ping_json) + def test_ping_ip_O_ubuntu_18_4(self): + """ + Test 'ping -O' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping_ip_O, quiet=True), self.ubuntu_18_4_ping_ip_O_json) + + def test_ping_ip_O_D_ubuntu_18_4(self): + """ + Test 'ping -O -D' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping_ip_O_D, quiet=True), self.ubuntu_18_4_ping_ip_O_D_json) + + def test_ping_hostname_O_ubuntu_18_4(self): + """ + Test 'ping -O' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping_hostname_O, quiet=True), self.ubuntu_18_4_ping_hostname_O_json) + + def test_ping_hostname_O_p_ubuntu_18_4(self): + """ + Test 'ping -O -p' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping_hostname_O_p, quiet=True), self.ubuntu_18_4_ping_hostname_O_p_json) + + def test_ping_hostname_O_D_p_s_ubuntu_18_4(self): + """ + Test 'ping -O -D -p -s' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping_hostname_O_D_p_s, quiet=True), self.ubuntu_18_4_ping_hostname_O_D_p_s_json) + + def test_ping6_ip_O_p_ubuntu_18_4(self): + """ + Test 'ping6 -O -p' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_ip_O_p, quiet=True), self.ubuntu_18_4_ping6_ip_O_p_json) + + def test_ping6_ip_O_D_p_ubuntu_18_4(self): + """ + Test 'ping6 -O -D -p' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_ip_O_D_p, quiet=True), self.ubuntu_18_4_ping6_ip_O_D_p_json) + + def test_ping6_hostname_O_p_ubuntu_18_4(self): + """ + Test 'ping6 -O -p' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_hostname_O_p, quiet=True), self.ubuntu_18_4_ping6_hostname_O_p_json) + + def test_ping6_hostname_O_D_p_s_ubuntu_18_4(self): + """ + Test 'ping6 -O -D -p -s' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_hostname_O_D_p_s, quiet=True), self.ubuntu_18_4_ping6_hostname_O_D_p_s_json) # def test_ping_a_osx_10_14_6(self): # """ From 19ecf1fa19e9fa0873002baf07fa670b71ed7752 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 14:35:41 -0700 Subject: [PATCH 17/80] add Fedora32 tests --- .../fedora32/ping-hostname-O-D-p-s.json | 1 + .../fixtures/fedora32/ping-hostname-O-p.json | 1 + tests/fixtures/fedora32/ping-hostname-O.json | 1 + tests/fixtures/fedora32/ping-ip-O-D.json | 1 + tests/fixtures/fedora32/ping-ip-O.json | 1 + .../fedora32/ping6-hostname-O-D-p-s.json | 1 + .../fedora32/ping6-hostname-O-D-p.json | 1 + .../fixtures/fedora32/ping6-hostname-O-p.json | 1 + tests/fixtures/fedora32/ping6-ip-O-D-p.json | 1 + tests/fixtures/fedora32/ping6-ip-O-p.json | 1 + tests/test_ping.py | 108 ++++++++++++++++++ 11 files changed, 118 insertions(+) create mode 100644 tests/fixtures/fedora32/ping-hostname-O-D-p-s.json create mode 100644 tests/fixtures/fedora32/ping-hostname-O-p.json create mode 100644 tests/fixtures/fedora32/ping-hostname-O.json create mode 100644 tests/fixtures/fedora32/ping-ip-O-D.json create mode 100644 tests/fixtures/fedora32/ping-ip-O.json create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-D-p.json create mode 100644 tests/fixtures/fedora32/ping6-hostname-O-p.json create mode 100644 tests/fixtures/fedora32/ping6-ip-O-D-p.json create mode 100644 tests/fixtures/fedora32/ping6-ip-O-p.json diff --git a/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json new file mode 100644 index 00000000..47063430 --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.129.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19040.0, "round_trip_ms_min": 25.934, "round_trip_ms_avg": 43.176, "round_trip_ms_max": 149.271, "round_trip_ms_stddev": 26.937, "responses": [{"type": "reply", "timestamp": 1595191335.548399, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 46.1}, {"type": "reply", "timestamp": 1595191336.134174, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 61.5}, {"type": "reply", "timestamp": 1595191337.101575, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": 1595191338.108023, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": 1595191339.229213, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 149.0}, {"type": "reply", "timestamp": 1595191340.114026, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": 1595191341.122628, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 37.9}, {"type": "reply", "timestamp": 1595191342.110785, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 26.0}, {"type": "reply", "timestamp": 1595191343.118652, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.3}, {"type": "reply", "timestamp": 1595191344.1303, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 43.4}, {"type": "reply", "timestamp": 1595191345.162284, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 71.9}, {"type": "reply", "timestamp": 1595191346.123086, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 31.1}, {"type": "reply", "timestamp": 1595191347.127689, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595191348.142817, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 45.6}, {"type": "reply", "timestamp": 1595191349.125383, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 25.9}, {"type": "reply", "timestamp": 1595191350.136294, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": 1595191351.135889, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 31.2}, {"type": "reply", "timestamp": 1595191352.134199, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.2}, {"type": "reply", "timestamp": 1595191353.147391, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 38.5}, {"type": "reply", "timestamp": 1595191354.15064, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 39.5}]} diff --git a/tests/fixtures/fedora32/ping-hostname-O-p.json b/tests/fixtures/fedora32/ping-hostname-O-p.json new file mode 100644 index 00000000..4c2ae75c --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.197.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19026.0, "round_trip_ms_min": 37.406, "round_trip_ms_avg": 44.894, "round_trip_ms_max": 57.881, "round_trip_ms_stddev": 6.101, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 1, "ttl": 56, "time_ms": 38.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 2, "ttl": 56, "time_ms": 38.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 3, "ttl": 56, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 4, "ttl": 56, "time_ms": 49.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 5, "ttl": 56, "time_ms": 47.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 6, "ttl": 56, "time_ms": 48.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 7, "ttl": 56, "time_ms": 53.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 8, "ttl": 56, "time_ms": 47.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 9, "ttl": 56, "time_ms": 47.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 10, "ttl": 56, "time_ms": 51.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 11, "ttl": 56, "time_ms": 55.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 12, "ttl": 56, "time_ms": 40.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 13, "ttl": 56, "time_ms": 39.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 14, "ttl": 56, "time_ms": 40.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 15, "ttl": 56, "time_ms": 41.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 16, "ttl": 56, "time_ms": 57.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 17, "ttl": 56, "time_ms": 45.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 18, "ttl": 56, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 19, "ttl": 56, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 20, "ttl": 56, "time_ms": 40.4}]} diff --git a/tests/fixtures/fedora32/ping-hostname-O.json b/tests/fixtures/fedora32/ping-hostname-O.json new file mode 100644 index 00000000..37177ec7 --- /dev/null +++ b/tests/fixtures/fedora32/ping-hostname-O.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19075.0, "round_trip_ms_min": 24.317, "round_trip_ms_avg": 61.577, "round_trip_ms_max": 274.537, "round_trip_ms_stddev": 69.94, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 27.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 31.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 25.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 65.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 156.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 216.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 275.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 29.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 25.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 24.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 24.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 45.8}]} diff --git a/tests/fixtures/fedora32/ping-ip-O-D.json b/tests/fixtures/fedora32/ping-ip-O-D.json new file mode 100644 index 00000000..d3a126eb --- /dev/null +++ b/tests/fixtures/fedora32/ping-ip-O-D.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19450.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.086, "round_trip_ms_max": 0.135, "round_trip_ms_stddev": 0.016, "responses": [{"type": "reply", "timestamp": 1595191373.643436, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595191374.662543, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.083}, {"type": "reply", "timestamp": 1595191375.685291, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.091}, {"type": "reply", "timestamp": 1595191376.709678, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.092}, {"type": "reply", "timestamp": 1595191377.734105, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": 1595191378.758107, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": 1595191379.781215, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191380.80601, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.092}, {"type": "reply", "timestamp": 1595191381.829806, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.088}, {"type": "reply", "timestamp": 1595191382.853166, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.135}, {"type": "reply", "timestamp": 1595191383.876966, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.101}, {"type": "reply", "timestamp": 1595191384.900636, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.084}, {"type": "reply", "timestamp": 1595191385.925055, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.071}, {"type": "reply", "timestamp": 1595191386.94986, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191387.973041, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191388.997049, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.073}, {"type": "reply", "timestamp": 1595191390.021265, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.074}, {"type": "reply", "timestamp": 1595191391.044904, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": 1595191392.069285, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": 1595191393.093307, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.084}]} diff --git a/tests/fixtures/fedora32/ping-ip-O.json b/tests/fixtures/fedora32/ping-ip-O.json new file mode 100644 index 00000000..153ee351 --- /dev/null +++ b/tests/fixtures/fedora32/ping-ip-O.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19480.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.093, "round_trip_ms_max": 0.16, "round_trip_ms_stddev": 0.025, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.07}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.093}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.078}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.16}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.155}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.084}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.111}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.079}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.103}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.105}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.081}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.092}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json new file mode 100644 index 00000000..8f827d0f --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:200::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19042.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.536, "round_trip_ms_max": 59.021, "round_trip_ms_stddev": 5.967, "responses": [{"type": "reply", "timestamp": 1595191433.391154, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595191434.063086, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1595191435.071905, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 3, "ttl": 59, "time_ms": 44.3}, {"type": "reply", "timestamp": 1595191436.067128, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1595191437.06455, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": 1595191438.06541, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 6, "ttl": 59, "time_ms": 30.8}, {"type": "reply", "timestamp": 1595191439.076718, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 7, "ttl": 59, "time_ms": 40.6}, {"type": "reply", "timestamp": 1595191440.076357, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 8, "ttl": 59, "time_ms": 38.2}, {"type": "reply", "timestamp": 1595191441.079078, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.0}, {"type": "reply", "timestamp": 1595191442.077537, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.3}, {"type": "reply", "timestamp": 1595191443.104345, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 11, "ttl": 59, "time_ms": 59.0}, {"type": "reply", "timestamp": 1595191444.083741, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595191445.086748, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 13, "ttl": 59, "time_ms": 37.6}, {"type": "reply", "timestamp": 1595191446.088958, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1595191447.086122, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": 1595191448.088312, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 16, "ttl": 59, "time_ms": 30.8}, {"type": "reply", "timestamp": 1595191449.098353, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": 1595191450.09959, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.1}, {"type": "reply", "timestamp": 1595191451.10105, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.8}, {"type": "reply", "timestamp": 1595191452.100239, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.0}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p.json b/tests/fixtures/fedora32/ping6-hostname-O-D-p.json new file mode 100644 index 00000000..5aa98747 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:2e::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19043.0, "round_trip_ms_min": 38.533, "round_trip_ms_avg": 44.877, "round_trip_ms_max": 51.366, "round_trip_ms_stddev": 3.83, "responses": [{"type": "reply", "timestamp": 1595191452.2553, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 1, "ttl": 56, "time_ms": 39.1}, {"type": "reply", "timestamp": 1595191453.229184, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 2, "ttl": 56, "time_ms": 47.9}, {"type": "reply", "timestamp": 1595191454.229065, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 3, "ttl": 56, "time_ms": 46.4}, {"type": "reply", "timestamp": 1595191455.230571, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 4, "ttl": 56, "time_ms": 45.1}, {"type": "reply", "timestamp": 1595191456.233811, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 5, "ttl": 56, "time_ms": 45.7}, {"type": "reply", "timestamp": 1595191457.228052, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 6, "ttl": 56, "time_ms": 38.9}, {"type": "reply", "timestamp": 1595191458.228764, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 7, "ttl": 56, "time_ms": 39.0}, {"type": "reply", "timestamp": 1595191459.243633, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 8, "ttl": 56, "time_ms": 51.4}, {"type": "reply", "timestamp": 1595191460.243509, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 9, "ttl": 56, "time_ms": 49.1}, {"type": "reply", "timestamp": 1595191461.242713, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 10, "ttl": 56, "time_ms": 46.6}, {"type": "reply", "timestamp": 1595191462.246016, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 11, "ttl": 56, "time_ms": 47.1}, {"type": "reply", "timestamp": 1595191463.240552, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 12, "ttl": 56, "time_ms": 38.6}, {"type": "reply", "timestamp": 1595191464.248594, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 13, "ttl": 56, "time_ms": 44.3}, {"type": "reply", "timestamp": 1595191465.254128, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 14, "ttl": 56, "time_ms": 48.8}, {"type": "reply", "timestamp": 1595191466.253777, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 15, "ttl": 56, "time_ms": 45.2}, {"type": "reply", "timestamp": 1595191467.259039, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 16, "ttl": 56, "time_ms": 47.3}, {"type": "reply", "timestamp": 1595191468.252991, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 17, "ttl": 56, "time_ms": 38.5}, {"type": "reply", "timestamp": 1595191469.263167, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 18, "ttl": 56, "time_ms": 47.0}, {"type": "reply", "timestamp": 1595191470.264838, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 19, "ttl": 56, "time_ms": 46.3}, {"type": "reply", "timestamp": 1595191471.266951, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 20, "ttl": 56, "time_ms": 45.4}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-p.json b/tests/fixtures/fedora32/ping6-hostname-O-p.json new file mode 100644 index 00000000..2727f004 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-hostname-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:400::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19049.0, "round_trip_ms_min": 23.598, "round_trip_ms_avg": 65.877, "round_trip_ms_max": 281.064, "round_trip_ms_stddev": 72.64, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 1, "ttl": 59, "time_ms": 24.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 4, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 8, "ttl": 59, "time_ms": 31.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 9, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 10, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 11, "ttl": 59, "time_ms": 31.0}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 13, "ttl": 59, "time_ms": 31.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 14, "ttl": 59, "time_ms": 112.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 15, "ttl": 59, "time_ms": 162.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 16, "ttl": 59, "time_ms": 223.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 17, "ttl": 59, "time_ms": 281.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 18, "ttl": 59, "time_ms": 33.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 20, "ttl": 59, "time_ms": 42.3}]} diff --git a/tests/fixtures/fedora32/ping6-ip-O-D-p.json b/tests/fixtures/fedora32/ping6-ip-O-D-p.json new file mode 100644 index 00000000..8240f3f0 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-ip-O-D-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19042.0, "round_trip_ms_min": 27.88, "round_trip_ms_avg": 45.072, "round_trip_ms_max": 148.38, "round_trip_ms_stddev": 27.078, "responses": [{"type": "reply", "timestamp": 1595191413.333769, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595191414.342973, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 41.9}, {"type": "reply", "timestamp": 1595191415.332214, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595191416.342603, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595191417.344996, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 37.6}, {"type": "reply", "timestamp": 1595191418.348619, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 37.9}, {"type": "reply", "timestamp": 1595191419.357154, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 44.4}, {"type": "reply", "timestamp": 1595191420.350087, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.1}, {"type": "reply", "timestamp": 1595191421.346691, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": 1595191422.355843, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": 1595191423.397934, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 76.7}, {"type": "reply", "timestamp": 1595191424.470798, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 148.0}, {"type": "reply", "timestamp": 1595191425.358652, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595191426.404587, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 77.2}, {"type": "reply", "timestamp": 1595191427.359785, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 29.7}, {"type": "reply", "timestamp": 1595191428.367539, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1595191429.372551, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1595191430.364571, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 27.9}, {"type": "reply", "timestamp": 1595191431.375232, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.1}, {"type": "reply", "timestamp": 1595191432.375802, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} diff --git a/tests/fixtures/fedora32/ping6-ip-O-p.json b/tests/fixtures/fedora32/ping6-ip-O-p.json new file mode 100644 index 00000000..bffb4e06 --- /dev/null +++ b/tests/fixtures/fedora32/ping6-ip-O-p.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 17, "packet_loss_percent": 15.0, "time_ms": 19193.0, "round_trip_ms_min": 26.566, "round_trip_ms_avg": 33.623, "round_trip_ms_max": 43.945, "round_trip_ms_stddev": 5.029, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.6}, {"type": "timeout", "timestamp": null, "icmp_seq": 3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 39.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 28.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.0}, {"type": "timeout", "timestamp": null, "icmp_seq": 16}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 43.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 37.9}]} diff --git a/tests/test_ping.py b/tests/test_ping.py index f4e92e97..b2398016 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -68,6 +68,32 @@ class MyTests(unittest.TestCase): self.ubuntu_18_4_ping6_hostname_O_D_p_s = f.read() # fedora + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-ip-O.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping_ip_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-ip-O-D.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping_ip_O_D = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O_D_p_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-ip-O-p.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_ip_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-ip-O-D-p.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_ip_O_D_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-hostname-O-p.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_hostname_O_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_hostname_O_D_p_s = f.read() # freebsd @@ -141,6 +167,34 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + # fedora + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-ip-O.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping_ip_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-ip-O-D.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping_ip_O_D_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping_hostname_O_D_p_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-ip-O-p.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_ip_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-ip-O-D-p.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_ip_O_D_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-hostname-O-p.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_hostname_O_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: + self.fedora32_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + @@ -277,6 +331,60 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_hostname_O_D_p_s, quiet=True), self.ubuntu_18_4_ping6_hostname_O_D_p_s_json) + def test_ping_ip_O_fedora32(self): + """ + Test 'ping -O' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O, quiet=True), self.centos_7_7_ping_ip_O_json) + + def test_ping_ip_O_D_fedora32(self): + """ + Test 'ping -O -D' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O_D, quiet=True), self.centos_7_7_ping_ip_O_D_json) + + def test_ping_hostname_O_fedora32(self): + """ + Test 'ping -O' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O, quiet=True), self.centos_7_7_ping_hostname_O_json) + + def test_ping_hostname_O_p_fedora32(self): + """ + Test 'ping -O -p' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_p, quiet=True), self.centos_7_7_ping_hostname_O_p_json) + + def test_ping_hostname_O_D_p_s_fedora32(self): + """ + Test 'ping -O -D -p -s' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping_hostname_O_D_p_s_json) + + def test_ping6_ip_O_p_fedora32(self): + """ + Test 'ping6 -O -p' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_p, quiet=True), self.centos_7_7_ping6_ip_O_p_json) + + def test_ping6_ip_O_D_p_fedora32(self): + """ + Test 'ping6 -O -D -p' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_D_p, quiet=True), self.centos_7_7_ping6_ip_O_D_p_json) + + def test_ping6_hostname_O_p_fedora32(self): + """ + Test 'ping6 -O -p' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_p, quiet=True), self.centos_7_7_ping6_hostname_O_p_json) + + def test_ping6_hostname_O_D_p_s_fedora32(self): + """ + Test 'ping6 -O -D -p -s' on fedora32 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping6_hostname_O_D_p_s_json) + # def test_ping_a_osx_10_14_6(self): # """ # Test 'ping -a' on OSX 10.14.6 From c203664eb5aafa0afa3101b79e3fd13b3e009ec5 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 15:46:27 -0700 Subject: [PATCH 18/80] freebsd ping tests --- tests/fixtures/freebsd12/ping-hostname-p.json | 1 + tests/fixtures/freebsd12/ping-hostname-s.json | 1 + tests/fixtures/freebsd12/ping-hostname.json | 1 + tests/fixtures/freebsd12/ping-ip-p.json | 1 + tests/fixtures/freebsd12/ping-ip-s.json | 1 + tests/fixtures/freebsd12/ping-ip.json | 1 + .../fixtures/freebsd12/ping6-hostname-p.json | 1 + .../fixtures/freebsd12/ping6-hostname-s.json | 1 + tests/fixtures/freebsd12/ping6-hostname.json | 1 + tests/fixtures/freebsd12/ping6-ip-p.json | 1 + tests/fixtures/freebsd12/ping6-ip-s.json | 1 + tests/fixtures/freebsd12/ping6-ip.json | 1 + tests/test_ping.py | 168 +++++++++++++++++- 13 files changed, 171 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/freebsd12/ping-hostname-p.json create mode 100644 tests/fixtures/freebsd12/ping-hostname-s.json create mode 100644 tests/fixtures/freebsd12/ping-hostname.json create mode 100644 tests/fixtures/freebsd12/ping-ip-p.json create mode 100644 tests/fixtures/freebsd12/ping-ip-s.json create mode 100644 tests/fixtures/freebsd12/ping-ip.json create mode 100644 tests/fixtures/freebsd12/ping6-hostname-p.json create mode 100644 tests/fixtures/freebsd12/ping6-hostname-s.json create mode 100644 tests/fixtures/freebsd12/ping6-hostname.json create mode 100644 tests/fixtures/freebsd12/ping6-ip-p.json create mode 100644 tests/fixtures/freebsd12/ping6-ip-s.json create mode 100644 tests/fixtures/freebsd12/ping6-ip.json diff --git a/tests/fixtures/freebsd12/ping-hostname-p.json b/tests/fixtures/freebsd12/ping-hostname-p.json new file mode 100644 index 00000000..1939bff6 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname-p.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 28.389, "round_trip_ms_avg": 31.745, "round_trip_ms_max": 34.505, "round_trip_ms_stddev": 2.532, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 32.34}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.505}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.389}]} diff --git a/tests/fixtures/freebsd12/ping-hostname-s.json b/tests/fixtures/freebsd12/ping-hostname-s.json new file mode 100644 index 00000000..4d7cc535 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname-s.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.03, "round_trip_ms_max": 0.038, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.03}]} diff --git a/tests/fixtures/freebsd12/ping-hostname.json b/tests/fixtures/freebsd12/ping-hostname.json new file mode 100644 index 00000000..b2ee156b --- /dev/null +++ b/tests/fixtures/freebsd12/ping-hostname.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.65.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 27.01, "round_trip_ms_avg": 33.831, "round_trip_ms_max": 42.506, "round_trip_ms_stddev": 6.461, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 0, "ttl": 59, "time_ms": 27.01}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.978}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 2, "ttl": 59, "time_ms": 42.506}]} diff --git a/tests/fixtures/freebsd12/ping-ip-p.json b/tests/fixtures/freebsd12/ping-ip-p.json new file mode 100644 index 00000000..52e94526 --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip-p.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.037, "round_trip_ms_max": 0.042, "round_trip_ms_stddev": 0.003, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.042}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.034}]} diff --git a/tests/fixtures/freebsd12/ping-ip-s.json b/tests/fixtures/freebsd12/ping-ip-s.json new file mode 100644 index 00000000..774da68b --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip-s.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.024, "round_trip_ms_avg": 0.032, "round_trip_ms_max": 0.036, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.024}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.036}]} diff --git a/tests/fixtures/freebsd12/ping-ip.json b/tests/fixtures/freebsd12/ping-ip.json new file mode 100644 index 00000000..1fd3fffa --- /dev/null +++ b/tests/fixtures/freebsd12/ping-ip.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.033, "round_trip_ms_max": 0.041, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.041}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname-p.json b/tests/fixtures/freebsd12/ping6-hostname-p.json new file mode 100644 index 00000000..b7d1b245 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname-p.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname-s.json b/tests/fixtures/freebsd12/ping6-hostname-s.json new file mode 100644 index 00000000..13373439 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname-s.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.035, "round_trip_ms_avg": 0.056, "round_trip_ms_max": 0.082, "round_trip_ms_stddev": 0.019, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.035}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.082}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.051}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname.json b/tests/fixtures/freebsd12/ping6-hostname.json new file mode 100644 index 00000000..ea2b09fb --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-hostname.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.042, "round_trip_ms_max": 0.048, "round_trip_ms_stddev": 0.005, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}]} diff --git a/tests/fixtures/freebsd12/ping6-ip-p.json b/tests/fixtures/freebsd12/ping6-ip-p.json new file mode 100644 index 00000000..148a6ac3 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip-p.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.054, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.054}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045}]} diff --git a/tests/fixtures/freebsd12/ping6-ip-s.json b/tests/fixtures/freebsd12/ping6-ip-s.json new file mode 100644 index 00000000..79e07fc3 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip-s.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.058, "round_trip_ms_max": 0.088, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.088}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.049}]} diff --git a/tests/fixtures/freebsd12/ping6-ip.json b/tests/fixtures/freebsd12/ping6-ip.json new file mode 100644 index 00000000..a8e48e12 --- /dev/null +++ b/tests/fixtures/freebsd12/ping6-ip.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.053, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.034}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.053}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045}]} diff --git a/tests/test_ping.py b/tests/test_ping.py index b2398016..d78a3e74 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -96,6 +96,45 @@ class MyTests(unittest.TestCase): self.fedora32_ping6_hostname_O_D_p_s = f.read() # freebsd + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname-p.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname-s.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip-p.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip-s.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname-p.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname-s.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip-p.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip-s.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip.out'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip = f.read() + + + + # osx @@ -195,6 +234,42 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: self.fedora32_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + # freebsd + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname-p.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname-s.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-hostname.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_hostname_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip-p.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip-s.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-ip.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping_ip_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname-p.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname-s.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-hostname.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_hostname_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip-p.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip_p_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip-s.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip_s_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip.json'), 'r', encoding='utf-8') as f: + self.freebsd12_ping6_ip_json = json.loads(f.read()) @@ -335,55 +410,130 @@ class MyTests(unittest.TestCase): """ Test 'ping -O' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O, quiet=True), self.centos_7_7_ping_ip_O_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping_ip_O, quiet=True), self.fedora32_ping_ip_O_json) def test_ping_ip_O_D_fedora32(self): """ Test 'ping -O -D' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_O_D, quiet=True), self.centos_7_7_ping_ip_O_D_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping_ip_O_D, quiet=True), self.fedora32_ping_ip_O_D_json) def test_ping_hostname_O_fedora32(self): """ Test 'ping -O' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O, quiet=True), self.centos_7_7_ping_hostname_O_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping_hostname_O, quiet=True), self.fedora32_ping_hostname_O_json) def test_ping_hostname_O_p_fedora32(self): """ Test 'ping -O -p' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_p, quiet=True), self.centos_7_7_ping_hostname_O_p_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping_hostname_O_p, quiet=True), self.fedora32_ping_hostname_O_p_json) def test_ping_hostname_O_D_p_s_fedora32(self): """ Test 'ping -O -D -p -s' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping_hostname_O_D_p_s_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping_hostname_O_D_p_s, quiet=True), self.fedora32_ping_hostname_O_D_p_s_json) def test_ping6_ip_O_p_fedora32(self): """ Test 'ping6 -O -p' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_p, quiet=True), self.centos_7_7_ping6_ip_O_p_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping6_ip_O_p, quiet=True), self.fedora32_ping6_ip_O_p_json) def test_ping6_ip_O_D_p_fedora32(self): """ Test 'ping6 -O -D -p' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_O_D_p, quiet=True), self.centos_7_7_ping6_ip_O_D_p_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping6_ip_O_D_p, quiet=True), self.fedora32_ping6_ip_O_D_p_json) def test_ping6_hostname_O_p_fedora32(self): """ Test 'ping6 -O -p' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_p, quiet=True), self.centos_7_7_ping6_hostname_O_p_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping6_hostname_O_p, quiet=True), self.fedora32_ping6_hostname_O_p_json) def test_ping6_hostname_O_D_p_s_fedora32(self): """ Test 'ping6 -O -D -p -s' on fedora32 """ - self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping6_hostname_O_D_p_s_json) + self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping6_hostname_O_D_p_s, quiet=True), self.fedora32_ping6_hostname_O_D_p_s_json) + + + + + def test_ping_hostname_p_freebsd12(self): + """ + Test 'ping -p' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_hostname_p, quiet=True), self.freebsd12_ping_hostname_p_json) + + def test_ping_hostname_s_freebsd12(self): + """ + Test 'ping -s' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_hostname_s, quiet=True), self.freebsd12_ping_hostname_s_json) + + def test_ping_ping_hostname_freebsd12(self): + """ + Test 'ping ' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_hostname, quiet=True), self.freebsd12_ping_hostname_json) + + def test_ping_ip_p_freebsd12(self): + """ + Test 'ping -p' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_ip_p, quiet=True), self.freebsd12_ping_ip_p_json) + + def test_ping_ip_s_freebsd12(self): + """ + Test 'ping -s' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_ip_s, quiet=True), self.freebsd12_ping_ip_s_json) + + def test_ping_ip_freebsd12(self): + """ + Test 'ping6 ' on freebsd127 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping_ip, quiet=True), self.freebsd12_ping_ip_json) + + def test_ping6_hostname_p_freebsd12(self): + """ + Test 'ping6 -p' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_hostname_p, quiet=True), self.freebsd12_ping6_hostname_p_json) + + def test_ping6_hostname_s_freebsd12(self): + """ + Test 'ping6 -s' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_hostname_s, quiet=True), self.freebsd12_ping6_hostname_s_json) + + def test_ping6_hostname_freebsd12(self): + """ + Test 'ping6 ' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_hostname, quiet=True), self.freebsd12_ping6_hostname_json) + + def test_ping6_ip_p_freebsd12(self): + """ + Test 'ping6 -p' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_ip_p, quiet=True), self.freebsd12_ping6_ip_p_json) + + def test_ping6_ip_s_freebsd12(self): + """ + Test 'ping6 -s' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_ip_s, quiet=True), self.freebsd12_ping6_ip_s_json) + + def test_ping6_ip_freebsd12(self): + """ + Test 'ping6 ' on freebsd12 + """ + self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_ip, quiet=True), self.freebsd12_ping6_ip_json) # def test_ping_a_osx_10_14_6(self): # """ From d6dc7f5e65c097895c19000e59e8803a3b350fdc Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 16:11:18 -0700 Subject: [PATCH 19/80] add osx ping tests --- .../fixtures/osx-10.14.6/ping-hostname-p.json | 1 + .../fixtures/osx-10.14.6/ping-hostname-s.json | 1 + tests/fixtures/osx-10.14.6/ping-hostname.json | 1 + tests/fixtures/osx-10.14.6/ping-ip-p.json | 1 + tests/fixtures/osx-10.14.6/ping-ip-s.json | 1 + tests/fixtures/osx-10.14.6/ping-ip.json | 1 + .../osx-10.14.6/ping6-hostname-p.json | 1 + .../osx-10.14.6/ping6-hostname-s.json | 1 + .../fixtures/osx-10.14.6/ping6-hostname.json | 1 + tests/fixtures/osx-10.14.6/ping6-ip-p.json | 1 + tests/fixtures/osx-10.14.6/ping6-ip-s.json | 1 + tests/fixtures/osx-10.14.6/ping6-ip.json | 1 + tests/test_ping.py | 156 ++++++++++++++---- 13 files changed, 137 insertions(+), 31 deletions(-) create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname-p.json create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname-s.json create mode 100644 tests/fixtures/osx-10.14.6/ping-hostname.json create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-p.json create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-s.json create mode 100644 tests/fixtures/osx-10.14.6/ping-ip.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname-p.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname-s.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-hostname.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-p.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-s.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip.json diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-p.json b/tests/fixtures/osx-10.14.6/ping-hostname-p.json new file mode 100644 index 00000000..339cd958 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname-p.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 89.422, "round_trip_ms_avg": 118.033, "round_trip_ms_max": 147.964, "round_trip_ms_stddev": 23.918, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 89.422}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 116.712}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 147.964}]} diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-s.json b/tests/fixtures/osx-10.14.6/ping-hostname-s.json new file mode 100644 index 00000000..ea60e894 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname-s.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.1.67", "data_bytes": 1400, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 29.954, "round_trip_ms_avg": 39.892, "round_trip_ms_max": 50.674, "round_trip_ms_stddev": 8.48, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 39.048}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.954}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 50.674}]} diff --git a/tests/fixtures/osx-10.14.6/ping-hostname.json b/tests/fixtures/osx-10.14.6/ping-hostname.json new file mode 100644 index 00000000..d0be6a4e --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-hostname.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 28.042, "round_trip_ms_avg": 34.67, "round_trip_ms_max": 41.182, "round_trip_ms_stddev": 5.365, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 28.042}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.786}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 41.182}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip-p.json b/tests/fixtures/osx-10.14.6/ping-ip-p.json new file mode 100644 index 00000000..6510c853 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-p.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.078, "round_trip_ms_max": 0.104, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.104}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.079}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip-s.json b/tests/fixtures/osx-10.14.6/ping-ip-s.json new file mode 100644 index 00000000..2334c21a --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-s.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 1400, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.053, "round_trip_ms_avg": 0.083, "round_trip_ms_max": 0.108, "round_trip_ms_stddev": 0.023, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.053}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.108}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.089}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip.json b/tests/fixtures/osx-10.14.6/ping-ip.json new file mode 100644 index 00000000..baa476ac --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip.json @@ -0,0 +1 @@ +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.066, "round_trip_ms_max": 0.095, "round_trip_ms_stddev": 0.021, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.095}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.05}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-p.json b/tests/fixtures/osx-10.14.6/ping6-hostname-p.json new file mode 100644 index 00000000..e7135a70 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-p.json @@ -0,0 +1 @@ +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 32.992, "round_trip_ms_avg": 34.606, "round_trip_ms_max": 36.07, "round_trip_ms_stddev": 1.261, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 32.992}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.757}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.07}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-s.json b/tests/fixtures/osx-10.14.6/ping6-hostname-s.json new file mode 100644 index 00000000..19bd2313 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-s.json @@ -0,0 +1 @@ +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:600::323", "data_bytes": 128, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 25.933, "round_trip_ms_avg": 38.979, "round_trip_ms_max": 64.712, "round_trip_ms_stddev": 18.197, "responses": [{"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 0, "ttl": 59, "time_ms": 26.292}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 64.712}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 25.933}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname.json b/tests/fixtures/osx-10.14.6/ping6-hostname.json new file mode 100644 index 00000000..f37669f5 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-hostname.json @@ -0,0 +1 @@ +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 27.684, "round_trip_ms_avg": 29.836, "round_trip_ms_max": 31.824, "round_trip_ms_stddev": 1.694, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 27.684}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 31.824}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.0}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-p.json b/tests/fixtures/osx-10.14.6/ping6-ip-p.json new file mode 100644 index 00000000..fdc04dca --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-p.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.077, "round_trip_ms_avg": 0.124, "round_trip_ms_max": 0.156, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.077}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.156}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.139}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-s.json b/tests/fixtures/osx-10.14.6/ping6-ip-s.json new file mode 100644 index 00000000..4ed7adda --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-s.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 1448, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.093, "round_trip_ms_avg": 0.135, "round_trip_ms_max": 0.161, "round_trip_ms_stddev": 0.03, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.093}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.161}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.152}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip.json b/tests/fixtures/osx-10.14.6/ping6-ip.json new file mode 100644 index 00000000..929fca43 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip.json @@ -0,0 +1 @@ +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.071, "round_trip_ms_avg": 0.115, "round_trip_ms_max": 0.153, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.071}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.153}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.122}]} diff --git a/tests/test_ping.py b/tests/test_ping.py index d78a3e74..f16bdcf8 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -132,21 +132,42 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip.out'), 'r', encoding='utf-8') as f: self.freebsd12_ping6_ip = f.read() - - - - # osx + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-p.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname_p = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-s.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname_s = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-p.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_p = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-s.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_s = f.read() - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-a2.out'), 'r', encoding='utf-8') as f: - # self.osx_10_14_6_ping_a2 = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip = f.read() - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-a.out'), 'r', encoding='utf-8') as f: - # self.freebsd_ping_a = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-p.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-s.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-p.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_p = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-s.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_s = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip = f.read() # output @@ -271,26 +292,42 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping6-ip.json'), 'r', encoding='utf-8') as f: self.freebsd12_ping6_ip_json = json.loads(f.read()) + # osx: + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-p.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname_p_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-s.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname_s_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_hostname_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-p.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_p_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-s.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_s_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-p.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname_p_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-s.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname_s_json = json.loads(f.read()) - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping.json'), 'r', encoding='utf-8') as f: - # self.ubuntu_18_4_ping_json = json.loads(f.read()) - - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-a2.json'), 'r', encoding='utf-8') as f: - # self.osx_10_14_6_ping_a2_json = json.loads(f.read()) - - # with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/ping-a.json'), 'r', encoding='utf-8') as f: - # self.freebsd12_ping_a_json = json.loads(f.read()) - + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_hostname_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-p.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_p_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-s.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_s_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_json = json.loads(f.read()) def test_ping_nodata(self): """ @@ -460,9 +497,6 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.fedora32_ping6_hostname_O_D_p_s, quiet=True), self.fedora32_ping6_hostname_O_D_p_s_json) - - - def test_ping_hostname_p_freebsd12(self): """ Test 'ping -p' on freebsd12 @@ -534,18 +568,78 @@ class MyTests(unittest.TestCase): Test 'ping6 ' on freebsd12 """ self.assertEqual(jc.parsers.ping.parse(self.freebsd12_ping6_ip, quiet=True), self.freebsd12_ping6_ip_json) - - # def test_ping_a_osx_10_14_6(self): - # """ - # Test 'ping -a' on OSX 10.14.6 - # """ - # self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_a, quiet=True), self.osx_10_14_6_ping_a_json) - # def test_ping_a_freebsd12(self): - # """ - # Test 'ping -a' on FreeBSD12 - # """ - # self.assertEqual(jc.parsers.ping.parse(self.freebsd_ping_a, quiet=True), self.freebsd12_ping_a_json) + def test_ping_hostname_p_osx_10_14_6(self): + """ + Test 'ping -p' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_hostname_p, quiet=True), self.osx_10_14_6_ping_hostname_p_json) + + def test_ping_hostname_s_osx_10_14_6(self): + """ + Test 'ping -s' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_hostname_s, quiet=True), self.osx_10_14_6_ping_hostname_s_json) + + def test_ping_ping_hostname_osx_10_14_6(self): + """ + Test 'ping ' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_hostname, quiet=True), self.osx_10_14_6_ping_hostname_json) + + def test_ping_ip_p_osx_10_14_6(self): + """ + Test 'ping -p' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_p, quiet=True), self.osx_10_14_6_ping_ip_p_json) + + def test_ping_ip_s_osx_10_14_6(self): + """ + Test 'ping -s' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_s, quiet=True), self.osx_10_14_6_ping_ip_s_json) + + def test_ping_ip_osx_10_14_6(self): + """ + Test 'ping6 ' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip, quiet=True), self.osx_10_14_6_ping_ip_json) + + def test_ping6_hostname_p_osx_10_14_6(self): + """ + Test 'ping6 -p' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_hostname_p, quiet=True), self.osx_10_14_6_ping6_hostname_p_json) + + def test_ping6_hostname_s_osx_10_14_6(self): + """ + Test 'ping6 -s' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_hostname_s, quiet=True), self.osx_10_14_6_ping6_hostname_s_json) + + def test_ping6_hostname_osx_10_14_6(self): + """ + Test 'ping6 ' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_hostname, quiet=True), self.osx_10_14_6_ping6_hostname_json) + + def test_ping6_ip_p_osx_10_14_6(self): + """ + Test 'ping6 -p' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip_p, quiet=True), self.osx_10_14_6_ping6_ip_p_json) + + def test_ping6_ip_s_osx_10_14_6(self): + """ + Test 'ping6 -s' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip_s, quiet=True), self.osx_10_14_6_ping6_ip_s_json) + + def test_ping6_ip_osx_10_14_6(self): + """ + Test 'ping6 ' on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip, quiet=True), self.osx_10_14_6_ping6_ip_json) if __name__ == '__main__': From dd5d318ab5bbb1027dd600fd3b0b6ec9b8adfdc3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 16:25:20 -0700 Subject: [PATCH 20/80] version bump and add ping command --- man/jc.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/jc.1 b/man/jc.1 index df9273d1..3f38e3d0 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2020-07-12 1.12.1 "JSON CLI output utility" +.TH jc 1 2020-07-12 1.13.0 "JSON CLI output utility" .SH NAME jc \- JSONifies the output of many CLI tools and file-types .SH SYNOPSIS @@ -148,6 +148,10 @@ ntpq \fB-p\fP command parser /etc/passwd file parser .TP .B +\fB--ping\fP +ping command parser +.TP +.B \fB--pip-list\fP pip list command parser .TP From 8719d96bddec80187e7ba3286ba93bfec8465744 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 20 Jul 2020 16:54:43 -0700 Subject: [PATCH 21/80] change description --- jc/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index 1acd599e..34701399 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -22,7 +22,7 @@ import jc.appdirs as appdirs class info(): version = '1.13.0' - description = 'JSON conversion tool for CLI output' + description = 'JSON CLI output utility' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' From 323072c9827c41c5d74433504b5efceb846cfe09 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 09:02:44 -0700 Subject: [PATCH 22/80] add source_ip to schema doc --- docs/parsers/ping.md | 1 + jc/parsers/ping.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index 27a1b3fe..64ad3c9f 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -117,6 +117,7 @@ Returns: Dictionary. Structured data with the following schema: { + "source_ip": string, "destination_ip": string, "data_bytes": integer, "pattern": string, (null if not set) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index cf50f217..c15dc80e 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -127,6 +127,7 @@ def process(proc_data): Dictionary. Structured data with the following schema: { + "source_ip": string, "destination_ip": string, "data_bytes": integer, "pattern": string, (null if not set) From 6830062256fbc453f87224f7ab8c10e4494b5a83 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 14:47:25 -0700 Subject: [PATCH 23/80] add support for duplicate replies --- docs/parsers/ping.md | 6 +- jc/parsers/ping.py | 83 ++++++++++++++++------ tests/fixtures/centos-7.7/ping-ip-dup.out | 27 +++++++ tests/fixtures/osx-10.14.6/ping-ip-dup.out | 20 ++++++ 4 files changed, 112 insertions(+), 24 deletions(-) create mode 100644 tests/fixtures/centos-7.7/ping-ip-dup.out create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-dup.out diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index 64ad3c9f..6d8e8134 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -125,19 +125,21 @@ Returns: "packets_transmitted": integer, "packets_received": integer, "packet_loss_percent": float, + "duplicates": integer, "round_trip_ms_min": float, "round_trip_ms_avg": float, "round_trip_ms_max": float, "round_trip_ms_stddev": float, "responses": [ { - "type": string, ('reply' or 'timeout') + "type": string, ('reply' or 'timeout') "timestamp": float, "bytes": integer, "response_ip": string, "icmp_seq": integer, "ttl": integer, - "time_ms": float + "time_ms": float, + "duplicate": boolean } ] } diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index c15dc80e..6ad8e206 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -135,24 +135,26 @@ def process(proc_data): "packets_transmitted": integer, "packets_received": integer, "packet_loss_percent": float, + "duplicates": integer, "round_trip_ms_min": float, "round_trip_ms_avg": float, "round_trip_ms_max": float, "round_trip_ms_stddev": float, "responses": [ { - "type": string, ('reply' or 'timeout') + "type": string, ('reply' or 'timeout') "timestamp": float, "bytes": integer, "response_ip": string, "icmp_seq": integer, "ttl": integer, - "time_ms": float + "time_ms": float, + "duplicate": boolean } ] } """ - int_list = ['data_bytes', 'packets_transmitted', 'packets_received', 'bytes', 'icmp_seq', 'ttl'] + int_list = ['data_bytes', 'packets_transmitted', 'packets_received', 'bytes', 'icmp_seq', 'ttl', 'duplicates'] float_list = ['packet_loss_percent', 'round_trip_ms_min', 'round_trip_ms_avg', 'round_trip_ms_max', 'round_trip_ms_stddev', 'timestamp', 'time_ms'] @@ -200,6 +202,9 @@ def linux_parse(data): if linedata[0].startswith('PATTERN: '): pattern = linedata.pop(0).split(': ')[1] + while not linedata[0].startswith('PING '): + linedata.pop(0) + ipv4 = True if 'bytes of data' in linedata[0] else False if ipv4 and linedata[0][5] not in string.digits: @@ -239,15 +244,28 @@ def linux_parse(data): if footer: if 'packets transmitted' in line: - raw_output.update( - { - 'packets_transmitted': line.split()[0], - 'packets_received': line.split()[3], - 'packet_loss_percent': line.split()[5].rstrip('%'), - 'time_ms': line.split()[9].replace('ms', '') - } - ) - continue + if ' duplicates,' in line: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[7].rstrip('%'), + 'duplicates': line.split()[5].lstrip('+'), + 'time_ms': line.split()[11].replace('ms', '') + } + ) + continue + else: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[5].rstrip('%'), + 'duplicates': '0', + 'time_ms': line.split()[9].replace('ms', '') + } + ) + continue else: split_line = line.split(' = ')[1] @@ -257,7 +275,7 @@ def linux_parse(data): 'round_trip_ms_min': split_line[0], 'round_trip_ms_avg': split_line[1], 'round_trip_ms_max': split_line[2], - 'round_trip_ms_stddev': split_line[3].replace(' ms', '') + 'round_trip_ms_stddev': split_line[3].split()[0] } ) @@ -309,8 +327,10 @@ def linux_parse(data): 'response_ip': line.split()[rip].rstrip(':'), 'icmp_seq': line.split()[iseq], 'ttl': line.split()[t2l], - 'time_ms': line.split()[tms] + 'time_ms': line.split()[tms], + 'duplicate': True if 'DUP!' in line else False } + ping_responses.append(response) continue @@ -361,14 +381,26 @@ def bsd_parse(data): if footer: if 'packets transmitted' in line: - raw_output.update( - { - 'packets_transmitted': line.split()[0], - 'packets_received': line.split()[3], - 'packet_loss_percent': line.split()[6].rstrip('%') - } - ) - continue + if ' duplicates,' in line: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[8].rstrip('%'), + 'duplicates': line.split()[6].lstrip('+'), + } + ) + continue + else: + raw_output.update( + { + 'packets_transmitted': line.split()[0], + 'packets_received': line.split()[3], + 'packet_loss_percent': line.split()[6].rstrip('%'), + 'duplicates': '0', + } + ) + continue else: split_line = line.split(' = ')[1] @@ -424,6 +456,13 @@ def bsd_parse(data): ping_responses.append(response) continue + # identify duplicates in responses + if ping_responses: + seq_list = [] + for reply in ping_responses: + seq_list.append(reply['icmp_seq']) + reply['duplicate'] = True if seq_list.count(reply['icmp_seq']) > 1 else False + raw_output['responses'] = ping_responses return raw_output diff --git a/tests/fixtures/centos-7.7/ping-ip-dup.out b/tests/fixtures/centos-7.7/ping-ip-dup.out new file mode 100644 index 00000000..35dd734f --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-dup.out @@ -0,0 +1,27 @@ +WARNING: pinging broadcast address +PING 192.168.1.255 (192.168.1.255) 56(84) bytes of data. +64 bytes from 192.168.1.221: icmp_seq=1 ttl=64 time=0.586 ms +64 bytes from 192.168.1.88: icmp_seq=1 ttl=64 time=382 ms (DUP!) +64 bytes from 192.168.1.78: icmp_seq=1 ttl=128 time=382 ms (DUP!) +64 bytes from 192.168.1.217: icmp_seq=1 ttl=255 time=387 ms (DUP!) +64 bytes from 192.168.1.186: icmp_seq=1 ttl=64 time=389 ms (DUP!) +64 bytes from 192.168.1.89: icmp_seq=1 ttl=64 time=389 ms (DUP!) +64 bytes from 192.168.1.75: icmp_seq=1 ttl=64 time=584 ms (DUP!) +64 bytes from 192.168.1.221: icmp_seq=2 ttl=64 time=0.861 ms +64 bytes from 192.168.1.78: icmp_seq=2 ttl=128 time=4.17 ms (DUP!) +64 bytes from 192.168.1.88: icmp_seq=2 ttl=64 time=4.19 ms (DUP!) +64 bytes from 192.168.1.89: icmp_seq=2 ttl=64 time=12.7 ms (DUP!) +64 bytes from 192.168.1.81: icmp_seq=1 ttl=64 time=1029 ms (DUP!) +64 bytes from 192.168.1.72: icmp_seq=1 ttl=64 time=1276 ms (DUP!) +64 bytes from 192.168.1.251: icmp_seq=1 ttl=64 time=1276 ms (DUP!) +64 bytes from 192.168.1.251: icmp_seq=2 ttl=64 time=262 ms (DUP!) +64 bytes from 192.168.1.72: icmp_seq=2 ttl=64 time=263 ms (DUP!) +64 bytes from 192.168.1.246: icmp_seq=2 ttl=255 time=263 ms (DUP!) +64 bytes from 192.168.1.217: icmp_seq=2 ttl=255 time=919 ms (DUP!) +64 bytes from 192.168.1.186: icmp_seq=2 ttl=64 time=919 ms (DUP!) +64 bytes from 192.168.1.75: icmp_seq=2 ttl=64 time=919 ms (DUP!) +64 bytes from 192.168.1.81: icmp_seq=2 ttl=64 time=919 ms (DUP!) + +--- 192.168.1.255 ping statistics --- +2 packets transmitted, 2 received, +19 duplicates, 0% packet loss, time 1013ms +rtt min/avg/max/mdev = 0.586/504.260/1276.448/417.208 ms, pipe 2 diff --git a/tests/fixtures/osx-10.14.6/ping-ip-dup.out b/tests/fixtures/osx-10.14.6/ping-ip-dup.out new file mode 100644 index 00000000..4cbc8aa8 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-dup.out @@ -0,0 +1,20 @@ +PING 192.168.1.255 (192.168.1.255): 56 data bytes +64 bytes from 192.168.1.221: icmp_seq=0 ttl=64 time=0.235 ms +64 bytes from 192.168.1.88: icmp_seq=0 ttl=64 time=4.224 ms +64 bytes from 192.168.1.89: icmp_seq=0 ttl=64 time=8.370 ms +64 bytes from 192.168.1.72: icmp_seq=0 ttl=64 time=62.635 ms +64 bytes from 192.168.1.246: icmp_seq=0 ttl=255 time=62.805 ms +64 bytes from 192.168.1.78: icmp_seq=0 ttl=128 time=63.803 ms +64 bytes from 192.168.1.251: icmp_seq=0 ttl=64 time=63.857 ms +64 bytes from 192.168.1.217: icmp_seq=0 ttl=255 time=672.974 ms +64 bytes from 192.168.1.186: icmp_seq=0 ttl=64 time=673.123 ms +64 bytes from 192.168.1.75: icmp_seq=0 ttl=64 time=673.358 ms +64 bytes from 192.168.1.221: icmp_seq=1 ttl=64 time=0.291 ms +64 bytes from 192.168.1.78: icmp_seq=1 ttl=128 time=7.898 ms +64 bytes from 192.168.1.88: icmp_seq=1 ttl=64 time=7.927 ms +64 bytes from 192.168.1.89: icmp_seq=1 ttl=64 time=10.077 ms +64 bytes from 192.168.1.250: icmp_seq=0 ttl=64 time=1084.262 ms + +--- 192.168.1.255 ping statistics --- +2 packets transmitted, 2 packets received, +13 duplicates, 0.0% packet loss +round-trip min/avg/max/stddev = 0.235/226.389/1084.262/344.729 ms From 313b9b329ca6b674069718839f55a4bd7834db80 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 15:05:54 -0700 Subject: [PATCH 24/80] update fixtures for added 'duplicate' fields --- tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json | 2 +- tests/fixtures/centos-7.7/ping-hostname-O-p.json | 2 +- tests/fixtures/centos-7.7/ping-hostname-O.json | 2 +- tests/fixtures/centos-7.7/ping-ip-O-D.json | 2 +- tests/fixtures/centos-7.7/ping-ip-O.json | 2 +- tests/fixtures/centos-7.7/ping-ip-dup.json | 1 + tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json | 2 +- tests/fixtures/centos-7.7/ping6-hostname-O-p.json | 2 +- tests/fixtures/centos-7.7/ping6-ip-O-D-p.json | 2 +- tests/fixtures/centos-7.7/ping6-ip-O-p.json | 2 +- tests/fixtures/fedora32/ping-hostname-O-D-p-s.json | 2 +- tests/fixtures/fedora32/ping-hostname-O-p.json | 2 +- tests/fixtures/fedora32/ping-hostname-O.json | 2 +- tests/fixtures/fedora32/ping-ip-O-D.json | 2 +- tests/fixtures/fedora32/ping-ip-O.json | 2 +- tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json | 2 +- tests/fixtures/fedora32/ping6-hostname-O-D-p.json | 2 +- tests/fixtures/fedora32/ping6-hostname-O-p.json | 2 +- tests/fixtures/fedora32/ping6-ip-O-D-p.json | 2 +- tests/fixtures/fedora32/ping6-ip-O-p.json | 2 +- tests/fixtures/freebsd12/ping-hostname-p.json | 2 +- tests/fixtures/freebsd12/ping-hostname-s.json | 2 +- tests/fixtures/freebsd12/ping-hostname.json | 2 +- tests/fixtures/freebsd12/ping-ip-p.json | 2 +- tests/fixtures/freebsd12/ping-ip-s.json | 2 +- tests/fixtures/freebsd12/ping-ip.json | 2 +- tests/fixtures/freebsd12/ping6-hostname-p.json | 2 +- tests/fixtures/freebsd12/ping6-hostname-s.json | 2 +- tests/fixtures/freebsd12/ping6-hostname.json | 2 +- tests/fixtures/freebsd12/ping6-ip-p.json | 2 +- tests/fixtures/freebsd12/ping6-ip-s.json | 2 +- tests/fixtures/freebsd12/ping6-ip.json | 2 +- tests/fixtures/osx-10.14.6/ping-hostname-p.json | 2 +- tests/fixtures/osx-10.14.6/ping-hostname-s.json | 2 +- tests/fixtures/osx-10.14.6/ping-hostname.json | 2 +- tests/fixtures/osx-10.14.6/ping-ip-dup.json | 1 + tests/fixtures/osx-10.14.6/ping-ip-p.json | 2 +- tests/fixtures/osx-10.14.6/ping-ip-s.json | 2 +- tests/fixtures/osx-10.14.6/ping-ip.json | 2 +- tests/fixtures/osx-10.14.6/ping6-hostname-p.json | 2 +- tests/fixtures/osx-10.14.6/ping6-hostname-s.json | 2 +- tests/fixtures/osx-10.14.6/ping6-hostname.json | 2 +- tests/fixtures/osx-10.14.6/ping6-ip-p.json | 2 +- tests/fixtures/osx-10.14.6/ping6-ip-s.json | 2 +- tests/fixtures/osx-10.14.6/ping6-ip.json | 2 +- tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json | 2 +- tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json | 2 +- tests/fixtures/ubuntu-18.04/ping-hostname-O.json | 2 +- tests/fixtures/ubuntu-18.04/ping-ip-O-D.json | 2 +- tests/fixtures/ubuntu-18.04/ping-ip-O.json | 2 +- tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json | 2 +- tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json | 2 +- tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json | 2 +- tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json | 2 +- tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json | 2 +- 55 files changed, 55 insertions(+), 53 deletions(-) create mode 100644 tests/fixtures/centos-7.7/ping-ip-dup.json create mode 100644 tests/fixtures/osx-10.14.6/ping-ip-dup.json diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json index 261cb4dd..85be346d 100644 --- a/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json +++ b/tests/fixtures/centos-7.7/ping-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19146.0, "round_trip_ms_min": 28.96, "round_trip_ms_avg": 34.468, "round_trip_ms_max": 38.892, "round_trip_ms_stddev": 3.497, "responses": [{"type": "reply", "timestamp": 1594978465.914536, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.4}, {"type": "reply", "timestamp": 1594978465.993009, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.3}, {"type": "reply", "timestamp": 1594978467.010196, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1594978468.033743, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": 1594978469.051227, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 38.0}, {"type": "reply", "timestamp": 1594978470.048764, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": 1594978471.051945, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": 1594978472.064206, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": 1594978473.062587, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 31.5}, {"type": "reply", "timestamp": 1594978474.074343, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 38.3}, {"type": "reply", "timestamp": 1594978475.079703, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": 1594978476.076383, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": 1594978477.084119, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": 1594978478.092207, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 31.6}, {"type": "reply", "timestamp": 1594978479.104358, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 37.7}, {"type": "reply", "timestamp": 1594978480.106907, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": 1594978481.11558, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1594978482.119872, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": 1594978483.131901, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 37.0}, {"type": "reply", "timestamp": 1594978484.141117, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 36.9}]} +{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19146.0, "round_trip_ms_min": 28.96, "round_trip_ms_avg": 34.468, "round_trip_ms_max": 38.892, "round_trip_ms_stddev": 3.497, "responses": [{"type": "reply", "timestamp": 1594978465.914536, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.4, "duplicate": false}, {"type": "reply", "timestamp": 1594978465.993009, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.3, "duplicate": false}, {"type": "reply", "timestamp": 1594978467.010196, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.0, "duplicate": false}, {"type": "reply", "timestamp": 1594978468.033743, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 38.8, "duplicate": false}, {"type": "reply", "timestamp": 1594978469.051227, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 38.0, "duplicate": false}, {"type": "reply", "timestamp": 1594978470.048764, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9, "duplicate": false}, {"type": "reply", "timestamp": 1594978471.051945, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 28.9, "duplicate": false}, {"type": "reply", "timestamp": 1594978472.064206, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 37.4, "duplicate": false}, {"type": "reply", "timestamp": 1594978473.062587, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 31.5, "duplicate": false}, {"type": "reply", "timestamp": 1594978474.074343, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 38.3, "duplicate": false}, {"type": "reply", "timestamp": 1594978475.079703, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 38.8, "duplicate": false}, {"type": "reply", "timestamp": 1594978476.076383, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978477.084119, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978478.092207, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 31.6, "duplicate": false}, {"type": "reply", "timestamp": 1594978479.104358, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 37.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978480.106907, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 37.5, "duplicate": false}, {"type": "reply", "timestamp": 1594978481.11558, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 37.3, "duplicate": false}, {"type": "reply", "timestamp": 1594978482.119872, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 33.8, "duplicate": false}, {"type": "reply", "timestamp": 1594978483.131901, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 37.0, "duplicate": false}, {"type": "reply", "timestamp": 1594978484.141117, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 36.9, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping-hostname-O-p.json b/tests/fixtures/centos-7.7/ping-hostname-O-p.json index 5fb5aa70..06bc9416 100644 --- a/tests/fixtures/centos-7.7/ping-hostname-O-p.json +++ b/tests/fixtures/centos-7.7/ping-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19233.0, "round_trip_ms_min": 23.359, "round_trip_ms_avg": 28.495, "round_trip_ms_max": 33.979, "round_trip_ms_stddev": 4.081, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 24.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 23.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 26.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 24.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 31.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 23.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 23.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 24.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 24.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 31.0}]} +{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19233.0, "round_trip_ms_min": 23.359, "round_trip_ms_avg": 28.495, "round_trip_ms_max": 33.979, "round_trip_ms_stddev": 4.081, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 24.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 23.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 26.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 24.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 24.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 33.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 31.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 25.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 33.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 23.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 23.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 33.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 24.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 30.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 24.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 31.0, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping-hostname-O.json b/tests/fixtures/centos-7.7/ping-hostname-O.json index 3fe3611c..f0d50844 100644 --- a/tests/fixtures/centos-7.7/ping-hostname-O.json +++ b/tests/fixtures/centos-7.7/ping-hostname-O.json @@ -1 +1 @@ -{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19125.0, "round_trip_ms_min": 27.656, "round_trip_ms_avg": 33.717, "round_trip_ms_max": 36.758, "round_trip_ms_stddev": 2.814, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 35.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 35.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 28.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 35.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 35.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 15}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 36.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 36.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19125.0, "round_trip_ms_min": 27.656, "round_trip_ms_avg": 33.717, "round_trip_ms_max": 36.758, "round_trip_ms_stddev": 2.814, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 30.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 35.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 35.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 29.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 28.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 35.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 35.5, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 15}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 36.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 36.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping-ip-O-D.json b/tests/fixtures/centos-7.7/ping-ip-O-D.json index 56748367..05207b96 100644 --- a/tests/fixtures/centos-7.7/ping-ip-O-D.json +++ b/tests/fixtures/centos-7.7/ping-ip-O-D.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19081.0, "round_trip_ms_min": 0.041, "round_trip_ms_avg": 0.048, "round_trip_ms_max": 0.081, "round_trip_ms_stddev": 0.009, "responses": [{"type": "reply", "timestamp": 1595037214.261953, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": 1595037215.264798, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037216.272296, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.047}, {"type": "reply", "timestamp": 1595037217.275851, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.062}, {"type": "reply", "timestamp": 1595037218.284242, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": 1595037219.283712, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595037220.290949, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037221.295962, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037222.30702, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037223.313919, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.081}, {"type": "reply", "timestamp": 1595037224.313679, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595037225.320748, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037226.324322, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": 1595037227.325835, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037228.327028, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037229.329891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": 1595037230.333891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": 1595037231.338137, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": 1595037232.340475, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.048}, {"type": "reply", "timestamp": 1595037233.343058, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.045}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19081.0, "round_trip_ms_min": 0.041, "round_trip_ms_avg": 0.048, "round_trip_ms_max": 0.081, "round_trip_ms_stddev": 0.009, "responses": [{"type": "reply", "timestamp": 1595037214.261953, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041, "duplicate": false}, {"type": "reply", "timestamp": 1595037215.264798, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048, "duplicate": false}, {"type": "reply", "timestamp": 1595037216.272296, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.047, "duplicate": false}, {"type": "reply", "timestamp": 1595037217.275851, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.062, "duplicate": false}, {"type": "reply", "timestamp": 1595037218.284242, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.045, "duplicate": false}, {"type": "reply", "timestamp": 1595037219.283712, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": 1595037220.290949, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": 1595037221.295962, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": 1595037222.30702, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.048, "duplicate": false}, {"type": "reply", "timestamp": 1595037223.313919, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.081, "duplicate": false}, {"type": "reply", "timestamp": 1595037224.313679, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": 1595037225.320748, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": 1595037226.324322, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.045, "duplicate": false}, {"type": "reply", "timestamp": 1595037227.325835, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": 1595037228.327028, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": 1595037229.329891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.052, "duplicate": false}, {"type": "reply", "timestamp": 1595037230.333891, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": 1595037231.338137, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": 1595037232.340475, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.048, "duplicate": false}, {"type": "reply", "timestamp": 1595037233.343058, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.045, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping-ip-O.json b/tests/fixtures/centos-7.7/ping-ip-O.json index c4d131b0..1ebedce8 100644 --- a/tests/fixtures/centos-7.7/ping-ip-O.json +++ b/tests/fixtures/centos-7.7/ping-ip-O.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19070.0, "round_trip_ms_min": 0.038, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.08, "round_trip_ms_stddev": 0.011, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.08}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.047}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.04}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.062}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.046}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.045}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.044}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.044}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19070.0, "round_trip_ms_min": 0.038, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.08, "round_trip_ms_stddev": 0.011, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.052, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.08, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.047, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.04, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.052, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.045, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.062, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.046, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.045, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.044, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.044, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping-ip-dup.json b/tests/fixtures/centos-7.7/ping-ip-dup.json new file mode 100644 index 00000000..78113f45 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping-ip-dup.json @@ -0,0 +1 @@ +{"destination_ip": "192.168.1.255", "data_bytes": 56, "pattern": null, "destination": "192.168.1.255", "packets_transmitted": 2, "packets_received": 2, "packet_loss_percent": 0.0, "duplicates": 19, "time_ms": 1013.0, "round_trip_ms_min": 0.586, "round_trip_ms_avg": 504.26, "round_trip_ms_max": 1276.448, "round_trip_ms_stddev": 417.208, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.221", "icmp_seq": 1, "ttl": 64, "time_ms": 0.586, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.88", "icmp_seq": 1, "ttl": 64, "time_ms": 382.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.78", "icmp_seq": 1, "ttl": 128, "time_ms": 382.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.217", "icmp_seq": 1, "ttl": 255, "time_ms": 387.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.186", "icmp_seq": 1, "ttl": 64, "time_ms": 389.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.89", "icmp_seq": 1, "ttl": 64, "time_ms": 389.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.75", "icmp_seq": 1, "ttl": 64, "time_ms": 584.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.221", "icmp_seq": 2, "ttl": 64, "time_ms": 0.861, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.78", "icmp_seq": 2, "ttl": 128, "time_ms": 4.17, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.88", "icmp_seq": 2, "ttl": 64, "time_ms": 4.19, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.89", "icmp_seq": 2, "ttl": 64, "time_ms": 12.7, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.81", "icmp_seq": 1, "ttl": 64, "time_ms": 1029.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.72", "icmp_seq": 1, "ttl": 64, "time_ms": 1276.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.251", "icmp_seq": 1, "ttl": 64, "time_ms": 1276.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.251", "icmp_seq": 2, "ttl": 64, "time_ms": 262.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.72", "icmp_seq": 2, "ttl": 64, "time_ms": 263.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.246", "icmp_seq": 2, "ttl": 255, "time_ms": 263.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.217", "icmp_seq": 2, "ttl": 255, "time_ms": 919.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.186", "icmp_seq": 2, "ttl": 64, "time_ms": 919.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.75", "icmp_seq": 2, "ttl": 64, "time_ms": 919.0, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "192.168.1.81", "icmp_seq": 2, "ttl": 64, "time_ms": 919.0, "duplicate": true}]} diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json index 79d5400e..fb31d412 100644 --- a/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19077.0, "round_trip_ms_min": 31.845, "round_trip_ms_avg": 39.274, "round_trip_ms_max": 43.243, "round_trip_ms_stddev": 3.522, "responses": [{"type": "reply", "timestamp": 1594978345.609669, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": 1594978346.58542, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.9}, {"type": "reply", "timestamp": 1594978347.594128, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 42.3}, {"type": "reply", "timestamp": 1594978348.595221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 40.2}, {"type": "reply", "timestamp": 1594978349.600372, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 43.2}, {"type": "reply", "timestamp": 1594978350.590676, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": 1594978351.601527, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 41.8}, {"type": "reply", "timestamp": 1594978352.604195, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 41.7}, {"type": "reply", "timestamp": 1594978353.607212, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 42.0}, {"type": "reply", "timestamp": 1594978354.610771, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 40.7}, {"type": "reply", "timestamp": 1594978355.613729, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 40.4}, {"type": "reply", "timestamp": 1594978356.611887, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": 1594978357.62481, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 40.1}, {"type": "reply", "timestamp": 1594978358.629185, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 42.0}, {"type": "reply", "timestamp": 1594978359.634854, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 41.2}, {"type": "reply", "timestamp": 1594978360.638344, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 40.6}, {"type": "reply", "timestamp": 1594978361.640968, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 40.7}, {"type": "reply", "timestamp": 1594978362.645739, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 39.9}, {"type": "reply", "timestamp": 1594978363.6467, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": 1594978364.650853, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 33.6}]} +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19077.0, "round_trip_ms_min": 31.845, "round_trip_ms_avg": 39.274, "round_trip_ms_max": 43.243, "round_trip_ms_stddev": 3.522, "responses": [{"type": "reply", "timestamp": 1594978345.609669, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 32.4, "duplicate": false}, {"type": "reply", "timestamp": 1594978346.58542, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.9, "duplicate": false}, {"type": "reply", "timestamp": 1594978347.594128, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 42.3, "duplicate": false}, {"type": "reply", "timestamp": 1594978348.595221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 40.2, "duplicate": false}, {"type": "reply", "timestamp": 1594978349.600372, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 43.2, "duplicate": false}, {"type": "reply", "timestamp": 1594978350.590676, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 31.8, "duplicate": false}, {"type": "reply", "timestamp": 1594978351.601527, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 41.8, "duplicate": false}, {"type": "reply", "timestamp": 1594978352.604195, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 41.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978353.607212, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 42.0, "duplicate": false}, {"type": "reply", "timestamp": 1594978354.610771, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 40.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978355.613729, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 40.4, "duplicate": false}, {"type": "reply", "timestamp": 1594978356.611887, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": 1594978357.62481, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 40.1, "duplicate": false}, {"type": "reply", "timestamp": 1594978358.629185, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 42.0, "duplicate": false}, {"type": "reply", "timestamp": 1594978359.634854, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 41.2, "duplicate": false}, {"type": "reply", "timestamp": 1594978360.638344, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 40.6, "duplicate": false}, {"type": "reply", "timestamp": 1594978361.640968, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 40.7, "duplicate": false}, {"type": "reply", "timestamp": 1594978362.645739, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 39.9, "duplicate": false}, {"type": "reply", "timestamp": 1594978363.6467, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.5, "duplicate": false}, {"type": "reply", "timestamp": 1594978364.650853, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 33.6, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping6-hostname-O-p.json b/tests/fixtures/centos-7.7/ping6-hostname-O-p.json index 98470612..878f1044 100644 --- a/tests/fixtures/centos-7.7/ping6-hostname-O-p.json +++ b/tests/fixtures/centos-7.7/ping6-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19164.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.455, "round_trip_ms_max": 42.652, "round_trip_ms_stddev": 3.338, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 38.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 38.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 42.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 39.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 38.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 38.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 39.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 39.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 41.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.4}]} +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19164.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.455, "round_trip_ms_max": 42.652, "round_trip_ms_stddev": 3.338, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 30.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 39.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 38.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 38.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 42.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 39.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 38.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 38.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 38.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 39.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 39.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 41.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.4, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json index 2ec21dba..4722bc35 100644 --- a/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json +++ b/tests/fixtures/centos-7.7/ping6-ip-O-D-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19074.0, "round_trip_ms_min": 28.15, "round_trip_ms_avg": 33.534, "round_trip_ms_max": 39.843, "round_trip_ms_stddev": 3.489, "responses": [{"type": "reply", "timestamp": 1594976827.240914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.7}, {"type": "reply", "timestamp": 1594976828.25493, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1594976829.252877, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 29.7}, {"type": "reply", "timestamp": 1594976830.262654, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.7}, {"type": "reply", "timestamp": 1594976831.265626, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": 1594976832.269834, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1594976833.268059, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": 1594976834.274292, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.1}, {"type": "reply", "timestamp": 1594976835.287123, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1594976836.287707, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": 1594976837.290589, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": 1594976838.293514, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 35.4}, {"type": "reply", "timestamp": 1594976839.290914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.8}, {"type": "reply", "timestamp": 1594976840.292897, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 28.5}, {"type": "timeout", "timestamp": 1594976842.269238, "icmp_seq": 15}, {"type": "reply", "timestamp": 1594976842.30145, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": 1594976843.312998, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 39.8}, {"type": "reply", "timestamp": 1594976844.314228, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1594976845.315518, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 35.1}, {"type": "reply", "timestamp": 1594976846.321706, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.4}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19074.0, "round_trip_ms_min": 28.15, "round_trip_ms_avg": 33.534, "round_trip_ms_max": 39.843, "round_trip_ms_stddev": 3.489, "responses": [{"type": "reply", "timestamp": 1594976827.240914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.7, "duplicate": false}, {"type": "reply", "timestamp": 1594976828.25493, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2, "duplicate": false}, {"type": "reply", "timestamp": 1594976829.252877, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 29.7, "duplicate": false}, {"type": "reply", "timestamp": 1594976830.262654, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.7, "duplicate": false}, {"type": "reply", "timestamp": 1594976831.265626, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 34.8, "duplicate": false}, {"type": "reply", "timestamp": 1594976832.269834, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 35.6, "duplicate": false}, {"type": "reply", "timestamp": 1594976833.268059, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 28.4, "duplicate": false}, {"type": "reply", "timestamp": 1594976834.274292, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.1, "duplicate": false}, {"type": "reply", "timestamp": 1594976835.287123, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 34.9, "duplicate": false}, {"type": "reply", "timestamp": 1594976836.287707, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": 1594976837.290589, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 35.2, "duplicate": false}, {"type": "reply", "timestamp": 1594976838.293514, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 35.4, "duplicate": false}, {"type": "reply", "timestamp": 1594976839.290914, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.8, "duplicate": false}, {"type": "reply", "timestamp": 1594976840.292897, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 28.5, "duplicate": false}, {"type": "timeout", "timestamp": 1594976842.269238, "icmp_seq": 15}, {"type": "reply", "timestamp": 1594976842.30145, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 31.8, "duplicate": false}, {"type": "reply", "timestamp": 1594976843.312998, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 39.8, "duplicate": false}, {"type": "reply", "timestamp": 1594976844.314228, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7, "duplicate": false}, {"type": "reply", "timestamp": 1594976845.315518, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 35.1, "duplicate": false}, {"type": "reply", "timestamp": 1594976846.321706, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.4, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping6-ip-O-p.json b/tests/fixtures/centos-7.7/ping6-ip-O-p.json index 2be892bd..bb41dca9 100644 --- a/tests/fixtures/centos-7.7/ping6-ip-O-p.json +++ b/tests/fixtures/centos-7.7/ping6-ip-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19067.0, "round_trip_ms_min": 27.064, "round_trip_ms_avg": 33.626, "round_trip_ms_max": 38.146, "round_trip_ms_stddev": 3.803, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 27.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 36.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.3}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 35.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 36.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 36.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.1}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19067.0, "round_trip_ms_min": 27.064, "round_trip_ms_avg": 33.626, "round_trip_ms_max": 38.146, "round_trip_ms_stddev": 3.803, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 27.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 28.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 36.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 35.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 36.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.3, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 37.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 36.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 35.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 36.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 36.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 27.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 38.1, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json index 47063430..76031357 100644 --- a/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json +++ b/tests/fixtures/fedora32/ping-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "151.101.129.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19040.0, "round_trip_ms_min": 25.934, "round_trip_ms_avg": 43.176, "round_trip_ms_max": 149.271, "round_trip_ms_stddev": 26.937, "responses": [{"type": "reply", "timestamp": 1595191335.548399, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 46.1}, {"type": "reply", "timestamp": 1595191336.134174, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 61.5}, {"type": "reply", "timestamp": 1595191337.101575, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": 1595191338.108023, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": 1595191339.229213, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 149.0}, {"type": "reply", "timestamp": 1595191340.114026, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": 1595191341.122628, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 37.9}, {"type": "reply", "timestamp": 1595191342.110785, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 26.0}, {"type": "reply", "timestamp": 1595191343.118652, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.3}, {"type": "reply", "timestamp": 1595191344.1303, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 43.4}, {"type": "reply", "timestamp": 1595191345.162284, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 71.9}, {"type": "reply", "timestamp": 1595191346.123086, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 31.1}, {"type": "reply", "timestamp": 1595191347.127689, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595191348.142817, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 45.6}, {"type": "reply", "timestamp": 1595191349.125383, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 25.9}, {"type": "reply", "timestamp": 1595191350.136294, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": 1595191351.135889, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 31.2}, {"type": "reply", "timestamp": 1595191352.134199, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.2}, {"type": "reply", "timestamp": 1595191353.147391, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 38.5}, {"type": "reply", "timestamp": 1595191354.15064, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 39.5}]} +{"destination_ip": "151.101.129.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19040.0, "round_trip_ms_min": 25.934, "round_trip_ms_avg": 43.176, "round_trip_ms_max": 149.271, "round_trip_ms_stddev": 26.937, "responses": [{"type": "reply", "timestamp": 1595191335.548399, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 46.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191336.134174, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 61.5, "duplicate": false}, {"type": "reply", "timestamp": 1595191337.101575, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 26.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191338.108023, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 30.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191339.229213, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 149.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191340.114026, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191341.122628, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 37.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191342.110785, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 26.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191343.118652, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 32.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191344.1303, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 43.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191345.162284, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 71.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191346.123086, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 12, "ttl": 59, "time_ms": 31.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191347.127689, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191348.142817, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 45.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191349.125383, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 25.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191350.136294, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 34.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191351.135889, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 31.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191352.134199, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191353.147391, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 38.5, "duplicate": false}, {"type": "reply", "timestamp": 1595191354.15064, "bytes": 1408, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 39.5, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping-hostname-O-p.json b/tests/fixtures/fedora32/ping-hostname-O-p.json index 4c2ae75c..dc0d440c 100644 --- a/tests/fixtures/fedora32/ping-hostname-O-p.json +++ b/tests/fixtures/fedora32/ping-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "151.101.197.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19026.0, "round_trip_ms_min": 37.406, "round_trip_ms_avg": 44.894, "round_trip_ms_max": 57.881, "round_trip_ms_stddev": 6.101, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 1, "ttl": 56, "time_ms": 38.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 2, "ttl": 56, "time_ms": 38.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 3, "ttl": 56, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 4, "ttl": 56, "time_ms": 49.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 5, "ttl": 56, "time_ms": 47.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 6, "ttl": 56, "time_ms": 48.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 7, "ttl": 56, "time_ms": 53.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 8, "ttl": 56, "time_ms": 47.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 9, "ttl": 56, "time_ms": 47.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 10, "ttl": 56, "time_ms": 51.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 11, "ttl": 56, "time_ms": 55.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 12, "ttl": 56, "time_ms": 40.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 13, "ttl": 56, "time_ms": 39.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 14, "ttl": 56, "time_ms": 40.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 15, "ttl": 56, "time_ms": 41.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 16, "ttl": 56, "time_ms": 57.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 17, "ttl": 56, "time_ms": 45.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 18, "ttl": 56, "time_ms": 39.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 19, "ttl": 56, "time_ms": 37.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 20, "ttl": 56, "time_ms": 40.4}]} +{"destination_ip": "151.101.197.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19026.0, "round_trip_ms_min": 37.406, "round_trip_ms_avg": 44.894, "round_trip_ms_max": 57.881, "round_trip_ms_stddev": 6.101, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 1, "ttl": 56, "time_ms": 38.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 2, "ttl": 56, "time_ms": 38.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 3, "ttl": 56, "time_ms": 39.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 4, "ttl": 56, "time_ms": 49.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 5, "ttl": 56, "time_ms": 47.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 6, "ttl": 56, "time_ms": 48.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 7, "ttl": 56, "time_ms": 53.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 8, "ttl": 56, "time_ms": 47.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 9, "ttl": 56, "time_ms": 47.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 10, "ttl": 56, "time_ms": 51.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 11, "ttl": 56, "time_ms": 55.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 12, "ttl": 56, "time_ms": 40.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 13, "ttl": 56, "time_ms": 39.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 14, "ttl": 56, "time_ms": 40.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 15, "ttl": 56, "time_ms": 41.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 16, "ttl": 56, "time_ms": 57.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 17, "ttl": 56, "time_ms": 45.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 18, "ttl": 56, "time_ms": 39.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 19, "ttl": 56, "time_ms": 37.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.197.67", "icmp_seq": 20, "ttl": 56, "time_ms": 40.4, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping-hostname-O.json b/tests/fixtures/fedora32/ping-hostname-O.json index 37177ec7..eb399251 100644 --- a/tests/fixtures/fedora32/ping-hostname-O.json +++ b/tests/fixtures/fedora32/ping-hostname-O.json @@ -1 +1 @@ -{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19075.0, "round_trip_ms_min": 24.317, "round_trip_ms_avg": 61.577, "round_trip_ms_max": 274.537, "round_trip_ms_stddev": 69.94, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 27.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 31.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 25.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 65.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 156.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 216.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 275.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 29.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 25.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 24.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 24.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 30.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 45.8}]} +{"destination_ip": "151.101.129.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19075.0, "round_trip_ms_min": 24.317, "round_trip_ms_avg": 61.577, "round_trip_ms_max": 274.537, "round_trip_ms_stddev": 69.94, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 1, "ttl": 59, "time_ms": 27.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 2, "ttl": 59, "time_ms": 31.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 3, "ttl": 59, "time_ms": 25.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 4, "ttl": 59, "time_ms": 65.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 6, "ttl": 59, "time_ms": 32.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 7, "ttl": 59, "time_ms": 156.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 8, "ttl": 59, "time_ms": 216.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 9, "ttl": 59, "time_ms": 275.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 10, "ttl": 59, "time_ms": 25.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 11, "ttl": 59, "time_ms": 29.5, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 13, "ttl": 59, "time_ms": 25.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 15, "ttl": 59, "time_ms": 24.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 16, "ttl": 59, "time_ms": 35.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 17, "ttl": 59, "time_ms": 24.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 18, "ttl": 59, "time_ms": 34.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 19, "ttl": 59, "time_ms": 30.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.129.67", "icmp_seq": 20, "ttl": 59, "time_ms": 45.8, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping-ip-O-D.json b/tests/fixtures/fedora32/ping-ip-O-D.json index d3a126eb..28891b19 100644 --- a/tests/fixtures/fedora32/ping-ip-O-D.json +++ b/tests/fixtures/fedora32/ping-ip-O-D.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19450.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.086, "round_trip_ms_max": 0.135, "round_trip_ms_stddev": 0.016, "responses": [{"type": "reply", "timestamp": 1595191373.643436, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": 1595191374.662543, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.083}, {"type": "reply", "timestamp": 1595191375.685291, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.091}, {"type": "reply", "timestamp": 1595191376.709678, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.092}, {"type": "reply", "timestamp": 1595191377.734105, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": 1595191378.758107, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": 1595191379.781215, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191380.80601, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.092}, {"type": "reply", "timestamp": 1595191381.829806, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.088}, {"type": "reply", "timestamp": 1595191382.853166, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.135}, {"type": "reply", "timestamp": 1595191383.876966, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.101}, {"type": "reply", "timestamp": 1595191384.900636, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.084}, {"type": "reply", "timestamp": 1595191385.925055, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.071}, {"type": "reply", "timestamp": 1595191386.94986, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191387.973041, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": 1595191388.997049, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.073}, {"type": "reply", "timestamp": 1595191390.021265, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.074}, {"type": "reply", "timestamp": 1595191391.044904, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": 1595191392.069285, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": 1595191393.093307, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.084}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19450.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.086, "round_trip_ms_max": 0.135, "round_trip_ms_stddev": 0.016, "responses": [{"type": "reply", "timestamp": 1595191373.643436, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": 1595191374.662543, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.083, "duplicate": false}, {"type": "reply", "timestamp": 1595191375.685291, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.091, "duplicate": false}, {"type": "reply", "timestamp": 1595191376.709678, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.092, "duplicate": false}, {"type": "reply", "timestamp": 1595191377.734105, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.09, "duplicate": false}, {"type": "reply", "timestamp": 1595191378.758107, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.089, "duplicate": false}, {"type": "reply", "timestamp": 1595191379.781215, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.087, "duplicate": false}, {"type": "reply", "timestamp": 1595191380.80601, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.092, "duplicate": false}, {"type": "reply", "timestamp": 1595191381.829806, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.088, "duplicate": false}, {"type": "reply", "timestamp": 1595191382.853166, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.135, "duplicate": false}, {"type": "reply", "timestamp": 1595191383.876966, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.101, "duplicate": false}, {"type": "reply", "timestamp": 1595191384.900636, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.084, "duplicate": false}, {"type": "reply", "timestamp": 1595191385.925055, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.071, "duplicate": false}, {"type": "reply", "timestamp": 1595191386.94986, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087, "duplicate": false}, {"type": "reply", "timestamp": 1595191387.973041, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.087, "duplicate": false}, {"type": "reply", "timestamp": 1595191388.997049, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.073, "duplicate": false}, {"type": "reply", "timestamp": 1595191390.021265, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.074, "duplicate": false}, {"type": "reply", "timestamp": 1595191391.044904, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089, "duplicate": false}, {"type": "reply", "timestamp": 1595191392.069285, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09, "duplicate": false}, {"type": "reply", "timestamp": 1595191393.093307, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.084, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping-ip-O.json b/tests/fixtures/fedora32/ping-ip-O.json index 153ee351..54998228 100644 --- a/tests/fixtures/fedora32/ping-ip-O.json +++ b/tests/fixtures/fedora32/ping-ip-O.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19480.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.093, "round_trip_ms_max": 0.16, "round_trip_ms_stddev": 0.025, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.07}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.093}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.078}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.16}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.155}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.084}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.111}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.079}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.103}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.105}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.081}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.092}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19480.0, "round_trip_ms_min": 0.043, "round_trip_ms_avg": 0.093, "round_trip_ms_max": 0.16, "round_trip_ms_stddev": 0.025, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.07, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.09, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.093, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.078, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.16, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.089, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.155, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.084, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.111, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.079, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.103, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.105, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.087, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.081, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.089, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.09, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.089, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.09, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.092, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json index 8f827d0f..8fb6c980 100644 --- a/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:200::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19042.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.536, "round_trip_ms_max": 59.021, "round_trip_ms_stddev": 5.967, "responses": [{"type": "reply", "timestamp": 1595191433.391154, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595191434.063086, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1595191435.071905, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 3, "ttl": 59, "time_ms": 44.3}, {"type": "reply", "timestamp": 1595191436.067128, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1595191437.06455, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.2}, {"type": "reply", "timestamp": 1595191438.06541, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 6, "ttl": 59, "time_ms": 30.8}, {"type": "reply", "timestamp": 1595191439.076718, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 7, "ttl": 59, "time_ms": 40.6}, {"type": "reply", "timestamp": 1595191440.076357, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 8, "ttl": 59, "time_ms": 38.2}, {"type": "reply", "timestamp": 1595191441.079078, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.0}, {"type": "reply", "timestamp": 1595191442.077537, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.3}, {"type": "reply", "timestamp": 1595191443.104345, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 11, "ttl": 59, "time_ms": 59.0}, {"type": "reply", "timestamp": 1595191444.083741, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595191445.086748, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 13, "ttl": 59, "time_ms": 37.6}, {"type": "reply", "timestamp": 1595191446.088958, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.3}, {"type": "reply", "timestamp": 1595191447.086122, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.9}, {"type": "reply", "timestamp": 1595191448.088312, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 16, "ttl": 59, "time_ms": 30.8}, {"type": "reply", "timestamp": 1595191449.098353, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9}, {"type": "reply", "timestamp": 1595191450.09959, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.1}, {"type": "reply", "timestamp": 1595191451.10105, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.8}, {"type": "reply", "timestamp": 1595191452.100239, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.0}]} +{"destination_ip": "2a04:4e42:200::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19042.0, "round_trip_ms_min": 30.757, "round_trip_ms_avg": 37.536, "round_trip_ms_max": 59.021, "round_trip_ms_stddev": 5.967, "responses": [{"type": "reply", "timestamp": 1595191433.391154, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191434.063086, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 37.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191435.071905, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 3, "ttl": 59, "time_ms": 44.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191436.067128, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 4, "ttl": 59, "time_ms": 37.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191437.06455, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191438.06541, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 6, "ttl": 59, "time_ms": 30.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191439.076718, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 7, "ttl": 59, "time_ms": 40.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191440.076357, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 8, "ttl": 59, "time_ms": 38.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191441.079078, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 9, "ttl": 59, "time_ms": 39.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191442.077537, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 10, "ttl": 59, "time_ms": 34.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191443.104345, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 11, "ttl": 59, "time_ms": 59.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191444.083741, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191445.086748, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 13, "ttl": 59, "time_ms": 37.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191446.088958, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 14, "ttl": 59, "time_ms": 37.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191447.086122, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191448.088312, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 16, "ttl": 59, "time_ms": 30.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191449.098353, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 17, "ttl": 59, "time_ms": 38.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191450.09959, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191451.10105, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191452.100239, "bytes": 1408, "response_ip": "2a04:4e42:200::323", "icmp_seq": 20, "ttl": 59, "time_ms": 35.0, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-D-p.json b/tests/fixtures/fedora32/ping6-hostname-O-D-p.json index 5aa98747..6f00ccea 100644 --- a/tests/fixtures/fedora32/ping6-hostname-O-D-p.json +++ b/tests/fixtures/fedora32/ping6-hostname-O-D-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2e::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19043.0, "round_trip_ms_min": 38.533, "round_trip_ms_avg": 44.877, "round_trip_ms_max": 51.366, "round_trip_ms_stddev": 3.83, "responses": [{"type": "reply", "timestamp": 1595191452.2553, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 1, "ttl": 56, "time_ms": 39.1}, {"type": "reply", "timestamp": 1595191453.229184, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 2, "ttl": 56, "time_ms": 47.9}, {"type": "reply", "timestamp": 1595191454.229065, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 3, "ttl": 56, "time_ms": 46.4}, {"type": "reply", "timestamp": 1595191455.230571, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 4, "ttl": 56, "time_ms": 45.1}, {"type": "reply", "timestamp": 1595191456.233811, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 5, "ttl": 56, "time_ms": 45.7}, {"type": "reply", "timestamp": 1595191457.228052, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 6, "ttl": 56, "time_ms": 38.9}, {"type": "reply", "timestamp": 1595191458.228764, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 7, "ttl": 56, "time_ms": 39.0}, {"type": "reply", "timestamp": 1595191459.243633, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 8, "ttl": 56, "time_ms": 51.4}, {"type": "reply", "timestamp": 1595191460.243509, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 9, "ttl": 56, "time_ms": 49.1}, {"type": "reply", "timestamp": 1595191461.242713, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 10, "ttl": 56, "time_ms": 46.6}, {"type": "reply", "timestamp": 1595191462.246016, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 11, "ttl": 56, "time_ms": 47.1}, {"type": "reply", "timestamp": 1595191463.240552, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 12, "ttl": 56, "time_ms": 38.6}, {"type": "reply", "timestamp": 1595191464.248594, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 13, "ttl": 56, "time_ms": 44.3}, {"type": "reply", "timestamp": 1595191465.254128, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 14, "ttl": 56, "time_ms": 48.8}, {"type": "reply", "timestamp": 1595191466.253777, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 15, "ttl": 56, "time_ms": 45.2}, {"type": "reply", "timestamp": 1595191467.259039, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 16, "ttl": 56, "time_ms": 47.3}, {"type": "reply", "timestamp": 1595191468.252991, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 17, "ttl": 56, "time_ms": 38.5}, {"type": "reply", "timestamp": 1595191469.263167, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 18, "ttl": 56, "time_ms": 47.0}, {"type": "reply", "timestamp": 1595191470.264838, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 19, "ttl": 56, "time_ms": 46.3}, {"type": "reply", "timestamp": 1595191471.266951, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 20, "ttl": 56, "time_ms": 45.4}]} +{"destination_ip": "2a04:4e42:2e::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19043.0, "round_trip_ms_min": 38.533, "round_trip_ms_avg": 44.877, "round_trip_ms_max": 51.366, "round_trip_ms_stddev": 3.83, "responses": [{"type": "reply", "timestamp": 1595191452.2553, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 1, "ttl": 56, "time_ms": 39.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191453.229184, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 2, "ttl": 56, "time_ms": 47.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191454.229065, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 3, "ttl": 56, "time_ms": 46.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191455.230571, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 4, "ttl": 56, "time_ms": 45.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191456.233811, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 5, "ttl": 56, "time_ms": 45.7, "duplicate": false}, {"type": "reply", "timestamp": 1595191457.228052, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 6, "ttl": 56, "time_ms": 38.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191458.228764, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 7, "ttl": 56, "time_ms": 39.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191459.243633, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 8, "ttl": 56, "time_ms": 51.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191460.243509, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 9, "ttl": 56, "time_ms": 49.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191461.242713, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 10, "ttl": 56, "time_ms": 46.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191462.246016, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 11, "ttl": 56, "time_ms": 47.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191463.240552, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 12, "ttl": 56, "time_ms": 38.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191464.248594, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 13, "ttl": 56, "time_ms": 44.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191465.254128, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 14, "ttl": 56, "time_ms": 48.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191466.253777, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 15, "ttl": 56, "time_ms": 45.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191467.259039, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 16, "ttl": 56, "time_ms": 47.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191468.252991, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 17, "ttl": 56, "time_ms": 38.5, "duplicate": false}, {"type": "reply", "timestamp": 1595191469.263167, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 18, "ttl": 56, "time_ms": 47.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191470.264838, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 19, "ttl": 56, "time_ms": 46.3, "duplicate": false}, {"type": "reply", "timestamp": 1595191471.266951, "bytes": 64, "response_ip": "2a04:4e42:2e::323", "icmp_seq": 20, "ttl": 56, "time_ms": 45.4, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping6-hostname-O-p.json b/tests/fixtures/fedora32/ping6-hostname-O-p.json index 2727f004..f379c7a3 100644 --- a/tests/fixtures/fedora32/ping6-hostname-O-p.json +++ b/tests/fixtures/fedora32/ping6-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:400::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19049.0, "round_trip_ms_min": 23.598, "round_trip_ms_avg": 65.877, "round_trip_ms_max": 281.064, "round_trip_ms_stddev": 72.64, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 1, "ttl": 59, "time_ms": 24.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 4, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 8, "ttl": 59, "time_ms": 31.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 9, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 10, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 11, "ttl": 59, "time_ms": 31.0}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 13, "ttl": 59, "time_ms": 31.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 14, "ttl": 59, "time_ms": 112.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 15, "ttl": 59, "time_ms": 162.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 16, "ttl": 59, "time_ms": 223.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 17, "ttl": 59, "time_ms": 281.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 18, "ttl": 59, "time_ms": 33.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 20, "ttl": 59, "time_ms": 42.3}]} +{"destination_ip": "2a04:4e42:400::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19049.0, "round_trip_ms_min": 23.598, "round_trip_ms_avg": 65.877, "round_trip_ms_max": 281.064, "round_trip_ms_stddev": 72.64, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 1, "ttl": 59, "time_ms": 24.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 4, "ttl": 59, "time_ms": 35.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 8, "ttl": 59, "time_ms": 31.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 9, "ttl": 59, "time_ms": 33.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 10, "ttl": 59, "time_ms": 32.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 11, "ttl": 59, "time_ms": 31.0, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 13, "ttl": 59, "time_ms": 31.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 14, "ttl": 59, "time_ms": 112.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 15, "ttl": 59, "time_ms": 162.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 16, "ttl": 59, "time_ms": 223.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 17, "ttl": 59, "time_ms": 281.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 18, "ttl": 59, "time_ms": 33.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 19, "ttl": 59, "time_ms": 32.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:400::323", "icmp_seq": 20, "ttl": 59, "time_ms": 42.3, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping6-ip-O-D-p.json b/tests/fixtures/fedora32/ping6-ip-O-D-p.json index 8240f3f0..afe1c1a4 100644 --- a/tests/fixtures/fedora32/ping6-ip-O-D-p.json +++ b/tests/fixtures/fedora32/ping6-ip-O-D-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19042.0, "round_trip_ms_min": 27.88, "round_trip_ms_avg": 45.072, "round_trip_ms_max": 148.38, "round_trip_ms_stddev": 27.078, "responses": [{"type": "reply", "timestamp": 1595191413.333769, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595191414.342973, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 41.9}, {"type": "reply", "timestamp": 1595191415.332214, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595191416.342603, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595191417.344996, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 37.6}, {"type": "reply", "timestamp": 1595191418.348619, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 37.9}, {"type": "reply", "timestamp": 1595191419.357154, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 44.4}, {"type": "reply", "timestamp": 1595191420.350087, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.1}, {"type": "reply", "timestamp": 1595191421.346691, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": 1595191422.355843, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 37.4}, {"type": "reply", "timestamp": 1595191423.397934, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 76.7}, {"type": "reply", "timestamp": 1595191424.470798, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 148.0}, {"type": "reply", "timestamp": 1595191425.358652, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595191426.404587, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 77.2}, {"type": "reply", "timestamp": 1595191427.359785, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 29.7}, {"type": "reply", "timestamp": 1595191428.367539, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1595191429.372551, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.2}, {"type": "reply", "timestamp": 1595191430.364571, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 27.9}, {"type": "reply", "timestamp": 1595191431.375232, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.1}, {"type": "reply", "timestamp": 1595191432.375802, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19042.0, "round_trip_ms_min": 27.88, "round_trip_ms_avg": 45.072, "round_trip_ms_max": 148.38, "round_trip_ms_stddev": 27.078, "responses": [{"type": "reply", "timestamp": 1595191413.333769, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191414.342973, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 41.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191415.332214, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191416.342603, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 36.8, "duplicate": false}, {"type": "reply", "timestamp": 1595191417.344996, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 37.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191418.348619, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 37.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191419.357154, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 44.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191420.350087, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191421.346691, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191422.355843, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 37.4, "duplicate": false}, {"type": "reply", "timestamp": 1595191423.397934, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 76.7, "duplicate": false}, {"type": "reply", "timestamp": 1595191424.470798, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 148.0, "duplicate": false}, {"type": "reply", "timestamp": 1595191425.358652, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 33.6, "duplicate": false}, {"type": "reply", "timestamp": 1595191426.404587, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 77.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191427.359785, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 29.7, "duplicate": false}, {"type": "reply", "timestamp": 1595191428.367539, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191429.372551, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 37.2, "duplicate": false}, {"type": "reply", "timestamp": 1595191430.364571, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 27.9, "duplicate": false}, {"type": "reply", "timestamp": 1595191431.375232, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 37.1, "duplicate": false}, {"type": "reply", "timestamp": 1595191432.375802, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3, "duplicate": false}]} diff --git a/tests/fixtures/fedora32/ping6-ip-O-p.json b/tests/fixtures/fedora32/ping6-ip-O-p.json index bffb4e06..80ad4766 100644 --- a/tests/fixtures/fedora32/ping6-ip-O-p.json +++ b/tests/fixtures/fedora32/ping6-ip-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 17, "packet_loss_percent": 15.0, "time_ms": 19193.0, "round_trip_ms_min": 26.566, "round_trip_ms_avg": 33.623, "round_trip_ms_max": 43.945, "round_trip_ms_stddev": 5.029, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.6}, {"type": "timeout", "timestamp": null, "icmp_seq": 3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 39.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 28.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 28.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.0}, {"type": "timeout", "timestamp": null, "icmp_seq": 16}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 43.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 37.9}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 17, "packet_loss_percent": 15.0, "duplicates": 0, "time_ms": 19193.0, "round_trip_ms_min": 26.566, "round_trip_ms_avg": 33.623, "round_trip_ms_max": 43.945, "round_trip_ms_stddev": 5.029, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.6, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 28.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 36.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 28.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 39.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 28.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 28.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 36.5, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 11}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 33.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 28.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 27.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.0, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 16}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 26.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 38.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 43.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 37.9, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-hostname-p.json b/tests/fixtures/freebsd12/ping-hostname-p.json index 1939bff6..613a5662 100644 --- a/tests/fixtures/freebsd12/ping-hostname-p.json +++ b/tests/fixtures/freebsd12/ping-hostname-p.json @@ -1 +1 @@ -{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 28.389, "round_trip_ms_avg": 31.745, "round_trip_ms_max": 34.505, "round_trip_ms_stddev": 2.532, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 32.34}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.505}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.389}]} +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 28.389, "round_trip_ms_avg": 31.745, "round_trip_ms_max": 34.505, "round_trip_ms_stddev": 2.532, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 32.34, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.505, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.389, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-hostname-s.json b/tests/fixtures/freebsd12/ping-hostname-s.json index 4d7cc535..d1d4c792 100644 --- a/tests/fixtures/freebsd12/ping-hostname-s.json +++ b/tests/fixtures/freebsd12/ping-hostname-s.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.03, "round_trip_ms_max": 0.038, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.03}]} +{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.03, "round_trip_ms_max": 0.038, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.038, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.03, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-hostname.json b/tests/fixtures/freebsd12/ping-hostname.json index b2ee156b..4aa3e97d 100644 --- a/tests/fixtures/freebsd12/ping-hostname.json +++ b/tests/fixtures/freebsd12/ping-hostname.json @@ -1 +1 @@ -{"destination_ip": "151.101.65.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 27.01, "round_trip_ms_avg": 33.831, "round_trip_ms_max": 42.506, "round_trip_ms_stddev": 6.461, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 0, "ttl": 59, "time_ms": 27.01}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.978}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 2, "ttl": 59, "time_ms": 42.506}]} +{"destination_ip": "151.101.65.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 27.01, "round_trip_ms_avg": 33.831, "round_trip_ms_max": 42.506, "round_trip_ms_stddev": 6.461, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 0, "ttl": 59, "time_ms": 27.01, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 1, "ttl": 59, "time_ms": 31.978, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.65.67", "icmp_seq": 2, "ttl": 59, "time_ms": 42.506, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-ip-p.json b/tests/fixtures/freebsd12/ping-ip-p.json index 52e94526..61aac4c1 100644 --- a/tests/fixtures/freebsd12/ping-ip-p.json +++ b/tests/fixtures/freebsd12/ping-ip-p.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.037, "round_trip_ms_max": 0.042, "round_trip_ms_stddev": 0.003, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.042}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.034}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.037, "round_trip_ms_max": 0.042, "round_trip_ms_stddev": 0.003, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.042, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.034, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-ip-s.json b/tests/fixtures/freebsd12/ping-ip-s.json index 774da68b..4c35a188 100644 --- a/tests/fixtures/freebsd12/ping-ip-s.json +++ b/tests/fixtures/freebsd12/ping-ip-s.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.024, "round_trip_ms_avg": 0.032, "round_trip_ms_max": 0.036, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.024}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.036}]} +{"destination_ip": "127.0.0.1", "data_bytes": 40, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.024, "round_trip_ms_avg": 0.032, "round_trip_ms_max": 0.036, "round_trip_ms_stddev": 0.006, "responses": [{"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.024, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.036, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping-ip.json b/tests/fixtures/freebsd12/ping-ip.json index 1fd3fffa..2e07de82 100644 --- a/tests/fixtures/freebsd12/ping-ip.json +++ b/tests/fixtures/freebsd12/ping-ip.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.033, "round_trip_ms_max": 0.041, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.041}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.022, "round_trip_ms_avg": 0.033, "round_trip_ms_max": 0.041, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.022, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.041, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname-p.json b/tests/fixtures/freebsd12/ping6-hostname-p.json index b7d1b245..dd805cb1 100644 --- a/tests/fixtures/freebsd12/ping6-hostname-p.json +++ b/tests/fixtures/freebsd12/ping6-hostname-p.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname-s.json b/tests/fixtures/freebsd12/ping6-hostname-s.json index 13373439..f801ab89 100644 --- a/tests/fixtures/freebsd12/ping6-hostname-s.json +++ b/tests/fixtures/freebsd12/ping6-hostname-s.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.035, "round_trip_ms_avg": 0.056, "round_trip_ms_max": 0.082, "round_trip_ms_stddev": 0.019, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.035}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.082}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.051}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.035, "round_trip_ms_avg": 0.056, "round_trip_ms_max": 0.082, "round_trip_ms_stddev": 0.019, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.035, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.082, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.051, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-hostname.json b/tests/fixtures/freebsd12/ping6-hostname.json index ea2b09fb..3d23bc01 100644 --- a/tests/fixtures/freebsd12/ping6-hostname.json +++ b/tests/fixtures/freebsd12/ping6-hostname.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.042, "round_trip_ms_max": 0.048, "round_trip_ms_stddev": 0.005, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "localhost", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.042, "round_trip_ms_max": 0.048, "round_trip_ms_stddev": 0.005, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.041, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.048, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-ip-p.json b/tests/fixtures/freebsd12/ping6-ip-p.json index 148a6ac3..e5c28f12 100644 --- a/tests/fixtures/freebsd12/ping6-ip-p.json +++ b/tests/fixtures/freebsd12/ping6-ip-p.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.054, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.054}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.045, "round_trip_ms_max": 0.054, "round_trip_ms_stddev": 0.007, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.054, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-ip-s.json b/tests/fixtures/freebsd12/ping6-ip-s.json index 79e07fc3..622f5e06 100644 --- a/tests/fixtures/freebsd12/ping6-ip-s.json +++ b/tests/fixtures/freebsd12/ping6-ip-s.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.058, "round_trip_ms_max": 0.088, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.088}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.049}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 88, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.036, "round_trip_ms_avg": 0.058, "round_trip_ms_max": 0.088, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.036, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.088, "duplicate": false}, {"type": "reply", "bytes": 48, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.049, "duplicate": false}]} diff --git a/tests/fixtures/freebsd12/ping6-ip.json b/tests/fixtures/freebsd12/ping6-ip.json index a8e48e12..29917e2d 100644 --- a/tests/fixtures/freebsd12/ping6-ip.json +++ b/tests/fixtures/freebsd12/ping6-ip.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.053, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.034}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.053}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.034, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.053, "round_trip_ms_stddev": 0.008, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.034, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.053, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.045, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-p.json b/tests/fixtures/osx-10.14.6/ping-hostname-p.json index 339cd958..34a25e39 100644 --- a/tests/fixtures/osx-10.14.6/ping-hostname-p.json +++ b/tests/fixtures/osx-10.14.6/ping-hostname-p.json @@ -1 +1 @@ -{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 89.422, "round_trip_ms_avg": 118.033, "round_trip_ms_max": 147.964, "round_trip_ms_stddev": 23.918, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 89.422}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 116.712}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 147.964}]} +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 89.422, "round_trip_ms_avg": 118.033, "round_trip_ms_max": 147.964, "round_trip_ms_stddev": 23.918, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 89.422, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 116.712, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 147.964, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-hostname-s.json b/tests/fixtures/osx-10.14.6/ping-hostname-s.json index ea60e894..12cfa26a 100644 --- a/tests/fixtures/osx-10.14.6/ping-hostname-s.json +++ b/tests/fixtures/osx-10.14.6/ping-hostname-s.json @@ -1 +1 @@ -{"destination_ip": "151.101.1.67", "data_bytes": 1400, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 29.954, "round_trip_ms_avg": 39.892, "round_trip_ms_max": 50.674, "round_trip_ms_stddev": 8.48, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 39.048}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.954}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 50.674}]} +{"destination_ip": "151.101.1.67", "data_bytes": 1400, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 29.954, "round_trip_ms_avg": 39.892, "round_trip_ms_max": 50.674, "round_trip_ms_stddev": 8.48, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 39.048, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 29.954, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 50.674, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-hostname.json b/tests/fixtures/osx-10.14.6/ping-hostname.json index d0be6a4e..7e3acfbf 100644 --- a/tests/fixtures/osx-10.14.6/ping-hostname.json +++ b/tests/fixtures/osx-10.14.6/ping-hostname.json @@ -1 +1 @@ -{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 28.042, "round_trip_ms_avg": 34.67, "round_trip_ms_max": 41.182, "round_trip_ms_stddev": 5.365, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 28.042}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.786}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 41.182}]} +{"destination_ip": "151.101.1.67", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 28.042, "round_trip_ms_avg": 34.67, "round_trip_ms_max": 41.182, "round_trip_ms_stddev": 5.365, "responses": [{"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, "time_ms": 28.042, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, "time_ms": 34.786, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, "time_ms": 41.182, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip-dup.json b/tests/fixtures/osx-10.14.6/ping-ip-dup.json new file mode 100644 index 00000000..5688383e --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping-ip-dup.json @@ -0,0 +1 @@ +{"destination_ip": "192.168.1.255", "data_bytes": 56, "pattern": null, "destination": "192.168.1.255", "packets_transmitted": 2, "packets_received": 2, "packet_loss_percent": 0.0, "duplicates": 13, "round_trip_ms_min": 0.235, "round_trip_ms_avg": 226.389, "round_trip_ms_max": 1084.262, "round_trip_ms_stddev": 344.729, "responses": [{"type": "reply", "bytes": 64, "response_ip": "192.168.1.221", "icmp_seq": 0, "ttl": 64, "time_ms": 0.235, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.88", "icmp_seq": 0, "ttl": 64, "time_ms": 4.224, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.89", "icmp_seq": 0, "ttl": 64, "time_ms": 8.37, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.72", "icmp_seq": 0, "ttl": 64, "time_ms": 62.635, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.246", "icmp_seq": 0, "ttl": 255, "time_ms": 62.805, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.78", "icmp_seq": 0, "ttl": 128, "time_ms": 63.803, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.251", "icmp_seq": 0, "ttl": 64, "time_ms": 63.857, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.217", "icmp_seq": 0, "ttl": 255, "time_ms": 672.974, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.186", "icmp_seq": 0, "ttl": 64, "time_ms": 673.123, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.75", "icmp_seq": 0, "ttl": 64, "time_ms": 673.358, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.221", "icmp_seq": 1, "ttl": 64, "time_ms": 0.291, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.78", "icmp_seq": 1, "ttl": 128, "time_ms": 7.898, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.88", "icmp_seq": 1, "ttl": 64, "time_ms": 7.927, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.89", "icmp_seq": 1, "ttl": 64, "time_ms": 10.077, "duplicate": true}, {"type": "reply", "bytes": 64, "response_ip": "192.168.1.250", "icmp_seq": 0, "ttl": 64, "time_ms": 1084.262, "duplicate": true}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip-p.json b/tests/fixtures/osx-10.14.6/ping-ip-p.json index 6510c853..8831c4db 100644 --- a/tests/fixtures/osx-10.14.6/ping-ip-p.json +++ b/tests/fixtures/osx-10.14.6/ping-ip-p.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.078, "round_trip_ms_max": 0.104, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.104}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.079}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": "0xff", "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.078, "round_trip_ms_max": 0.104, "round_trip_ms_stddev": 0.022, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.104, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.079, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip-s.json b/tests/fixtures/osx-10.14.6/ping-ip-s.json index 2334c21a..6fc090d9 100644 --- a/tests/fixtures/osx-10.14.6/ping-ip-s.json +++ b/tests/fixtures/osx-10.14.6/ping-ip-s.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 1400, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.053, "round_trip_ms_avg": 0.083, "round_trip_ms_max": 0.108, "round_trip_ms_stddev": 0.023, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.053}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.108}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.089}]} +{"destination_ip": "127.0.0.1", "data_bytes": 1400, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.053, "round_trip_ms_avg": 0.083, "round_trip_ms_max": 0.108, "round_trip_ms_stddev": 0.023, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.053, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.108, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.089, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping-ip.json b/tests/fixtures/osx-10.14.6/ping-ip.json index baa476ac..4c2fb14c 100644 --- a/tests/fixtures/osx-10.14.6/ping-ip.json +++ b/tests/fixtures/osx-10.14.6/ping-ip.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.066, "round_trip_ms_max": 0.095, "round_trip_ms_stddev": 0.021, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.095}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.05}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.05, "round_trip_ms_avg": 0.066, "round_trip_ms_max": 0.095, "round_trip_ms_stddev": 0.021, "responses": [{"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.052, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.095, "duplicate": false}, {"type": "reply", "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.05, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-p.json b/tests/fixtures/osx-10.14.6/ping6-hostname-p.json index e7135a70..3c49bfd1 100644 --- a/tests/fixtures/osx-10.14.6/ping6-hostname-p.json +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-p.json @@ -1 +1 @@ -{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 32.992, "round_trip_ms_avg": 34.606, "round_trip_ms_max": 36.07, "round_trip_ms_stddev": 1.261, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 32.992}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.757}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.07}]} +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": "0xff", "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 32.992, "round_trip_ms_avg": 34.606, "round_trip_ms_max": 36.07, "round_trip_ms_stddev": 1.261, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 32.992, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 34.757, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 36.07, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname-s.json b/tests/fixtures/osx-10.14.6/ping6-hostname-s.json index 19bd2313..1eb1ccde 100644 --- a/tests/fixtures/osx-10.14.6/ping6-hostname-s.json +++ b/tests/fixtures/osx-10.14.6/ping6-hostname-s.json @@ -1 +1 @@ -{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:600::323", "data_bytes": 128, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 25.933, "round_trip_ms_avg": 38.979, "round_trip_ms_max": 64.712, "round_trip_ms_stddev": 18.197, "responses": [{"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 0, "ttl": 59, "time_ms": 26.292}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 64.712}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 25.933}]} +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:600::323", "data_bytes": 128, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 25.933, "round_trip_ms_avg": 38.979, "round_trip_ms_max": 64.712, "round_trip_ms_stddev": 18.197, "responses": [{"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 0, "ttl": 59, "time_ms": 26.292, "duplicate": false}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 64.712, "duplicate": false}, {"type": "reply", "bytes": 88, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 25.933, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-hostname.json b/tests/fixtures/osx-10.14.6/ping6-hostname.json index f37669f5..2b9f0b2b 100644 --- a/tests/fixtures/osx-10.14.6/ping6-hostname.json +++ b/tests/fixtures/osx-10.14.6/ping6-hostname.json @@ -1 +1 @@ -{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 27.684, "round_trip_ms_avg": 29.836, "round_trip_ms_max": 31.824, "round_trip_ms_stddev": 1.694, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 27.684}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 31.824}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.0}]} +{"source_ip": "2600:1700:bab0:d40:2595:8c97:ad16:749a", "destination_ip": "2a04:4e42:200::323", "data_bytes": 56, "pattern": null, "destination": "cnn.com", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 27.684, "round_trip_ms_avg": 29.836, "round_trip_ms_max": 31.824, "round_trip_ms_stddev": 1.694, "responses": [{"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 0, "ttl": 59, "time_ms": 27.684, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 1, "ttl": 59, "time_ms": 31.824, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "2a04:4e42:200::323", "icmp_seq": 2, "ttl": 59, "time_ms": 30.0, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-p.json b/tests/fixtures/osx-10.14.6/ping6-ip-p.json index fdc04dca..1f07d57d 100644 --- a/tests/fixtures/osx-10.14.6/ping6-ip-p.json +++ b/tests/fixtures/osx-10.14.6/ping6-ip-p.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.077, "round_trip_ms_avg": 0.124, "round_trip_ms_max": 0.156, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.077}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.156}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.139}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": "0xff", "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.077, "round_trip_ms_avg": 0.124, "round_trip_ms_max": 0.156, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.077, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.156, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.139, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-s.json b/tests/fixtures/osx-10.14.6/ping6-ip-s.json index 4ed7adda..0059f6f6 100644 --- a/tests/fixtures/osx-10.14.6/ping6-ip-s.json +++ b/tests/fixtures/osx-10.14.6/ping6-ip-s.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 1448, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.093, "round_trip_ms_avg": 0.135, "round_trip_ms_max": 0.161, "round_trip_ms_stddev": 0.03, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.093}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.161}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.152}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 1448, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.093, "round_trip_ms_avg": 0.135, "round_trip_ms_max": 0.161, "round_trip_ms_stddev": 0.03, "responses": [{"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.093, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.161, "duplicate": false}, {"type": "reply", "bytes": 1408, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.152, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip.json b/tests/fixtures/osx-10.14.6/ping6-ip.json index 929fca43..93992d44 100644 --- a/tests/fixtures/osx-10.14.6/ping6-ip.json +++ b/tests/fixtures/osx-10.14.6/ping6-ip.json @@ -1 +1 @@ -{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "round_trip_ms_min": 0.071, "round_trip_ms_avg": 0.115, "round_trip_ms_max": 0.153, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.071}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.153}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.122}]} +{"source_ip": "::1", "destination_ip": "::1", "data_bytes": 56, "pattern": null, "destination": "::1", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 0.071, "round_trip_ms_avg": 0.115, "round_trip_ms_max": 0.153, "round_trip_ms_stddev": 0.034, "responses": [{"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 0, "ttl": 64, "time_ms": 0.071, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.153, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "::1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.122, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json index 6ba36705..34eb45e2 100644 --- a/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19040.0, "round_trip_ms_min": 26.767, "round_trip_ms_avg": 33.782, "round_trip_ms_max": 44.159, "round_trip_ms_stddev": 3.954, "responses": [{"type": "reply", "timestamp": 1595103464.996693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.7}, {"type": "reply", "timestamp": 1595103466.001289, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.5}, {"type": "reply", "timestamp": 1595103467.004316, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595103468.009966, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.2}, {"type": "reply", "timestamp": 1595103469.013655, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": 1595103470.014253, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": 1595103471.02653, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 44.1}, {"type": "reply", "timestamp": 1595103472.019493, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.9}, {"type": "reply", "timestamp": 1595103473.021432, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1595103474.015603, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 27.4}, {"type": "reply", "timestamp": 1595103475.02676, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 36.9}, {"type": "reply", "timestamp": 1595103476.02693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1595103477.031093, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 36.8}, {"type": "reply", "timestamp": 1595103478.028918, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": 1595103479.032238, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.6}, {"type": "reply", "timestamp": 1595103480.032097, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": 1595103481.034546, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": 1595103482.037939, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7}, {"type": "reply", "timestamp": 1595103483.041514, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 35.8}, {"type": "reply", "timestamp": 1595103484.03911, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 29.3}]} +{"destination_ip": "151.101.189.67", "data_bytes": 1400, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19040.0, "round_trip_ms_min": 26.767, "round_trip_ms_avg": 33.782, "round_trip_ms_max": 44.159, "round_trip_ms_stddev": 3.954, "responses": [{"type": "reply", "timestamp": 1595103464.996693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.7, "duplicate": false}, {"type": "reply", "timestamp": 1595103466.001289, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 28.5, "duplicate": false}, {"type": "reply", "timestamp": 1595103467.004316, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 28.8, "duplicate": false}, {"type": "reply", "timestamp": 1595103468.009966, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.2, "duplicate": false}, {"type": "reply", "timestamp": 1595103469.013655, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": 1595103470.014253, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 34.2, "duplicate": false}, {"type": "reply", "timestamp": 1595103471.02653, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 44.1, "duplicate": false}, {"type": "reply", "timestamp": 1595103472.019493, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.9, "duplicate": false}, {"type": "reply", "timestamp": 1595103473.021432, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 35.6, "duplicate": false}, {"type": "reply", "timestamp": 1595103474.015603, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 27.4, "duplicate": false}, {"type": "reply", "timestamp": 1595103475.02676, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 36.9, "duplicate": false}, {"type": "reply", "timestamp": 1595103476.02693, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 35.7, "duplicate": false}, {"type": "reply", "timestamp": 1595103477.031093, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 36.8, "duplicate": false}, {"type": "reply", "timestamp": 1595103478.028918, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 33.1, "duplicate": false}, {"type": "reply", "timestamp": 1595103479.032238, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.6, "duplicate": false}, {"type": "reply", "timestamp": 1595103480.032097, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3, "duplicate": false}, {"type": "reply", "timestamp": 1595103481.034546, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 34.8, "duplicate": false}, {"type": "reply", "timestamp": 1595103482.037939, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 35.7, "duplicate": false}, {"type": "reply", "timestamp": 1595103483.041514, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 35.8, "duplicate": false}, {"type": "reply", "timestamp": 1595103484.03911, "bytes": 1408, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 29.3, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json index 7e24bc15..ec57c879 100644 --- a/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19052.0, "round_trip_ms_min": 24.785, "round_trip_ms_avg": 41.856, "round_trip_ms_max": 143.789, "round_trip_ms_stddev": 27.768, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 25.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 27.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 32.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 32.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 24.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 74.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 31.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 85.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 143.0}]} +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": "0xabcd", "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19052.0, "round_trip_ms_min": 24.785, "round_trip_ms_avg": 41.856, "round_trip_ms_max": 143.789, "round_trip_ms_stddev": 27.768, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 26.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 34.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 34.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 25.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 33.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 34.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 27.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 32.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 32.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 24.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 35.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 74.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 31.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 85.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 143.0, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-hostname-O.json b/tests/fixtures/ubuntu-18.04/ping-hostname-O.json index f6815a10..49cc748c 100644 --- a/tests/fixtures/ubuntu-18.04/ping-hostname-O.json +++ b/tests/fixtures/ubuntu-18.04/ping-hostname-O.json @@ -1 +1 @@ -{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19290.0, "round_trip_ms_min": 24.33, "round_trip_ms_avg": 30.42, "round_trip_ms_max": 35.259, "round_trip_ms_stddev": 3.84, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 24.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 26.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 34.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 34.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 33.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 26.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 35.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 34.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 27.1}]} +{"destination_ip": "151.101.189.67", "data_bytes": 56, "pattern": null, "destination": "turner-tls.map.fastly.net", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19290.0, "round_trip_ms_min": 24.33, "round_trip_ms_avg": 30.42, "round_trip_ms_max": 35.259, "round_trip_ms_stddev": 3.84, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 1, "ttl": 59, "time_ms": 26.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 2, "ttl": 59, "time_ms": 24.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 3, "ttl": 59, "time_ms": 32.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 4, "ttl": 59, "time_ms": 33.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 5, "ttl": 59, "time_ms": 32.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 6, "ttl": 59, "time_ms": 26.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 7, "ttl": 59, "time_ms": 34.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 8, "ttl": 59, "time_ms": 24.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 9, "ttl": 59, "time_ms": 34.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 10, "ttl": 59, "time_ms": 33.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 11, "ttl": 59, "time_ms": 33.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 12, "ttl": 59, "time_ms": 28.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 13, "ttl": 59, "time_ms": 33.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 14, "ttl": 59, "time_ms": 26.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 15, "ttl": 59, "time_ms": 27.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 16, "ttl": 59, "time_ms": 33.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 17, "ttl": 59, "time_ms": 35.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 18, "ttl": 59, "time_ms": 26.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 19, "ttl": 59, "time_ms": 34.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "151.101.189.67", "icmp_seq": 20, "ttl": 59, "time_ms": 27.1, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json index 89cec649..8de4e694 100644 --- a/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O-D.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19452.0, "round_trip_ms_min": 0.017, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": 1595102903.313934, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.017}, {"type": "reply", "timestamp": 1595102904.33341, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.033}, {"type": "reply", "timestamp": 1595102905.35791, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": 1595102906.3814, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.039}, {"type": "reply", "timestamp": 1595102907.406752, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102908.430739, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102909.454753, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102910.478765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102911.50115, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.027}, {"type": "reply", "timestamp": 1595102912.525888, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102913.550088, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102914.574405, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.04}, {"type": "reply", "timestamp": 1595102915.598696, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102916.622554, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.049}, {"type": "reply", "timestamp": 1595102917.646755, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102918.670765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": 1595102919.693157, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102920.717034, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.038}, {"type": "reply", "timestamp": 1595102921.741629, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": 1595102922.766421, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.05}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19452.0, "round_trip_ms_min": 0.017, "round_trip_ms_avg": 0.044, "round_trip_ms_max": 0.051, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": 1595102903.313934, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.017, "duplicate": false}, {"type": "reply", "timestamp": 1595102904.33341, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.033, "duplicate": false}, {"type": "reply", "timestamp": 1595102905.35791, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.041, "duplicate": false}, {"type": "reply", "timestamp": 1595102906.3814, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.039, "duplicate": false}, {"type": "reply", "timestamp": 1595102907.406752, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102908.430739, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102909.454753, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": 1595102910.478765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102911.50115, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.027, "duplicate": false}, {"type": "reply", "timestamp": 1595102912.525888, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": 1595102913.550088, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102914.574405, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.04, "duplicate": false}, {"type": "reply", "timestamp": 1595102915.598696, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102916.622554, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.049, "duplicate": false}, {"type": "reply", "timestamp": 1595102917.646755, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102918.670765, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": 1595102919.693157, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102920.717034, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.038, "duplicate": false}, {"type": "reply", "timestamp": 1595102921.741629, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": 1595102922.766421, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.05, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping-ip-O.json b/tests/fixtures/ubuntu-18.04/ping-ip-O.json index bd15fefb..4ff87e99 100644 --- a/tests/fixtures/ubuntu-18.04/ping-ip-O.json +++ b/tests/fixtures/ubuntu-18.04/ping-ip-O.json @@ -1 +1 @@ -{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19434.0, "round_trip_ms_min": 0.02, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.057, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.02}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.027}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.041}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.052}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.057}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.051}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.049}]} +{"destination_ip": "127.0.0.1", "data_bytes": 56, "pattern": null, "destination": "127.0.0.1", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19434.0, "round_trip_ms_min": 0.02, "round_trip_ms_avg": 0.047, "round_trip_ms_max": 0.057, "round_trip_ms_stddev": 0.01, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 1, "ttl": 64, "time_ms": 0.02, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 2, "ttl": 64, "time_ms": 0.043, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 3, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 4, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 5, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 6, "ttl": 64, "time_ms": 0.027, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 7, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 8, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 9, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 10, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 11, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 12, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 13, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 14, "ttl": 64, "time_ms": 0.041, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 15, "ttl": 64, "time_ms": 0.052, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 16, "ttl": 64, "time_ms": 0.057, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 17, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 18, "ttl": 64, "time_ms": 0.051, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 19, "ttl": 64, "time_ms": 0.05, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "127.0.0.1", "icmp_seq": 20, "ttl": 64, "time_ms": 0.049, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json index 09c151fb..0c606259 100644 --- a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p-s.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "time_ms": 19050.0, "round_trip_ms_min": 25.086, "round_trip_ms_avg": 37.398, "round_trip_ms_max": 162.132, "round_trip_ms_stddev": 28.854, "responses": [{"type": "reply", "timestamp": 1595102963.207191, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 162.0}, {"type": "reply", "timestamp": 1595102964.072572, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 26.2}, {"type": "reply", "timestamp": 1595102965.083093, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 34.0}, {"type": "reply", "timestamp": 1595102966.086221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.6}, {"type": "reply", "timestamp": 1595102967.088365, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.9}, {"type": "reply", "timestamp": 1595102968.090956, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 33.5}, {"type": "reply", "timestamp": 1595102969.088229, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": 1595102970.08863, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 25.0}, {"type": "reply", "timestamp": 1595102971.093828, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 27.0}, {"type": "reply", "timestamp": 1595102972.104782, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 35.3}, {"type": "reply", "timestamp": 1595102973.098518, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 27.1}, {"type": "reply", "timestamp": 1595102974.108744, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.0}, {"type": "reply", "timestamp": 1595102975.104919, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.4}, {"type": "reply", "timestamp": 1595102976.103486, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 26.1}, {"type": "reply", "timestamp": 1595102977.107027, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 27.2}, {"type": "reply", "timestamp": 1595102978.111345, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 28.3}, {"type": "reply", "timestamp": 1595102979.121028, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.9}, {"type": "reply", "timestamp": 1595102980.116465, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 28.8}, {"type": "reply", "timestamp": 1595102981.126039, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 34.7}, {"type": "reply", "timestamp": 1595102982.12868, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3}]} +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 1400, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 20, "packet_loss_percent": 0.0, "duplicates": 0, "time_ms": 19050.0, "round_trip_ms_min": 25.086, "round_trip_ms_avg": 37.398, "round_trip_ms_max": 162.132, "round_trip_ms_stddev": 28.854, "responses": [{"type": "reply", "timestamp": 1595102963.207191, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 162.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102964.072572, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 26.2, "duplicate": false}, {"type": "reply", "timestamp": 1595102965.083093, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 34.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102966.086221, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.6, "duplicate": false}, {"type": "reply", "timestamp": 1595102967.088365, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 32.9, "duplicate": false}, {"type": "reply", "timestamp": 1595102968.090956, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 33.5, "duplicate": false}, {"type": "reply", "timestamp": 1595102969.088229, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.6, "duplicate": false}, {"type": "reply", "timestamp": 1595102970.08863, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 25.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102971.093828, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 27.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102972.104782, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 35.3, "duplicate": false}, {"type": "reply", "timestamp": 1595102973.098518, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 27.1, "duplicate": false}, {"type": "reply", "timestamp": 1595102974.108744, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 36.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102975.104919, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 30.4, "duplicate": false}, {"type": "reply", "timestamp": 1595102976.103486, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 26.1, "duplicate": false}, {"type": "reply", "timestamp": 1595102977.107027, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 27.2, "duplicate": false}, {"type": "reply", "timestamp": 1595102978.111345, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 28.3, "duplicate": false}, {"type": "reply", "timestamp": 1595102979.121028, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.9, "duplicate": false}, {"type": "reply", "timestamp": 1595102980.116465, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 28.8, "duplicate": false}, {"type": "reply", "timestamp": 1595102981.126039, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 34.7, "duplicate": false}, {"type": "reply", "timestamp": 1595102982.12868, "bytes": 1408, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 34.3, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json index e9888e9d..d77458bd 100644 --- a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-D-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "time_ms": 19052.0, "round_trip_ms_min": 24.671, "round_trip_ms_avg": 30.617, "round_trip_ms_max": 33.654, "round_trip_ms_stddev": 3.419, "responses": [{"type": "reply", "timestamp": 1595102982.159725, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.9}, {"type": "reply", "timestamp": 1595102983.167501, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 33.0}, {"type": "reply", "timestamp": 1595102984.169378, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": 1595102985.163818, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 25.7}, {"type": "reply", "timestamp": 1595102986.167583, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": 1595102987.175507, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.5}, {"type": "reply", "timestamp": 1595102988.171549, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 25.8}, {"type": "reply", "timestamp": 1595102989.181855, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595102990.176307, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": 1595102991.188111, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.0}, {"type": "timeout", "timestamp": 1595102993.166385, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102993.198594, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1595102994.201841, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 32.8}, {"type": "timeout", "timestamp": 1595102996.17406, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102996.207576, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.3}, {"type": "reply", "timestamp": 1595102997.211141, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 33.6}, {"type": "reply", "timestamp": 1595102998.210588, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 32.0}, {"type": "reply", "timestamp": 1595102999.20548, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 25.4}, {"type": "reply", "timestamp": 1595103000.216799, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 33.5}, {"type": "reply", "timestamp": 1595103001.217993, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 32.8}]} +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "duplicates": 0, "time_ms": 19052.0, "round_trip_ms_min": 24.671, "round_trip_ms_avg": 30.617, "round_trip_ms_max": 33.654, "round_trip_ms_stddev": 3.419, "responses": [{"type": "reply", "timestamp": 1595102982.159725, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.9, "duplicate": false}, {"type": "reply", "timestamp": 1595102983.167501, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 33.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102984.169378, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 33.1, "duplicate": false}, {"type": "reply", "timestamp": 1595102985.163818, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 25.7, "duplicate": false}, {"type": "reply", "timestamp": 1595102986.167583, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 26.5, "duplicate": false}, {"type": "reply", "timestamp": 1595102987.175507, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 32.5, "duplicate": false}, {"type": "reply", "timestamp": 1595102988.171549, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 25.8, "duplicate": false}, {"type": "reply", "timestamp": 1595102989.181855, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 33.6, "duplicate": false}, {"type": "reply", "timestamp": 1595102990.176307, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 24.6, "duplicate": false}, {"type": "reply", "timestamp": 1595102991.188111, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.0, "duplicate": false}, {"type": "timeout", "timestamp": 1595102993.166385, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102993.198594, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 12, "ttl": 59, "time_ms": 32.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102994.201841, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 32.8, "duplicate": false}, {"type": "timeout", "timestamp": 1595102996.17406, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102996.207576, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 33.3, "duplicate": false}, {"type": "reply", "timestamp": 1595102997.211141, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 33.6, "duplicate": false}, {"type": "reply", "timestamp": 1595102998.210588, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 32.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102999.20548, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 18, "ttl": 59, "time_ms": 25.4, "duplicate": false}, {"type": "reply", "timestamp": 1595103000.216799, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 33.5, "duplicate": false}, {"type": "reply", "timestamp": 1595103001.217993, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 32.8, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json index 2bdb9d3e..54fab070 100644 --- a/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json +++ b/tests/fixtures/ubuntu-18.04/ping6-hostname-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "time_ms": 19081.0, "round_trip_ms_min": 25.229, "round_trip_ms_avg": 38.451, "round_trip_ms_max": 151.911, "round_trip_ms_stddev": 28.221, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 25.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 27.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 26.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 27.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 33.5}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 25.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 25.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.4}, {"type": "timeout", "timestamp": null, "icmp_seq": 18}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 151.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 51.5}]} +{"destination_ip": "2a04:4e42:2d::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "www.cnn.com", "packets_transmitted": 20, "packets_received": 18, "packet_loss_percent": 10.0, "duplicates": 0, "time_ms": 19081.0, "round_trip_ms_min": 25.229, "round_trip_ms_avg": 38.451, "round_trip_ms_max": 151.911, "round_trip_ms_stddev": 28.221, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 1, "ttl": 59, "time_ms": 25.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 2, "ttl": 59, "time_ms": 27.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 3, "ttl": 59, "time_ms": 26.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 4, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 5, "ttl": 59, "time_ms": 27.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 6, "ttl": 59, "time_ms": 34.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 7, "ttl": 59, "time_ms": 26.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 8, "ttl": 59, "time_ms": 35.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 9, "ttl": 59, "time_ms": 26.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 10, "ttl": 59, "time_ms": 33.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 11, "ttl": 59, "time_ms": 33.5, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 12}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 13, "ttl": 59, "time_ms": 25.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 14, "ttl": 59, "time_ms": 25.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 15, "ttl": 59, "time_ms": 36.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 16, "ttl": 59, "time_ms": 34.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 17, "ttl": 59, "time_ms": 35.4, "duplicate": false}, {"type": "timeout", "timestamp": null, "icmp_seq": 18}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 19, "ttl": 59, "time_ms": 151.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:2d::323", "icmp_seq": 20, "ttl": 59, "time_ms": 51.5, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json index 44d96a1f..84791fe5 100644 --- a/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-D-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 15, "packet_loss_percent": 25.0, "time_ms": 19161.0, "round_trip_ms_min": 21.405, "round_trip_ms_avg": 45.041, "round_trip_ms_max": 159.38, "round_trip_ms_stddev": 38.693, "responses": [{"type": "reply", "timestamp": 1595102942.853155, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": 1595102943.857295, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 29.4}, {"type": "reply", "timestamp": 1595102944.861751, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 31.2}, {"type": "timeout", "timestamp": 1595102946.861681, "icmp_seq": 4}, {"type": "reply", "timestamp": 1595102946.891881, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 30.0}, {"type": "reply", "timestamp": 1595102947.884818, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 22.0}, {"type": "reply", "timestamp": 1595102948.89152, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.2}, {"type": "reply", "timestamp": 1595102949.897424, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 30.5}, {"type": "reply", "timestamp": 1595102950.89982, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.0}, {"type": "reply", "timestamp": 1595102951.905148, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 31.3}, {"type": "timeout", "timestamp": 1595102953.901458, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102953.93159, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 29.9}, {"type": "timeout", "timestamp": 1595102955.918953, "icmp_seq": 13}, {"type": "timeout", "timestamp": 1595102956.942898, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102956.973463, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.4}, {"type": "reply", "timestamp": 1595102957.966655, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 21.4}, {"type": "timeout", "timestamp": 1595102959.981759, "icmp_seq": 17}, {"type": "reply", "timestamp": 1595102960.035095, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 53.2}, {"type": "reply", "timestamp": 1595102961.106079, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 121.0}, {"type": "reply", "timestamp": 1595102962.145647, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 159.0}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 15, "packet_loss_percent": 25.0, "duplicates": 0, "time_ms": 19161.0, "round_trip_ms_min": 21.405, "round_trip_ms_avg": 45.041, "round_trip_ms_max": 159.38, "round_trip_ms_stddev": 38.693, "responses": [{"type": "reply", "timestamp": 1595102942.853155, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 28.4, "duplicate": false}, {"type": "reply", "timestamp": 1595102943.857295, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 29.4, "duplicate": false}, {"type": "reply", "timestamp": 1595102944.861751, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 31.2, "duplicate": false}, {"type": "timeout", "timestamp": 1595102946.861681, "icmp_seq": 4}, {"type": "reply", "timestamp": 1595102946.891881, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 30.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102947.884818, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 22.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102948.89152, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 27.2, "duplicate": false}, {"type": "reply", "timestamp": 1595102949.897424, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 30.5, "duplicate": false}, {"type": "reply", "timestamp": 1595102950.89982, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 29.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102951.905148, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 31.3, "duplicate": false}, {"type": "timeout", "timestamp": 1595102953.901458, "icmp_seq": 11}, {"type": "reply", "timestamp": 1595102953.93159, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 29.9, "duplicate": false}, {"type": "timeout", "timestamp": 1595102955.918953, "icmp_seq": 13}, {"type": "timeout", "timestamp": 1595102956.942898, "icmp_seq": 14}, {"type": "reply", "timestamp": 1595102956.973463, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.4, "duplicate": false}, {"type": "reply", "timestamp": 1595102957.966655, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 21.4, "duplicate": false}, {"type": "timeout", "timestamp": 1595102959.981759, "icmp_seq": 17}, {"type": "reply", "timestamp": 1595102960.035095, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 53.2, "duplicate": false}, {"type": "reply", "timestamp": 1595102961.106079, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 121.0, "duplicate": false}, {"type": "reply", "timestamp": 1595102962.145647, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 20, "ttl": 59, "time_ms": 159.0, "duplicate": false}]} diff --git a/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json index 7a61a38c..3fbf2824 100644 --- a/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json +++ b/tests/fixtures/ubuntu-18.04/ping6-ip-O-p.json @@ -1 +1 @@ -{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "time_ms": 19046.0, "round_trip_ms_min": 21.403, "round_trip_ms_avg": 24.901, "round_trip_ms_max": 30.176, "round_trip_ms_stddev": 3.056, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.8}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 24.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 21.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 28.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 23.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 21.4}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 22.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 22.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 29.3}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 22.6}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 22.7}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 22.0}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.1}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 24.2}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 22.9}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 24.5}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 29.9}]} +{"destination_ip": "2a04:4e42:600::323", "data_bytes": 56, "pattern": "0xabcd", "destination": "2a04:4e42:600::323", "packets_transmitted": 20, "packets_received": 19, "packet_loss_percent": 5.0, "duplicates": 0, "time_ms": 19046.0, "round_trip_ms_min": 21.403, "round_trip_ms_avg": 24.901, "round_trip_ms_max": 30.176, "round_trip_ms_stddev": 3.056, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 1, "ttl": 59, "time_ms": 26.8, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 2, "ttl": 59, "time_ms": 24.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 3, "ttl": 59, "time_ms": 23.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 4, "ttl": 59, "time_ms": 21.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 5, "ttl": 59, "time_ms": 28.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 6, "ttl": 59, "time_ms": 23.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 7, "ttl": 59, "time_ms": 21.4, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 8, "ttl": 59, "time_ms": 22.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 9, "ttl": 59, "time_ms": 22.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 10, "ttl": 59, "time_ms": 29.3, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 11, "ttl": 59, "time_ms": 22.6, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 12, "ttl": 59, "time_ms": 22.7, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 13, "ttl": 59, "time_ms": 29.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 14, "ttl": 59, "time_ms": 22.0, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 15, "ttl": 59, "time_ms": 30.1, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 16, "ttl": 59, "time_ms": 24.2, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 17, "ttl": 59, "time_ms": 22.9, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 18, "ttl": 59, "time_ms": 24.5, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "2a04:4e42:600::323", "icmp_seq": 19, "ttl": 59, "time_ms": 29.9, "duplicate": false}]} From 7e1b0410166c584775ebcd681a280ec7321560c7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 15:12:43 -0700 Subject: [PATCH 25/80] add duplicate replies tests --- tests/test_ping.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_ping.py b/tests/test_ping.py index f16bdcf8..19932a7f 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -39,6 +39,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.out'), 'r', encoding='utf-8') as f: self.centos_7_7_ping6_hostname_O_D_p_s = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-dup.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_dup = f.read() + # ubuntu with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.out'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_ping_ip_O = f.read() @@ -169,6 +172,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip.out'), 'r', encoding='utf-8') as f: self.osx_10_14_6_ping6_ip = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-dup.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_dup = f.read() + # output # centos @@ -199,6 +205,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-hostname-O-D-p-s.json'), 'r', encoding='utf-8') as f: self.centos_7_7_ping6_hostname_O_D_p_s_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-dup.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping_ip_dup_json = json.loads(f.read()) + # ubunutu with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.json'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_ping_ip_O_json = json.loads(f.read()) @@ -329,6 +338,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_ping6_ip_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-dup.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping_ip_dup_json = json.loads(f.read()) + def test_ping_nodata(self): """ Test 'ping' with no data @@ -389,6 +401,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_hostname_O_D_p_s, quiet=True), self.centos_7_7_ping6_hostname_O_D_p_s_json) + def test_ping_ip_dup_centos_7_7(self): + """ + Test 'ping ' to broadcast IP to get duplicate replies on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_dup, quiet=True), self.centos_7_7_ping_ip_dup_json) + def test_ping_ip_O_ubuntu_18_4(self): """ Test 'ping -O' on Ubuntu 18.4 @@ -641,6 +659,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip, quiet=True), self.osx_10_14_6_ping6_ip_json) + def test_ping_ip_dup_osx_10_14_6(self): + """ + Test 'ping ' to broadcast IP to get duplicate replies on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_dup, quiet=True), self.osx_10_14_6_ping_ip_dup_json) + if __name__ == '__main__': unittest.main() From 778d1bacbf8df523d434b22f5e1517955e4c15ee Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 15:16:39 -0700 Subject: [PATCH 26/80] update docs to add "duplicates" fields --- docs/parsers/ping.md | 20 ++++++++++++++------ jc/parsers/ping.py | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index 6d8e8134..59e2e50a 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -22,6 +22,7 @@ Examples: "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, + "duplicates": 0, "round_trip_ms_min": 28.015, "round_trip_ms_avg": 32.848, "round_trip_ms_max": 39.376, @@ -33,7 +34,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, - "time_ms": 28.015 + "time_ms": 28.015, + "duplicate": false }, { "type": "reply", @@ -41,7 +43,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, - "time_ms": 39.376 + "time_ms": 39.376, + "duplicate": false }, { "type": "reply", @@ -49,7 +52,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, - "time_ms": 31.153 + "time_ms": 31.153, + "duplicate": false } ] } @@ -64,6 +68,7 @@ Examples: "packets_transmitted": "3", "packets_received": "3", "packet_loss_percent": "0.0", + "duplicates": "0", "round_trip_ms_min": "25.078", "round_trip_ms_avg": "29.543", "round_trip_ms_max": "32.553", @@ -75,7 +80,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "0", "ttl": "59", - "time_ms": "25.078" + "time_ms": "25.078", + "duplicate": false }, { "type": "reply", @@ -83,7 +89,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "1", "ttl": "59", - "time_ms": "30.999" + "time_ms": "30.999", + "duplicate": false }, { "type": "reply", @@ -91,7 +98,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "2", "ttl": "59", - "time_ms": "32.553" + "time_ms": "32.553", + "duplicate": false } ] } diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 6ad8e206..882da1f3 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -21,6 +21,7 @@ Examples: "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, + "duplicates": 0, "round_trip_ms_min": 28.015, "round_trip_ms_avg": 32.848, "round_trip_ms_max": 39.376, @@ -32,7 +33,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 0, "ttl": 59, - "time_ms": 28.015 + "time_ms": 28.015, + "duplicate": false }, { "type": "reply", @@ -40,7 +42,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 1, "ttl": 59, - "time_ms": 39.376 + "time_ms": 39.376, + "duplicate": false }, { "type": "reply", @@ -48,7 +51,8 @@ Examples: "response_ip": "151.101.1.67", "icmp_seq": 2, "ttl": 59, - "time_ms": 31.153 + "time_ms": 31.153, + "duplicate": false } ] } @@ -63,6 +67,7 @@ Examples: "packets_transmitted": "3", "packets_received": "3", "packet_loss_percent": "0.0", + "duplicates": "0", "round_trip_ms_min": "25.078", "round_trip_ms_avg": "29.543", "round_trip_ms_max": "32.553", @@ -74,7 +79,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "0", "ttl": "59", - "time_ms": "25.078" + "time_ms": "25.078", + "duplicate": false }, { "type": "reply", @@ -82,7 +88,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "1", "ttl": "59", - "time_ms": "30.999" + "time_ms": "30.999", + "duplicate": false }, { "type": "reply", @@ -90,7 +97,8 @@ Examples: "response_ip": "151.101.129.67", "icmp_seq": "2", "ttl": "59", - "time_ms": "32.553" + "time_ms": "32.553", + "duplicate": false } ] } From 2b0e0d8f5c1a6a5450e362971f9ad5892093b2ce Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 21 Jul 2020 17:34:30 -0700 Subject: [PATCH 27/80] add ipv6 dup test --- tests/fixtures/centos-7.7/ping6-ip-dup.json | 1 + tests/fixtures/centos-7.7/ping6-ip-dup.out | 14 ++++++++++++++ tests/test_ping.py | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/fixtures/centos-7.7/ping6-ip-dup.json create mode 100644 tests/fixtures/centos-7.7/ping6-ip-dup.out diff --git a/tests/fixtures/centos-7.7/ping6-ip-dup.json b/tests/fixtures/centos-7.7/ping6-ip-dup.json new file mode 100644 index 00000000..598c4d46 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-dup.json @@ -0,0 +1 @@ +{"destination_ip": "ff02::1%ens33", "data_bytes": 56, "pattern": null, "destination": "ff02::1%ens33", "packets_transmitted": 5, "packets_received": 5, "packet_loss_percent": 0.0, "duplicates": 4, "time_ms": 4017.0, "round_trip_ms_min": 0.245, "round_trip_ms_avg": 4.726, "round_trip_ms_max": 12.568, "round_trip_ms_stddev": 5.395, "responses": [{"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::c48:5896:526d:81ba%ens33", "icmp_seq": 1, "ttl": 64, "time_ms": 0.245, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::feae:34ff:fea1:3a80%ens33", "icmp_seq": 1, "ttl": 64, "time_ms": 3.65, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::c48:5896:526d:81ba%ens33", "icmp_seq": 2, "ttl": 64, "time_ms": 0.329, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::feae:34ff:fea1:3a80%ens33", "icmp_seq": 2, "ttl": 64, "time_ms": 11.7, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::c48:5896:526d:81ba%ens33", "icmp_seq": 3, "ttl": 64, "time_ms": 0.592, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::feae:34ff:fea1:3a80%ens33", "icmp_seq": 3, "ttl": 64, "time_ms": 12.3, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::c48:5896:526d:81ba%ens33", "icmp_seq": 4, "ttl": 64, "time_ms": 0.51, "duplicate": false}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::feae:34ff:fea1:3a80%ens33", "icmp_seq": 4, "ttl": 64, "time_ms": 12.5, "duplicate": true}, {"type": "reply", "timestamp": null, "bytes": 64, "response_ip": "fe80::c48:5896:526d:81ba%ens33", "icmp_seq": 5, "ttl": 64, "time_ms": 0.538, "duplicate": false}]} diff --git a/tests/fixtures/centos-7.7/ping6-ip-dup.out b/tests/fixtures/centos-7.7/ping6-ip-dup.out new file mode 100644 index 00000000..932e0104 --- /dev/null +++ b/tests/fixtures/centos-7.7/ping6-ip-dup.out @@ -0,0 +1,14 @@ +PING ff02::1%ens33(ff02::1%ens33) 56 data bytes +64 bytes from fe80::c48:5896:526d:81ba%ens33: icmp_seq=1 ttl=64 time=0.245 ms +64 bytes from fe80::feae:34ff:fea1:3a80%ens33: icmp_seq=1 ttl=64 time=3.65 ms (DUP!) +64 bytes from fe80::c48:5896:526d:81ba%ens33: icmp_seq=2 ttl=64 time=0.329 ms +64 bytes from fe80::feae:34ff:fea1:3a80%ens33: icmp_seq=2 ttl=64 time=11.7 ms (DUP!) +64 bytes from fe80::c48:5896:526d:81ba%ens33: icmp_seq=3 ttl=64 time=0.592 ms +64 bytes from fe80::feae:34ff:fea1:3a80%ens33: icmp_seq=3 ttl=64 time=12.3 ms (DUP!) +64 bytes from fe80::c48:5896:526d:81ba%ens33: icmp_seq=4 ttl=64 time=0.510 ms +64 bytes from fe80::feae:34ff:fea1:3a80%ens33: icmp_seq=4 ttl=64 time=12.5 ms (DUP!) +64 bytes from fe80::c48:5896:526d:81ba%ens33: icmp_seq=5 ttl=64 time=0.538 ms + +--- ff02::1%ens33 ping statistics --- +5 packets transmitted, 5 received, +4 duplicates, 0% packet loss, time 4017ms +rtt min/avg/max/mdev = 0.245/4.726/12.568/5.395 ms diff --git a/tests/test_ping.py b/tests/test_ping.py index 19932a7f..43e77951 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -42,6 +42,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-dup.out'), 'r', encoding='utf-8') as f: self.centos_7_7_ping_ip_dup = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-dup.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_dup = f.read() + # ubuntu with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.out'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_ping_ip_O = f.read() @@ -208,6 +211,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping-ip-dup.json'), 'r', encoding='utf-8') as f: self.centos_7_7_ping_ip_dup_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ping6-ip-dup.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_ping6_ip_dup_json = json.loads(f.read()) + # ubunutu with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ping-ip-O.json'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_ping_ip_O_json = json.loads(f.read()) @@ -407,6 +413,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping_ip_dup, quiet=True), self.centos_7_7_ping_ip_dup_json) + def test_ping6_ip_dup_centos_7_7(self): + """ + Test 'ping6 ' to broadcast IP to get duplicate replies on Centos 7.7 + """ + self.assertEqual(jc.parsers.ping.parse(self.centos_7_7_ping6_ip_dup, quiet=True), self.centos_7_7_ping6_ip_dup_json) + def test_ping_ip_O_ubuntu_18_4(self): """ Test 'ping -O' on Ubuntu 18.4 From 69c95adc8d59927c1c00b7e766ca5003b7b6454c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 22 Jul 2020 09:06:11 -0700 Subject: [PATCH 28/80] add osx ipv6 ping dup test --- tests/fixtures/osx-10.14.6/ping6-ip-dup.json | 1 + tests/fixtures/osx-10.14.6/ping6-ip-dup.out | 68 ++++++++++++++++++++ tests/test_ping.py | 12 ++++ 3 files changed, 81 insertions(+) create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-dup.json create mode 100644 tests/fixtures/osx-10.14.6/ping6-ip-dup.out diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-dup.json b/tests/fixtures/osx-10.14.6/ping6-ip-dup.json new file mode 100644 index 00000000..4ec30cd9 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-dup.json @@ -0,0 +1 @@ +{"source_ip": "fe80::c48:5896:526d:81ba%en0", "destination_ip": "ff02::1%en0", "data_bytes": 56, "pattern": null, "destination": "ff02::1%en0", "packets_transmitted": 5, "packets_received": 5, "packet_loss_percent": 0.0, "duplicates": 58, "round_trip_ms_min": 0.302, "round_trip_ms_avg": 180.26, "round_trip_ms_max": 749.182, "round_trip_ms_stddev": 250.393, "responses": [{"type": "reply", "bytes": 16, "response_ip": "fe80::c48:5896:526d:81ba%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 0.302, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c1cb:715d:bc3e:b8a0%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 0.56, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:adf7%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 2.677, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ab:6f0f:bdb6:9dd3%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 2.765, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a80%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 2.976, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a82%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 3.045, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:ddb3%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 6.182, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::10ff:f3b1:fe91:e200%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 10.536, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::da30:62ff:fe2e:86cf%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 102.839, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::18a5:fc21:6794:b605%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 104.367, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::ced:c70f:bb6d:804a%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 195.421, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::9eb6:54ff:fe5a:5a7c%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 244.586, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ad7:5ff:fef1:86e8%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 699.725, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::bd:798d:17ea:17a5%en0", "icmp_seq": 0, "ttl": 64, "time_ms": 704.087, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "2600:1700:bab0:d40:5214:79ff:fe12:423e", "icmp_seq": 0, "ttl": 64, "time_ms": 704.996, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c48:5896:526d:81ba%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 0.458, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c1cb:715d:bc3e:b8a0%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 0.776, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:adf7%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 4.926, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ab:6f0f:bdb6:9dd3%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 5.134, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a80%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 5.242, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a82%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 5.444, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:ddb3%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 5.657, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::10ff:f3b1:fe91:e200%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 21.339, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::9eb6:54ff:fe5a:5a7c%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 53.804, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::da30:62ff:fe2e:86cf%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 748.798, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::18a5:fc21:6794:b605%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 749.069, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::1012:688e:7e41:6338%en0", "icmp_seq": 1, "ttl": 64, "time_ms": 749.182, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c48:5896:526d:81ba%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 0.385, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c1cb:715d:bc3e:b8a0%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 0.713, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:adf7%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 6.868, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ab:6f0f:bdb6:9dd3%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 6.991, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a80%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 7.06, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a82%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 7.174, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:ddb3%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 9.045, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::10ff:f3b1:fe91:e200%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 11.193, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ad7:5ff:fef1:86e8%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 141.374, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "2600:1700:bab0:d40:5214:79ff:fe12:423e", "icmp_seq": 2, "ttl": 64, "time_ms": 141.53, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::bd:798d:17ea:17a5%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 141.565, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c5d:5f82:6ce5:b9b9%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 142.862, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::8d:8cfc:35ac:578f%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 145.985, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::da30:62ff:fe2e:86cf%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 566.996, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::18a5:fc21:6794:b605%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 567.127, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::1012:688e:7e41:6338%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 567.184, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::9eb6:54ff:fe5a:5a7c%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 657.246, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::ced:c70f:bb6d:804a%en0", "icmp_seq": 2, "ttl": 64, "time_ms": 657.567, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c48:5896:526d:81ba%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 0.485, "duplicate": false}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c1cb:715d:bc3e:b8a0%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 0.948, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:adf7%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 6.796, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ab:6f0f:bdb6:9dd3%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 6.918, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a80%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 6.994, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::feae:34ff:fea1:3a82%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 7.059, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::3e37:86ff:fe15:ddb3%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 7.122, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::10ff:f3b1:fe91:e200%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 9.741, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::8d:8cfc:35ac:578f%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 152.829, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "2600:1700:bab0:d40:5214:79ff:fe12:423e", "icmp_seq": 3, "ttl": 64, "time_ms": 158.816, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::bd:798d:17ea:17a5%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 158.879, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c5d:5f82:6ce5:b9b9%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 158.956, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::4ad7:5ff:fef1:86e8%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 159.015, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::18a5:fc21:6794:b605%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 377.87, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::1012:688e:7e41:6338%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 377.963, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::da30:62ff:fe2e:86cf%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 381.785, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::9eb6:54ff:fe5a:5a7c%en0", "icmp_seq": 3, "ttl": 64, "time_ms": 470.009, "duplicate": true}, {"type": "reply", "bytes": 16, "response_ip": "fe80::c48:5896:526d:81ba%en0", "icmp_seq": 4, "ttl": 64, "time_ms": 0.425, "duplicate": false}]} diff --git a/tests/fixtures/osx-10.14.6/ping6-ip-dup.out b/tests/fixtures/osx-10.14.6/ping6-ip-dup.out new file mode 100644 index 00000000..614417c0 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/ping6-ip-dup.out @@ -0,0 +1,68 @@ +PING6(56=40+8+8 bytes) fe80::c48:5896:526d:81ba%en0 --> ff02::1%en0 +16 bytes from fe80::c48:5896:526d:81ba%en0, icmp_seq=0 hlim=64 time=0.302 ms +16 bytes from fe80::c1cb:715d:bc3e:b8a0%en0, icmp_seq=0 hlim=64 time=0.560 ms +16 bytes from fe80::3e37:86ff:fe15:adf7%en0, icmp_seq=0 hlim=64 time=2.677 ms +16 bytes from fe80::4ab:6f0f:bdb6:9dd3%en0, icmp_seq=0 hlim=64 time=2.765 ms +16 bytes from fe80::feae:34ff:fea1:3a80%en0, icmp_seq=0 hlim=64 time=2.976 ms +16 bytes from fe80::feae:34ff:fea1:3a82%en0, icmp_seq=0 hlim=64 time=3.045 ms +16 bytes from fe80::3e37:86ff:fe15:ddb3%en0, icmp_seq=0 hlim=64 time=6.182 ms +16 bytes from fe80::10ff:f3b1:fe91:e200%en0, icmp_seq=0 hlim=64 time=10.536 ms +16 bytes from fe80::da30:62ff:fe2e:86cf%en0, icmp_seq=0 hlim=64 time=102.839 ms +16 bytes from fe80::18a5:fc21:6794:b605%en0, icmp_seq=0 hlim=64 time=104.367 ms +16 bytes from fe80::ced:c70f:bb6d:804a%en0, icmp_seq=0 hlim=64 time=195.421 ms +16 bytes from fe80::9eb6:54ff:fe5a:5a7c%en0, icmp_seq=0 hlim=64 time=244.586 ms +16 bytes from fe80::4ad7:5ff:fef1:86e8%en0, icmp_seq=0 hlim=64 time=699.725 ms +16 bytes from fe80::bd:798d:17ea:17a5%en0, icmp_seq=0 hlim=64 time=704.087 ms +16 bytes from 2600:1700:bab0:d40:5214:79ff:fe12:423e, icmp_seq=0 hlim=64 time=704.996 ms +16 bytes from fe80::c48:5896:526d:81ba%en0, icmp_seq=1 hlim=64 time=0.458 ms +16 bytes from fe80::c1cb:715d:bc3e:b8a0%en0, icmp_seq=1 hlim=64 time=0.776 ms +16 bytes from fe80::3e37:86ff:fe15:adf7%en0, icmp_seq=1 hlim=64 time=4.926 ms +16 bytes from fe80::4ab:6f0f:bdb6:9dd3%en0, icmp_seq=1 hlim=64 time=5.134 ms +16 bytes from fe80::feae:34ff:fea1:3a80%en0, icmp_seq=1 hlim=64 time=5.242 ms +16 bytes from fe80::feae:34ff:fea1:3a82%en0, icmp_seq=1 hlim=64 time=5.444 ms +16 bytes from fe80::3e37:86ff:fe15:ddb3%en0, icmp_seq=1 hlim=64 time=5.657 ms +16 bytes from fe80::10ff:f3b1:fe91:e200%en0, icmp_seq=1 hlim=64 time=21.339 ms +16 bytes from fe80::9eb6:54ff:fe5a:5a7c%en0, icmp_seq=1 hlim=64 time=53.804 ms +16 bytes from fe80::da30:62ff:fe2e:86cf%en0, icmp_seq=1 hlim=64 time=748.798 ms +16 bytes from fe80::18a5:fc21:6794:b605%en0, icmp_seq=1 hlim=64 time=749.069 ms +16 bytes from fe80::1012:688e:7e41:6338%en0, icmp_seq=1 hlim=64 time=749.182 ms +16 bytes from fe80::c48:5896:526d:81ba%en0, icmp_seq=2 hlim=64 time=0.385 ms +16 bytes from fe80::c1cb:715d:bc3e:b8a0%en0, icmp_seq=2 hlim=64 time=0.713 ms +16 bytes from fe80::3e37:86ff:fe15:adf7%en0, icmp_seq=2 hlim=64 time=6.868 ms +16 bytes from fe80::4ab:6f0f:bdb6:9dd3%en0, icmp_seq=2 hlim=64 time=6.991 ms +16 bytes from fe80::feae:34ff:fea1:3a80%en0, icmp_seq=2 hlim=64 time=7.060 ms +16 bytes from fe80::feae:34ff:fea1:3a82%en0, icmp_seq=2 hlim=64 time=7.174 ms +16 bytes from fe80::3e37:86ff:fe15:ddb3%en0, icmp_seq=2 hlim=64 time=9.045 ms +16 bytes from fe80::10ff:f3b1:fe91:e200%en0, icmp_seq=2 hlim=64 time=11.193 ms +16 bytes from fe80::4ad7:5ff:fef1:86e8%en0, icmp_seq=2 hlim=64 time=141.374 ms +16 bytes from 2600:1700:bab0:d40:5214:79ff:fe12:423e, icmp_seq=2 hlim=64 time=141.530 ms +16 bytes from fe80::bd:798d:17ea:17a5%en0, icmp_seq=2 hlim=64 time=141.565 ms +16 bytes from fe80::c5d:5f82:6ce5:b9b9%en0, icmp_seq=2 hlim=64 time=142.862 ms +16 bytes from fe80::8d:8cfc:35ac:578f%en0, icmp_seq=2 hlim=64 time=145.985 ms +16 bytes from fe80::da30:62ff:fe2e:86cf%en0, icmp_seq=2 hlim=64 time=566.996 ms +16 bytes from fe80::18a5:fc21:6794:b605%en0, icmp_seq=2 hlim=64 time=567.127 ms +16 bytes from fe80::1012:688e:7e41:6338%en0, icmp_seq=2 hlim=64 time=567.184 ms +16 bytes from fe80::9eb6:54ff:fe5a:5a7c%en0, icmp_seq=2 hlim=64 time=657.246 ms +16 bytes from fe80::ced:c70f:bb6d:804a%en0, icmp_seq=2 hlim=64 time=657.567 ms +16 bytes from fe80::c48:5896:526d:81ba%en0, icmp_seq=3 hlim=64 time=0.485 ms +16 bytes from fe80::c1cb:715d:bc3e:b8a0%en0, icmp_seq=3 hlim=64 time=0.948 ms +16 bytes from fe80::3e37:86ff:fe15:adf7%en0, icmp_seq=3 hlim=64 time=6.796 ms +16 bytes from fe80::4ab:6f0f:bdb6:9dd3%en0, icmp_seq=3 hlim=64 time=6.918 ms +16 bytes from fe80::feae:34ff:fea1:3a80%en0, icmp_seq=3 hlim=64 time=6.994 ms +16 bytes from fe80::feae:34ff:fea1:3a82%en0, icmp_seq=3 hlim=64 time=7.059 ms +16 bytes from fe80::3e37:86ff:fe15:ddb3%en0, icmp_seq=3 hlim=64 time=7.122 ms +16 bytes from fe80::10ff:f3b1:fe91:e200%en0, icmp_seq=3 hlim=64 time=9.741 ms +16 bytes from fe80::8d:8cfc:35ac:578f%en0, icmp_seq=3 hlim=64 time=152.829 ms +16 bytes from 2600:1700:bab0:d40:5214:79ff:fe12:423e, icmp_seq=3 hlim=64 time=158.816 ms +16 bytes from fe80::bd:798d:17ea:17a5%en0, icmp_seq=3 hlim=64 time=158.879 ms +16 bytes from fe80::c5d:5f82:6ce5:b9b9%en0, icmp_seq=3 hlim=64 time=158.956 ms +16 bytes from fe80::4ad7:5ff:fef1:86e8%en0, icmp_seq=3 hlim=64 time=159.015 ms +16 bytes from fe80::18a5:fc21:6794:b605%en0, icmp_seq=3 hlim=64 time=377.870 ms +16 bytes from fe80::1012:688e:7e41:6338%en0, icmp_seq=3 hlim=64 time=377.963 ms +16 bytes from fe80::da30:62ff:fe2e:86cf%en0, icmp_seq=3 hlim=64 time=381.785 ms +16 bytes from fe80::9eb6:54ff:fe5a:5a7c%en0, icmp_seq=3 hlim=64 time=470.009 ms +16 bytes from fe80::c48:5896:526d:81ba%en0, icmp_seq=4 hlim=64 time=0.425 ms + +--- ff02::1%en0 ping6 statistics --- +5 packets transmitted, 5 packets received, +58 duplicates, 0.0% packet loss +round-trip min/avg/max/std-dev = 0.302/180.260/749.182/250.393 ms diff --git a/tests/test_ping.py b/tests/test_ping.py index 43e77951..282dbdad 100644 --- a/tests/test_ping.py +++ b/tests/test_ping.py @@ -178,6 +178,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-dup.out'), 'r', encoding='utf-8') as f: self.osx_10_14_6_ping_ip_dup = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-dup.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_dup = f.read() + # output # centos @@ -347,6 +350,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-dup.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_ping_ip_dup_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-dup.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_ping6_ip_dup_json = json.loads(f.read()) + def test_ping_nodata(self): """ Test 'ping' with no data @@ -677,6 +683,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_dup, quiet=True), self.osx_10_14_6_ping_ip_dup_json) + def test_ping6_ip_dup_osx_10_14_6(self): + """ + Test 'ping6 ' to broadcast IP to get duplicate replies on osx 10.14.6 + """ + self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip_dup, quiet=True), self.osx_10_14_6_ping6_ip_dup_json) + if __name__ == '__main__': unittest.main() From 5b444d4717b0b8528647e17e71d699907def3e18 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 22 Jul 2020 12:19:27 -0700 Subject: [PATCH 29/80] add traceroute parser --- jc/cli.py | 1 + jc/parsers/traceroute.py | 295 ++++++++++++++++++++++ tests/fixtures/osx-10.14.6/traceroute.out | 11 + 3 files changed, 307 insertions(+) create mode 100644 jc/parsers/traceroute.py create mode 100644 tests/fixtures/osx-10.14.6/traceroute.out diff --git a/jc/cli.py b/jc/cli.py index 34701399..bc0af389 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -77,6 +77,7 @@ parsers = [ 'systemctl-ls', 'systemctl-luf', 'timedatectl', + 'traceroute', 'uname', 'uptime', 'w', diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py new file mode 100644 index 00000000..e55e924c --- /dev/null +++ b/jc/parsers/traceroute.py @@ -0,0 +1,295 @@ +"""jc - JSON CLI output utility traceroute Parser + +Usage: + + specify --traceroute as the first argument if the piped input is coming from traceroute + +Compatibility: + + 'linux', 'darwin', 'freebsd' + +Examples: + + $ traceroute | jc --traceroute -p + [] + + $ traceroute | jc --traceroute -p -r + [] +""" +import re +from decimal import Decimal +import jc.utils + + +class info(): + version = '1.0' + description = 'traceroute command parser' + author = 'Kelly Brazil' + author_email = 'kellyjonbrazil@gmail.com' + details = 'Using the tr library by Luis Benitez at https://github.com/lbenitez000/trparse' + + # compatible options: linux, darwin, cygwin, win32, aix, freebsd + compatible = ['linux', 'darwin', 'freebsd'] + magic_commands = ['traceroute', 'traceroute6'] + + +__version__ = info.version + + +""" +Copyright (C) 2015 Luis Benitez + +Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). +""" + +RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+)|([0-9a-fA-F:]+))\)') + +RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|([0-9a-fA-F:]+))\)+') +RE_PROBE_ANNOTATION = re.compile(r'^(!\w*)$') +RE_PROBE_TIMEOUT = re.compile(r'^(\*)$') + +RE_HOP_INDEX = re.compile(r'^\s*(\d+)\s+') +RE_FIRST_HOP = re.compile(r'^\s*(\d+)\s+(.+)') +RE_HOP = re.compile(r'^\s*(\d+)?\s+(.+)$') +RE_PROBE_ASN = re.compile(r'\[AS(\d+)\]') +RE_PROBE_RTT_ANNOTATION = re.compile(r'(?:(\d+(?:\.?\d+)?)\s+ms|(\s+\*\s+))\s*(!\S*)?') + + +class Traceroute(object): + """ + Abstraction of a traceroute result. + """ + + def __init__(self, dest_name, dest_ip): + self.dest_name = dest_name + self.dest_ip = dest_ip + self.hops = [] + + def add_hop(self, hop): + self.hops.append(hop) + + def __str__(self): + text = "Traceroute for %s (%s)\n\n" % (self.dest_name, self.dest_ip) + for hop in self.hops: + text += str(hop) + return text + + +class Hop(object): + """ + Abstraction of a hop in a traceroute. + """ + + def __init__(self, idx): + self.idx = idx # Hop count, starting at 1 + self.probes = [] # Series of Probe instances + + def add_probe(self, probe): + """Adds a Probe instance to this hop's results.""" + if self.probes: + probe_last = self.probes[-1] + if not probe.ip: + probe.ip = probe_last.ip + probe.name = probe_last.name + self.probes.append(probe) + + def __str__(self): + text = "{:>3d} ".format(self.idx) + text_len = len(text) + for n, probe in enumerate(self.probes): + text_probe = str(probe) + if n: + text += (text_len * " ") + text_probe + else: + text += text_probe + text += "\n" + return text + + +class Probe(object): + """ + Abstraction of a probe in a traceroute. + """ + + def __init__(self, name=None, ip=None, asn=None, rtt=None, annotation=None): + self.name = name + self.ip = ip + self.asn = asn # Autonomous System number + self.rtt = rtt # RTT in ms + self.annotation = annotation # Annotation, such as !H, !N, !X, etc + + def __str__(self): + text = "" + if self.asn is not None: + text += "[AS{:d}] ".format(self.asn) + if self.rtt: + text += "{:s} ({:s}) {:1.3f} ms".format(self.name, self.ip, self.rtt) + else: + text = "*" + if self.annotation: + text += " {:s}".format(self.annotation) + text += "\n" + return text + + +def loads(data): + """Parser entry point. Parses the output of a traceroute execution""" + + lines = data.splitlines() + + # Get headers + match_dest = RE_HEADER.search(lines[0]) + dest_name = match_dest.group(1) + dest_ip = match_dest.group(2) + + # The Traceroute node is the root of the tree + traceroute = Traceroute(dest_name, dest_ip) + + # Parse the remaining lines, they should be only hops/probes + for line in lines[1:]: + # Skip empty lines + if not line: + continue + + hop_match = RE_HOP.match(line) + + if hop_match.group(1): + hop_index = int(hop_match.group(1)) + else: + hop_index = None + + if hop_index is not None: + hop = Hop(hop_index) + traceroute.add_hop(hop) + + hop_string = hop_match.group(2) + + probe_asn_match = RE_PROBE_ASN.search(hop_string) + if probe_asn_match: + probe_asn = int(probe_asn_match.group(1)) + else: + probe_asn = None + + probe_name_ip_match = RE_PROBE_NAME_IP.search(hop_string) + if probe_name_ip_match: + probe_name = probe_name_ip_match.group(1) + probe_ip = probe_name_ip_match.group(2) or probe_name_ip_match.group(3) + else: + probe_name = None + probe_ip = None + + probe_rtt_annotations = RE_PROBE_RTT_ANNOTATION.findall(hop_string) + + for probe_rtt_annotation in probe_rtt_annotations: + if probe_rtt_annotation[0]: + probe_rtt = Decimal(probe_rtt_annotation[0]) + elif probe_rtt_annotation[1]: + probe_rtt = None + else: + message = "Expected probe RTT or *. Got: '{}'".format(probe_rtt_annotation[0]) + raise Exception(message) + + probe_annotation = probe_rtt_annotation[2] or None + + probe = Probe( + name=probe_name, + ip=probe_ip, + asn=probe_asn, + rtt=probe_rtt, + annotation=probe_annotation + ) + hop.add_probe(probe) + + return traceroute + + +def load(data): + return loads(data.read()) + + +class ParseError(Exception): + pass + + + + + + +def process(proc_data): + """ + Final processing to conform to the schema. + + Parameters: + + proc_data: (dictionary) raw structured data to process + + Returns: + + List of dictionaries. Structured data with the following schema: + + [ + { + "foo": string, + "bar": boolean, + "baz": integer + } + ] + """ + + # rebuild output for added semantic information + return proc_data + + +def parse(data, raw=False, quiet=False): + """ + Main text parsing function + + Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + + Returns: + + List of dictionaries. Raw or processed structured data. + """ + if not quiet: + jc.utils.compatibility(__name__, info.compatible) + + raw_output = {} + + if jc.utils.has_data(data): + + tr = loads(data) + hops = tr.hops + hops_list = [] + + if hops: + for hop in hops: + hop_obj = {} + hop_obj['id'] = hop.idx + probe_list = [] + if hop.probes: + for probe in hop.probes: + probe_obj = { + 'annotation': probe.annotation, + 'asn': probe.asn, + 'ip': probe.ip, + 'name': probe.name, + 'rtt': None if probe.rtt is None else float(probe.rtt) + } + probe_list.append(probe_obj) + hop_obj['probes'] = probe_list + hops_list.append(hop_obj) + + raw_output = { + 'destination_ip': tr.dest_ip, + 'destination_name': tr.dest_name, + 'hops': hops_list + } + + if raw: + return raw_output + else: + return process(raw_output) diff --git a/tests/fixtures/osx-10.14.6/traceroute.out b/tests/fixtures/osx-10.14.6/traceroute.out new file mode 100644 index 00000000..372c309a --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute.out @@ -0,0 +1,11 @@ +traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 52 byte packets + 1 dsldevice (192.168.1.254) 12.070 ms 4.328 ms 4.167 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 20.595 ms 26.130 ms 28.555 ms + 3 * * * + 4 12.122.149.186 (12.122.149.186) 149.663 ms 27.761 ms 160.709 ms + 5 sffca22crs.ip.att.net (12.122.3.70) 27.131 ms 160.459 ms 32.274 ms + 6 12.122.163.61 (12.122.163.61) 143.143 ms 27.034 ms 152.676 ms + 7 12.255.10.234 (12.255.10.234) 24.912 ms 23.802 ms 157.338 ms + 8 * * * + 9 dns.google (8.8.8.8) 30.840 ms 22.503 ms 23.538 ms + From 066adfb76479df7042bfb12bbb83b5dbd8a6d54c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 22 Jul 2020 15:02:02 -0700 Subject: [PATCH 30/80] handle warning lines in the traceroute output --- jc/parsers/traceroute.py | 30 +++++++++++++---- tests/fixtures/centos-7.7/traceroute.out | 32 +++++++++++++++++++ tests/fixtures/osx-10.14.6/traceroute-asn.out | 5 +++ .../osx-10.14.6/traceroute-mult-addresses.out | 5 +++ .../osx-10.14.6/traceroute-no-header.out | 3 ++ .../osx-10.14.6/traceroute6-multi-address.out | 8 +++++ tests/fixtures/osx-10.14.6/traceroute6.out | 7 ++++ 7 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 tests/fixtures/centos-7.7/traceroute.out create mode 100644 tests/fixtures/osx-10.14.6/traceroute-asn.out create mode 100644 tests/fixtures/osx-10.14.6/traceroute-mult-addresses.out create mode 100644 tests/fixtures/osx-10.14.6/traceroute-no-header.out create mode 100644 tests/fixtures/osx-10.14.6/traceroute6-multi-address.out create mode 100644 tests/fixtures/osx-10.14.6/traceroute6.out diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index e55e924c..39db0b22 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -4,13 +4,16 @@ Usage: specify --traceroute as the first argument if the piped input is coming from traceroute + Note: on OSX and FreeBSD be sure to redirect STDERR to STDOUT since the header line is sent to STDERR + e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute + Compatibility: 'linux', 'darwin', 'freebsd' Examples: - $ traceroute | jc --traceroute -p + $ traceroute www.cnn.com 2>&1 | jc --traceroute -p [] $ traceroute | jc --traceroute -p -r @@ -211,9 +214,7 @@ class ParseError(Exception): pass - - - +######################################################################################## def process(proc_data): """ @@ -261,6 +262,19 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): + # remove any warning lines + new_data = [] + for data_line in data.splitlines(): + if 'traceroute: Warning: ' not in data_line and 'traceroute6: Warning: ' not in data_line: + new_data.append(data_line) + else: + continue + data = '\n'.join(new_data) + + # check if header row exists, otherwise raise exception + if not data.splitlines()[0].startswith('traceroute to ') and not data.splitlines()[0].startswith('traceroute6 to '): + raise ParseError('Traceroute header line not found. Be sure to redirect STDERR to STDOUT on OSX/FreeBSD.') + tr = loads(data) hops = tr.hops hops_list = [] @@ -268,18 +282,20 @@ def parse(data, raw=False, quiet=False): if hops: for hop in hops: hop_obj = {} - hop_obj['id'] = hop.idx + hop_obj['hop'] = str(hop.idx) probe_list = [] + if hop.probes: for probe in hop.probes: probe_obj = { 'annotation': probe.annotation, - 'asn': probe.asn, + 'asn': None if probe.asn is None else str(probe.asn), 'ip': probe.ip, 'name': probe.name, - 'rtt': None if probe.rtt is None else float(probe.rtt) + 'rtt': None if probe.rtt is None else str(probe.rtt) } probe_list.append(probe_obj) + hop_obj['probes'] = probe_list hops_list.append(hop_obj) diff --git a/tests/fixtures/centos-7.7/traceroute.out b/tests/fixtures/centos-7.7/traceroute.out new file mode 100644 index 00000000..87a379b9 --- /dev/null +++ b/tests/fixtures/centos-7.7/traceroute.out @@ -0,0 +1,32 @@ +traceroute to www.cnn.com (151.101.197.67), 30 hops max, 60 byte packets + 1 dsldevice.attlocal.net (192.168.1.254) 4.024 ms 3.683 ms 3.706 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 24.038 ms 23.911 ms 23.724 ms + 3 * * * + 4 12.122.149.186 (12.122.149.186) 42.273 ms 42.213 ms 42.083 ms + 5 12.122.2.77 (12.122.2.77) 36.789 ms 43.691 ms 36.597 ms + 6 sd2ca21crs.ip.att.net (12.122.2.94) 41.587 ms 40.240 ms 44.659 ms + 7 12.123.215.161 (12.123.215.161) 37.858 ms 37.321 ms 37.092 ms + 8 * * * + 9 * * * +10 * * * +11 * * * +12 * * * +13 * * * +14 * * * +15 * * * +16 * * * +17 * * * +18 * * * +19 * * * +20 * * * +21 * * * +22 * * * +23 * * * +24 * * * +25 * * * +26 * * * +27 * * * +28 * * * +29 * * * +30 * * * + diff --git a/tests/fixtures/osx-10.14.6/traceroute-asn.out b/tests/fixtures/osx-10.14.6/traceroute-asn.out new file mode 100644 index 00000000..f7999273 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-asn.out @@ -0,0 +1,5 @@ +traceroute to 8.8.8.8 (8.8.8.8), 4 hops max, 52 byte packets + 1 [AS198949] dsldevice (192.168.1.254) 6.070 ms 5.721 ms 5.269 ms + 2 [AS0] 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 160.025 ms 178.690 ms 33.759 ms + 3 * * * + 4 [AS7018] 12.122.149.186 (12.122.149.186) 37.783 ms 23.782 ms 24.958 ms diff --git a/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.out b/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.out new file mode 100644 index 00000000..d8bf4220 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.out @@ -0,0 +1,5 @@ +traceroute: Warning: cnn.com has multiple addresses; using 151.101.129.67 +traceroute to cnn.com (151.101.129.67), 64 hops max, 52 byte packets + 1 dsldevice (192.168.1.254) 4.478 ms 3.907 ms 4.849 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 23.530 ms 26.518 ms 23.480 ms + 3 * * \ No newline at end of file diff --git a/tests/fixtures/osx-10.14.6/traceroute-no-header.out b/tests/fixtures/osx-10.14.6/traceroute-no-header.out new file mode 100644 index 00000000..0c1932c3 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-no-header.out @@ -0,0 +1,3 @@ + 1 dsldevice (192.168.1.254) 11.415 ms 3.934 ms 3.286 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 24.174 ms 20.817 ms 27.771 ms + 3 * * * diff --git a/tests/fixtures/osx-10.14.6/traceroute6-multi-address.out b/tests/fixtures/osx-10.14.6/traceroute6-multi-address.out new file mode 100644 index 00000000..e056c8ce --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute6-multi-address.out @@ -0,0 +1,8 @@ +traceroute6: Warning: turner-tls.map.fastly.net has multiple addresses; using 2a04:4e42:200::323 +traceroute6 to turner-tls.map.fastly.net (2a04:4e42:200::323) from 2600:1700:bab0:d40:985:f00a:98bd:f142, 5 hops max, 12 byte packets + 1 * * * + 2 2001:506:6000:11b:71:156:212:143 27.635 ms 20.383 ms 23.438 ms + 3 * * * + 4 2001:1890:ff:ff08:12:242:117:16 20.118 ms 20.327 ms 21.213 ms + 5 * * * + diff --git a/tests/fixtures/osx-10.14.6/traceroute6.out b/tests/fixtures/osx-10.14.6/traceroute6.out new file mode 100644 index 00000000..8af70abd --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute6.out @@ -0,0 +1,7 @@ +traceroute6 to turner-tls.map.fastly.net (2a04:4e42:200::323) from 2600:1700:bab0:d40:985:f00a:98bd:f142, 5 hops max, 12 byte packets + 1 * * * + 2 2001:506:6000:11b:71:156:212:143 27.635 ms 20.383 ms 23.438 ms + 3 * * * + 4 2001:1890:ff:ff08:12:242:117:16 20.118 ms 20.327 ms 21.213 ms + 5 * * * + From c8e526ead35b868733f57b4c114062a48b78a817 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 22 Jul 2020 17:23:24 -0700 Subject: [PATCH 31/80] fixes for bsd-style ipv6 output --- jc/parsers/traceroute.py | 11 ++++++++--- tests/fixtures/osx-10.14.6/traceroute-q.out | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/osx-10.14.6/traceroute-q.out diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 39db0b22..6fe40fd4 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -45,9 +45,10 @@ Copyright (C) 2015 Luis Benitez Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). """ -RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+)|([0-9a-fA-F:]+))\)') +RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+))\)') -RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|([0-9a-fA-F:]+))\)+') +RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+))\)+') +RE_PROBE_BSD_IPV6 = re.compile(r'\b(?:[A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}\b') RE_PROBE_ANNOTATION = re.compile(r'^(!\w*)$') RE_PROBE_TIMEOUT = re.compile(r'^(\*)$') @@ -174,9 +175,13 @@ def loads(data): probe_asn = None probe_name_ip_match = RE_PROBE_NAME_IP.search(hop_string) + probe_bsd_ipv6_match = RE_PROBE_BSD_IPV6.search(hop_string) if probe_name_ip_match: probe_name = probe_name_ip_match.group(1) - probe_ip = probe_name_ip_match.group(2) or probe_name_ip_match.group(3) + probe_ip = probe_name_ip_match.group(2) + elif probe_bsd_ipv6_match: + probe_name = None + probe_ip = probe_bsd_ipv6_match.group(0) else: probe_name = None probe_ip = None diff --git a/tests/fixtures/osx-10.14.6/traceroute-q.out b/tests/fixtures/osx-10.14.6/traceroute-q.out new file mode 100644 index 00000000..6e181bc7 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-q.out @@ -0,0 +1,4 @@ +traceroute to 8.8.8.8 (8.8.8.8), 3 hops max, 52 byte packets + 1 dsldevice (192.168.1.254) 3.317 ms 6.373 ms 6.967 ms 5.299 ms 4.605 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 28.829 ms 20.073 ms 26.238 ms 22.052 ms 22.519 ms + 3 * * * * * From f5ec82440cd1c1b5ac9011d3517298d0cdcd8766 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 10:19:56 -0700 Subject: [PATCH 32/80] simplify regex patterns --- jc/parsers/traceroute.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 6fe40fd4..82d2e178 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -45,18 +45,19 @@ Copyright (C) 2015 Luis Benitez Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). """ -RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+))\)') - -RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+))\)+') +# RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+))\)') +RE_HEADER = re.compile(r'(\S+)\s+\((\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+)\)') +# RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+))\)+') +RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+)\)+') RE_PROBE_BSD_IPV6 = re.compile(r'\b(?:[A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}\b') RE_PROBE_ANNOTATION = re.compile(r'^(!\w*)$') RE_PROBE_TIMEOUT = re.compile(r'^(\*)$') - RE_HOP_INDEX = re.compile(r'^\s*(\d+)\s+') RE_FIRST_HOP = re.compile(r'^\s*(\d+)\s+(.+)') RE_HOP = re.compile(r'^\s*(\d+)?\s+(.+)$') RE_PROBE_ASN = re.compile(r'\[AS(\d+)\]') -RE_PROBE_RTT_ANNOTATION = re.compile(r'(?:(\d+(?:\.?\d+)?)\s+ms|(\s+\*\s+))\s*(!\S*)?') +# RE_PROBE_RTT_ANNOTATION = re.compile(r'(?:(\d+(?:\.?\d+)?)\s+ms|(\s+\*\s+))\s*(!\S*)?') +RE_PROBE_RTT_ANNOTATION = re.compile(r'\d+\.?\d+)?\s+ms|(\s+\*\s+)\s*(!\S*)?') class Traceroute(object): From 72d80e95bb50ae2a7432082e65aba15235ba0955 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 10:52:40 -0700 Subject: [PATCH 33/80] remove unused regex patterns --- jc/parsers/traceroute.py | 9 +------- tests/fixtures/generic/traceroute1.out | 16 +++++++++++++ tests/fixtures/generic/traceroute2.out | 13 +++++++++++ tests/fixtures/generic/traceroute3.out | 20 +++++++++++++++++ tests/fixtures/generic/traceroute4.out | 7 ++++++ tests/fixtures/generic/traceroute5.out | 10 +++++++++ tests/fixtures/generic/traceroute6.out | 31 ++++++++++++++++++++++++++ tests/fixtures/generic/traceroute7.out | 17 ++++++++++++++ 8 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 tests/fixtures/generic/traceroute1.out create mode 100644 tests/fixtures/generic/traceroute2.out create mode 100644 tests/fixtures/generic/traceroute3.out create mode 100644 tests/fixtures/generic/traceroute4.out create mode 100644 tests/fixtures/generic/traceroute5.out create mode 100644 tests/fixtures/generic/traceroute6.out create mode 100644 tests/fixtures/generic/traceroute7.out diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 82d2e178..65485204 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -45,19 +45,12 @@ Copyright (C) 2015 Luis Benitez Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). """ -# RE_HEADER = re.compile(r'(\S+)\s+\((?:(\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+))\)') RE_HEADER = re.compile(r'(\S+)\s+\((\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+)\)') -# RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((?:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+))\)+') RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+)\)+') RE_PROBE_BSD_IPV6 = re.compile(r'\b(?:[A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}\b') -RE_PROBE_ANNOTATION = re.compile(r'^(!\w*)$') -RE_PROBE_TIMEOUT = re.compile(r'^(\*)$') -RE_HOP_INDEX = re.compile(r'^\s*(\d+)\s+') -RE_FIRST_HOP = re.compile(r'^\s*(\d+)\s+(.+)') RE_HOP = re.compile(r'^\s*(\d+)?\s+(.+)$') RE_PROBE_ASN = re.compile(r'\[AS(\d+)\]') -# RE_PROBE_RTT_ANNOTATION = re.compile(r'(?:(\d+(?:\.?\d+)?)\s+ms|(\s+\*\s+))\s*(!\S*)?') -RE_PROBE_RTT_ANNOTATION = re.compile(r'\d+\.?\d+)?\s+ms|(\s+\*\s+)\s*(!\S*)?') +RE_PROBE_RTT_ANNOTATION = re.compile(r'(\d+\.?\d+)?\s+ms|(\s+\*\s+)\s*(!\S*)?') class Traceroute(object): diff --git a/tests/fixtures/generic/traceroute1.out b/tests/fixtures/generic/traceroute1.out new file mode 100644 index 00000000..c7f74803 --- /dev/null +++ b/tests/fixtures/generic/traceroute1.out @@ -0,0 +1,16 @@ +traceroute to http://google.es (173.207.22.152), 30 hops max, 60 byte packets + 1 131.240.100.12 (131.240.100.12) [AS1739] 0.676 ms !P 0.763 ms ! 0.910 ms !<500> + 2 http://tut1-fw-vlan558.av.tut.fi (131.232.1.26) [AS1739] 0.266 ms 0.404 ms 0.493 ms + 3 http://surf-gw-vlan557.av.tut.fi (131.232.1.20) [AS1739] 0.967 ms 0.961 ms 1.085 ms + 4 http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi (130.230.1.237) [AS1739] 1.096 ms 1.086 ms 1.049 ms + 5 http://hameenlinna2-et-0-0-0-1.ip.funet.fi (86.50.255.220) [AS1741] 3.810 ms 3.845 ms 3.820 ms + 6 http://hameenlinna1-et-0-0-1-1.ip.funet.fi (86.50.255.224) [AS1741] 29.055 ms 29.013 ms 28.977 ms + 7 http://espoo2-et-0-1-2-1.ip.funet.fi (86.50.255.223) [AS1741] 3.468 ms 8.007 ms 7.890 ms + 8 http://espoo1-et-0-1-7-1.ip.funet.fi (86.50.255.232) [AS1741] 13.498 ms 13.307 ms 13.399 ms + 9 http://fi-csc2.nordu.net (109.105.102.168) [AS2603] 3.250 ms 3.268 ms 3.236 ms +10 http://se-fre.nordu.net (109.105.97.93) [AS2603] 9.418 ms 9.410 ms 9.369 ms +11 http://se-kst2.nordu.net (109.105.97.27) [AS2603] 9.617 ms 9.594 ms 9.603 ms +12 http://as15169-10g-sk1.sthix.net (192.121.80.47) [*] 10.010 ms 72.14.196.42 (72.14.196.42) [AS15169] 9.182 ms 44.983 ms +13 108.170.254.49 (108.170.254.49) [AS15169] 10.852 ms 108.170.254.33 (108.170.254.33) [AS15169] 11.185 ms 108.170.254.49 (108.170.254.49) [AS15169] 10.876 ms +14 209.85.242.11 (209.85.242.11) [AS15169] 10.192 ms 10.471 ms 10.502 ms +15 http://arn11s03-in-f3.1e100.net (172.217.21.163) [AS15169] 9.652 ms 9.664 ms 9.777 ms diff --git a/tests/fixtures/generic/traceroute2.out b/tests/fixtures/generic/traceroute2.out new file mode 100644 index 00000000..e40fe804 --- /dev/null +++ b/tests/fixtures/generic/traceroute2.out @@ -0,0 +1,13 @@ +traceroute to google.com (216.58.194.46), 30 hops max, 40 byte packets + 1 216-230-231-141.static.houston.tx.oplink.net (216.230.231.141) 198.574 ms * 198.650 ms + 2 * * * + 3 * * * + 4 72.14.242.34 (72.14.242.34) 4.932 ms 4.945 ms 4.951 ms + 5 * * * + 6 108.170.230.116 (108.170.230.116) 4.687 ms 4.798 ms 4.688 ms + 7 108.170.252.130 (108.170.252.130) 4.825 ms 4.844 ms 4.797 ms + 8 108.170.233.117 (108.170.233.117) 5.386 ms 5.288 ms 5.324 ms + 9 216.239.63.250 (216.239.63.250) 5.305 ms 5.369 ms 5.406 ms +10 108.170.240.129 (108.170.240.129) 6.005 ms 5.930 ms 5.983 ms +11 209.85.242.53 (209.85.242.53) 4.973 ms 4.973 ms 4.979 ms +12 dfw25s12-in-f46.1e100.net (216.58.194.46) 4.871 ms 4.884 ms 4.863 ms diff --git a/tests/fixtures/generic/traceroute3.out b/tests/fixtures/generic/traceroute3.out new file mode 100644 index 00000000..41b61ed7 --- /dev/null +++ b/tests/fixtures/generic/traceroute3.out @@ -0,0 +1,20 @@ +traceroute to facebook.com (31.13.82.36), 30 hops max, 40 byte packets + 1 ec2-175-41-192-133.ap-northeast-1.compute.amazonaws.com (175.41.192.133) 1.002 ms * 1.006 ms + 2 * * * + 3 * * * + 4 * * * + 5 * * * + 6 * * * + 7 100.65.10.33 (100.65.10.33) 0.269 ms 0.282 ms 0.320 ms + 8 54.239.52.186 (54.239.52.186) 1.411 ms 1.431 ms 1.433 ms + 9 52.95.31.89 (52.95.31.89) 2.612 ms 2.634 ms 2.659 ms +10 52.95.31.56 (52.95.31.56) 1.017 ms 1.028 ms 1.048 ms +11 52.95.31.149 (52.95.31.149) 7.042 ms 7.057 ms 7.060 ms +12 54.239.53.66 (54.239.53.66) 7.828 ms 7.810 ms 7.997 ms +13 54.239.53.82 (54.239.53.82) 7.120 ms 7.126 ms 7.178 ms +14 63-222-51-9.static.pccwglobal.net (63.222.51.9) 7.657 ms 7.611 ms 7.669 ms +15 HundredGE0-4-0-3.br02.tok02.pccwbtn.net (63.218.250.169) 8.130 ms 8.368 ms 8.402 ms +16 63-218-251-118.static.pccwglobal.net (63.218.251.118) 30.511 ms 20.379 ms 20.352 ms +17 po104.psw04.nrt1.tfbnw.net (157.240.40.9) 8.341 ms 8.303 ms 8.312 ms +18 173.252.67.191 (173.252.67.191) 8.298 ms 8.328 ms 8.359 ms +19 edge-star-mini-shv-01-nrt1.facebook.com (31.13.82.36) 8.214 ms 8.198 ms 8.192 ms diff --git a/tests/fixtures/generic/traceroute4.out b/tests/fixtures/generic/traceroute4.out new file mode 100644 index 00000000..3d898816 --- /dev/null +++ b/tests/fixtures/generic/traceroute4.out @@ -0,0 +1,7 @@ +traceroute to example.com (64.13.192.208), 64 hops max, 40 byte packets +1 72.10.62.1 (72.10.62.1) 1.000 ms 0.739 ms 0.702 ms +2 10.101.248.1 (10.101.248.1) 0.683 ms 0.385 ms 0.315 ms +3 10.104.65.161 (10.104.65.161) 0.791 ms 0.703 ms 0.686 ms +4 10.104.0.1 (10.104.0.1) 1.430 ms 1.310 ms 1.063 ms +5 10.0.10.33 (10.0.10.33) 2.652 ms 2.260 ms 5.353 ms +6 www.example.com (64.13.192.208) 3.384 ms 8.001 ms 2.439 ms diff --git a/tests/fixtures/generic/traceroute5.out b/tests/fixtures/generic/traceroute5.out new file mode 100644 index 00000000..18993166 --- /dev/null +++ b/tests/fixtures/generic/traceroute5.out @@ -0,0 +1,10 @@ +traceroute to 10xhostings.com (104.18.42.178), 30 hops max, 40 byte packets + 1 * * * + 2 Internal (Internal) 0.894 ms 0.890 ms 0.876 ms + 3 204.141.42.25 (204.141.42.25) 2.818 ms 2.825 ms 2.825 ms + 4 204.141.42.9 (204.141.42.9) 1.014 ms 1.017 ms 1.082 ms + 5 xe-0-0-46-2.a00.sttlwa01.us.bb.gin.ntt.net (128.241.1.145) 30.105 ms 30.125 ms 30.125 ms + 6 ae-9.r04.sttlwa01.us.bb.gin.ntt.net (129.250.5.117) 32.346 ms 31.946 ms 31.960 ms + 7 ae-0.a01.sttlwa01.us.bb.gin.ntt.net (129.250.5.86) 32.836 ms 32.749 ms 32.743 ms + 8 ae-0.cloudflare.sttlwa01.us.bb.gin.ntt.net (131.103.117.86) 44.601 ms 42.886 ms 42.874 ms + 9 104.18.42.178 (104.18.42.178) 29.614 ms 29.690 ms 30.461 ms diff --git a/tests/fixtures/generic/traceroute6.out b/tests/fixtures/generic/traceroute6.out new file mode 100644 index 00000000..738e6178 --- /dev/null +++ b/tests/fixtures/generic/traceroute6.out @@ -0,0 +1,31 @@ +traceroute to alexa.com (52.22.122.82), 30 hops max, 40 byte packets + 1 130.185.80.253 (130.185.80.253) 0.374 ms * 0.474 ms + 2 94.46.128.26 (94.46.128.26) 0.440 ms 0.457 ms 0.459 ms + 3 ix-xe-1-3-0-0.tcore1.pv9-lisbon.as6453.net (80.231.158.49) 0.436 ms 0.436 ms 0.446 ms + 4 if-ae-1-3.tcore1.sv8-highbridge.as6453.net (80.231.158.30) 100.300 ms 100.346 ms 100.362 ms + 5 if-ae-2-2.tcore2.sv8-highbridge.as6453.net (80.231.139.1) 100.737 ms 100.787 ms 100.863 ms + 6 if-ae-11-2.tcore1.l78-london.as6453.net (80.231.139.42) 94.576 ms 94.647 ms 94.631 ms + 7 if-ae-66-2.tcore2.nto-new-york.as6453.net (80.231.130.106) 104.775 ms 105.059 ms 105.146 ms + 8 if-ae-12-2.tcore1.n75-new-york.as6453.net (66.110.96.5) 100.043 ms 100.096 ms 100.089 ms + 9 66.110.96.157 (66.110.96.157) 101.514 ms 101.055 ms 101.058 ms +10 52.93.31.33 (52.93.31.33) 100.489 ms 100.113 ms 100.065 ms +11 52.93.4.0 (52.93.4.0) 93.575 ms 93.473 ms 93.491 ms +12 * * * +13 54.240.229.143 (54.240.229.143) 94.307 ms 94.732 ms 94.683 ms +14 * * * +15 * * * +16 * * * +17 * * * +18 * * * +19 * * * +20 * * * +21 * * * +22 * * * +23 * * * +24 * * * +25 52.93.28.172 (52.93.28.172) 94.270 ms 94.296 ms 94.294 ms +26 * * * +27 * * * +28 * * * +29 * * * +30 * * * diff --git a/tests/fixtures/generic/traceroute7.out b/tests/fixtures/generic/traceroute7.out new file mode 100644 index 00000000..bf4bfd12 --- /dev/null +++ b/tests/fixtures/generic/traceroute7.out @@ -0,0 +1,17 @@ +traceroute to paraguay.com (181.40.91.83), 64 hops max, 52 byte packets + 1 [AS128742] 192.168.0.1 (192.168.0.1) 9.173 ms 5.490 ms 5.197 ms + 2 * * * + 3 [AS0] 192.168.117.58 (192.168.117.58) 26.768 ms 17.878 ms 16.443 ms + 4 [AS0] 192.168.15.1 (192.168.15.1) 16.229 ms 23.514 ms 16.878 ms + 5 [AS0] 91.122.105.27 (91.122.105.27) 17.825 ms 22.906 ms 29.003 ms + 6 [AS0] 94.142.122.45 (94.142.122.45) 42.790 ms 46.352 ms + [AS0] 94.142.122.44 (94.142.122.44) 41.479 ms + 7 [AS0] 94.142.124.46 (94.142.124.46) 62.692 ms 44.691 ms + [AS0] 5.53.0.153 (5.53.0.153) 61.049 ms + 8 [AS0] pool-30-42-40-181.telecel.com.py (181.40.42.30) 65.148 ms + [AS0] 5.53.0.155 (5.53.0.155) 65.096 ms + [AS0] pool-30-42-40-181.telecel.com.py (181.40.42.30) 65.157 ms + 9 * * * +10 * * * +11 * * * +12 * * * From 2341e456a012564f86d533d2748a5887d79995e4 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 11:31:35 -0700 Subject: [PATCH 34/80] use ParseError instead of generic Exception --- jc/parsers/traceroute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 65485204..7f858b58 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -189,7 +189,7 @@ def loads(data): probe_rtt = None else: message = "Expected probe RTT or *. Got: '{}'".format(probe_rtt_annotation[0]) - raise Exception(message) + raise ParseError(message) probe_annotation = probe_rtt_annotation[2] or None From 126b1b121ca10183dc7e9dece83b42907becad39 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 11:31:56 -0700 Subject: [PATCH 35/80] add traceroute6 example --- tests/fixtures/generic/traceroute8.out | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/fixtures/generic/traceroute8.out diff --git a/tests/fixtures/generic/traceroute8.out b/tests/fixtures/generic/traceroute8.out new file mode 100644 index 00000000..fea21dce --- /dev/null +++ b/tests/fixtures/generic/traceroute8.out @@ -0,0 +1,10 @@ +traceroute to baeldung.com (2606:4700:3030::6812:3e4e), 30 hops max, 80 byte packets + 1 2001:2e8:665:0:2:2:0:1 (2001:2e8:665:0:2:2:0:1) 0.083 ms 0.048 ms 0.044 ms + 2 2001:2e8:22:204::2 (2001:2e8:22:204::2) 25.128 ms 25.047 ms 25.025 ms + 3 2001:2e8:20::22:11 (2001:2e8:20::22:11) 1.106 ms 25.830 ms 1.007 ms + 4 xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net (2001:218:2000:5000::305) 0.908 ms 1.197 ms 1.097 ms + 5 ae-25.r02.tokyjp05.jp.bb.gin.ntt.net (2001:218:0:2000::59) 1.515 ms 1.744 ms 1.785 ms + 6 ae-4.r30.tokyjp05.jp.bb.gin.ntt.net (2001:218:0:2000::11a) 1.466 ms 1.538 ms ae-4.r30.tokyjp05.jp.bb.gin.ntt.net (2001:218:0:2000::11a) 1.337 ms + 7 ae-3.r00.tokyjp08.jp.bb.gin.ntt.net (2001:218:0:2000::2d7) 1.857 ms 1.839 ms ae-3.r00.tokyjp08.jp.bb.gin.ntt.net (2001:218:0:2000::2d7) 1.901 ms + 8 as7515.ntt.net (2001:218:2000:5000::26) 2.717 ms 2.419 ms 2.325 ms + 9 2400:cb00:22:1024::a29e:759c (2400:cb00:22:1024::a29e:759c) 2.115 ms 1.985 ms 2400:cb00:22:1024::a29e:759f (2400:cb00:22:1024::a29e:759f) 2.272 ms From 6f5cd1d7c5f76d7d4da42171fdc30daf9fe3996e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 12:03:21 -0700 Subject: [PATCH 36/80] change to use f-string --- jc/parsers/traceroute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 7f858b58..0d7950a6 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -188,7 +188,7 @@ def loads(data): elif probe_rtt_annotation[1]: probe_rtt = None else: - message = "Expected probe RTT or *. Got: '{}'".format(probe_rtt_annotation[0]) + message = f"Expected probe RTT or *. Got: '{probe_rtt_annotation[0]}'" raise ParseError(message) probe_annotation = probe_rtt_annotation[2] or None From 68a37a6a5a3f0ad0fa24c84d363050af9fa11f97 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 12:48:33 -0700 Subject: [PATCH 37/80] remove unused function load() --- jc/parsers/traceroute.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 0d7950a6..6eedc295 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -205,10 +205,6 @@ def loads(data): return traceroute -def load(data): - return loads(data.read()) - - class ParseError(Exception): pass From 7bc497e1291059ae7858c9d2bd2d9a1b4c030dd1 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 15:42:33 -0700 Subject: [PATCH 38/80] updated process() function to set integers and floats --- jc/parsers/traceroute.py | 129 +++++++++++++++++++++++++++++++++++---- 1 file changed, 116 insertions(+), 13 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 6eedc295..53e07e90 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -13,8 +13,67 @@ Compatibility: Examples: - $ traceroute www.cnn.com 2>&1 | jc --traceroute -p - [] + $ traceroute www.cnn.com | jc --traceroute -p -r + { + "destination_ip": "173.207.22.152", + "destination_name": "http://google.es", + "hops": [ + { + "hop": "1", + "probes": [ + { + "annotation": null, + "asn": "1739", + "ip": "131.240.100.12", + "name": "131.240.100.12", + "rtt": "0.676" + }, + { + "annotation": null, + "asn": "1739", + "ip": "131.240.100.12", + "name": "131.240.100.12", + "rtt": "0.763" + }, + { + "annotation": null, + "asn": "1739", + "ip": "131.240.100.12", + "name": "131.240.100.12", + "rtt": "0.910" + } + ] + }, + { + "hop": "2", + "probes": [ + { + "annotation": null, + "asn": "1739", + "ip": "131.232.1.26", + "name": "http://tut1-fw-vlan558.av.tut.fi", + "rtt": "0.266" + }, + { + "annotation": null, + "asn": "1739", + "ip": "131.232.1.26", + "name": "http://tut1-fw-vlan558.av.tut.fi", + "rtt": "0.404" + }, + { + "annotation": null, + "asn": "1739", + "ip": "131.232.1.26", + "name": "http://tut1-fw-vlan558.av.tut.fi", + "rtt": "0.493" + } + ] + }, + ... + ] + } + $ traceroute | jc --traceroute -p -r [] @@ -79,7 +138,7 @@ class Hop(object): """ def __init__(self, idx): - self.idx = idx # Hop count, starting at 1 + self.idx = idx # Hop count, starting at 1 (usually) self.probes = [] # Series of Probe instances def add_probe(self, probe): @@ -221,18 +280,62 @@ def process(proc_data): Returns: - List of dictionaries. Structured data with the following schema: + Dictionary. Structured data with the following schema: - [ - { - "foo": string, - "bar": boolean, - "baz": integer - } - ] + { + "destination_ip": string, + "destination_name": string, + "hops": [ + { + "hop": integer, + "probes": [ + { + "annotation": string, + "asn": integer, + "ip": string, + "name": string, + "rtt": float + } + ] + } + ] + } """ + int_list = ['hop', 'asn'] + float_list = ['rtt'] + + if proc_data['hops']: + for entry in proc_data['hops']: + for key in int_list: + if key in entry: + try: + entry[key] = int(entry[key]) + except (ValueError, TypeError): + entry[key] = None + + for key in float_list: + if key in entry: + try: + entry[key] = float(entry[key]) + except (ValueError, TypeError): + entry[key] = None + + if entry['probes']: + for item in entry['probes']: + for key in int_list: + if key in item: + try: + item[key] = int(item[key]) + except (ValueError, TypeError): + item[key] = None + + for key in float_list: + if key in item: + try: + item[key] = float(item[key]) + except (ValueError, TypeError): + item[key] = None - # rebuild output for added semantic information return proc_data @@ -248,7 +351,7 @@ def parse(data, raw=False, quiet=False): Returns: - List of dictionaries. Raw or processed structured data. + Dictionary. Raw or processed structured data. """ if not quiet: jc.utils.compatibility(__name__, info.compatible) From 4f4b6276d4bf798b17d996f39742bd0428fc2f19 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 15:46:22 -0700 Subject: [PATCH 39/80] update docstring --- jc/parsers/traceroute.py | 95 +++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 53e07e90..bbe800ac 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -13,60 +13,34 @@ Compatibility: Examples: - $ traceroute www.cnn.com | jc --traceroute -p -r + $ traceroute google.com | jc --traceroute -p { - "destination_ip": "173.207.22.152", - "destination_name": "http://google.es", + "destination_ip": "216.58.194.46", + "destination_name": "google.com", "hops": [ { - "hop": "1", + "hop": 1, "probes": [ { "annotation": null, - "asn": "1739", - "ip": "131.240.100.12", - "name": "131.240.100.12", - "rtt": "0.676" + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": 198.574 }, { "annotation": null, - "asn": "1739", - "ip": "131.240.100.12", - "name": "131.240.100.12", - "rtt": "0.763" + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": null }, { "annotation": null, - "asn": "1739", - "ip": "131.240.100.12", - "name": "131.240.100.12", - "rtt": "0.910" - } - ] - }, - { - "hop": "2", - "probes": [ - { - "annotation": null, - "asn": "1739", - "ip": "131.232.1.26", - "name": "http://tut1-fw-vlan558.av.tut.fi", - "rtt": "0.266" - }, - { - "annotation": null, - "asn": "1739", - "ip": "131.232.1.26", - "name": "http://tut1-fw-vlan558.av.tut.fi", - "rtt": "0.404" - }, - { - "annotation": null, - "asn": "1739", - "ip": "131.232.1.26", - "name": "http://tut1-fw-vlan558.av.tut.fi", - "rtt": "0.493" + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": 198.65 } ] }, @@ -74,9 +48,40 @@ Examples: ] } - - $ traceroute | jc --traceroute -p -r - [] + $ traceroute google.com | jc --traceroute -p -r + { + "destination_ip": "216.58.194.46", + "destination_name": "google.com", + "hops": [ + { + "hop": "1", + "probes": [ + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": "198.574" + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": null + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": "198.650" + } + ] + }, + ... + ] + } """ import re from decimal import Decimal From 14697b86d7fc1cfebb41e0fd2d9a9b9b60071d3b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 15:48:08 -0700 Subject: [PATCH 40/80] add MIT license --- jc/parsers/traceroute.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index bbe800ac..47d47b6c 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -103,11 +103,33 @@ class info(): __version__ = info.version -""" +''' Copyright (C) 2015 Luis Benitez Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). -""" + +The MIT License (MIT) + +Copyright (c) 2014 Luis Benitez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +''' RE_HEADER = re.compile(r'(\S+)\s+\((\d+\.\d+\.\d+\.\d+|[0-9a-fA-F:]+)\)') RE_PROBE_NAME_IP = re.compile(r'(\S+)\s+\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-fA-F:]+)\)+') From 5dcb7166daef3c53da65bba0d591672e64d3a90b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 16:44:57 -0700 Subject: [PATCH 41/80] add traceroute doc --- docgen.sh | 1 + docs/parsers/traceroute.md | 168 +++++++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 docs/parsers/traceroute.md diff --git a/docgen.sh b/docgen.sh index 78ed7beb..498893d9 100755 --- a/docgen.sh +++ b/docgen.sh @@ -51,6 +51,7 @@ pydocmd simple jc.parsers.systemctl_lj+ > ../docs/parsers/systemctl_lj.md pydocmd simple jc.parsers.systemctl_ls+ > ../docs/parsers/systemctl_ls.md pydocmd simple jc.parsers.systemctl_luf+ > ../docs/parsers/systemctl_luf.md pydocmd simple jc.parsers.timedatectl+ > ../docs/parsers/timedatectl.md +pydocmd simple jc.parsers.traceroute+ > ../docs/parsers/traceroute.md pydocmd simple jc.parsers.uname+ > ../docs/parsers/uname.md pydocmd simple jc.parsers.uptime+ > ../docs/parsers/uptime.md pydocmd simple jc.parsers.w+ > ../docs/parsers/w.md diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md new file mode 100644 index 00000000..4370a7e8 --- /dev/null +++ b/docs/parsers/traceroute.md @@ -0,0 +1,168 @@ +# jc.parsers.traceroute +jc - JSON CLI output utility traceroute Parser + +Usage: + + specify --traceroute as the first argument if the piped input is coming from traceroute + + Note: on OSX and FreeBSD be sure to redirect STDERR to STDOUT since the header line is sent to STDERR + e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute + +Compatibility: + + 'linux', 'darwin', 'freebsd' + +Examples: + + $ traceroute google.com | jc --traceroute -p + { + "destination_ip": "216.58.194.46", + "destination_name": "google.com", + "hops": [ + { + "hop": 1, + "probes": [ + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": 198.574 + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": null + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": 198.65 + } + ] + }, + ... + ] + } + + $ traceroute google.com | jc --traceroute -p -r + { + "destination_ip": "216.58.194.46", + "destination_name": "google.com", + "hops": [ + { + "hop": "1", + "probes": [ + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": "198.574" + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": null + }, + { + "annotation": null, + "asn": null, + "ip": "216.230.231.141", + "name": "216-230-231-141.static.houston.tx.oplink.net", + "rtt": "198.650" + } + ] + }, + ... + ] + } + +## info +```python +info(self, /, *args, **kwargs) +``` + +## Traceroute +```python +Traceroute(self, dest_name, dest_ip) +``` + +Abstraction of a traceroute result. + +## Hop +```python +Hop(self, idx) +``` + +Abstraction of a hop in a traceroute. + +## Probe +```python +Probe(self, name=None, ip=None, asn=None, rtt=None, annotation=None) +``` + +Abstraction of a probe in a traceroute. + +## loads +```python +loads(data) +``` +Parser entry point. Parses the output of a traceroute execution +## process +```python +process(proc_data) +``` + +Final processing to conform to the schema. + +Parameters: + + proc_data: (dictionary) raw structured data to process + +Returns: + + Dictionary. Structured data with the following schema: + + { + "destination_ip": string, + "destination_name": string, + "hops": [ + { + "hop": integer, + "probes": [ + { + "annotation": string, + "asn": integer, + "ip": string, + "name": string, + "rtt": float + } + ] + } + ] + } + +## parse +```python +parse(data, raw=False, quiet=False) +``` + +Main text parsing function + +Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + +Returns: + + Dictionary. Raw or processed structured data. + From ab67688a00ac335d2a5603e9cadef8b565957911 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Jul 2020 16:45:09 -0700 Subject: [PATCH 42/80] add test skeleton --- tests/test_traceroute.py | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/test_traceroute.py diff --git a/tests/test_traceroute.py b/tests/test_traceroute.py new file mode 100644 index 00000000..afb3af6c --- /dev/null +++ b/tests/test_traceroute.py @@ -0,0 +1,55 @@ +import os +import unittest +import json +import jc.parsers.traceroute + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) + + +class MyTests(unittest.TestCase): + + def setUp(self): + # input + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/traceroute.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_traceroute = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_a = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a2.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_a2 = f.read() + + # output + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/traceroute.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_traceroute_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_a_json = json.loads(f.read()) + + def test_traceroute_nodata(self): + """ + Test 'traceroute' with no data + """ + self.assertEqual(jc.parsers.traceroute.parse('', quiet=True), []) + + def test_traceroute_noheader(self): + """ + Test 'traceroute' with missing header row. Should generate a ParseError exception + """ + pass + + def test_traceroute_centos_7_7(self): + """ + Test 'traceroute' on Centos 7.7 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.centos_7_7_traceroute, quiet=True), self.centos_7_7_traceroute_json) + + def test_traceroute_a_osx_10_14_6(self): + """ + Test 'traceroute -a' on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute_a, quiet=True), self.osx_10_14_6_traceroute_a_json) + + +if __name__ == '__main__': + unittest.main() From c03c42d76703ff8f423cf3c10ea6254a27a685cb Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 13:47:23 -0700 Subject: [PATCH 43/80] add traceroute tests --- tests/fixtures/centos-7.7/traceroute.json | 1 + .../fixtures/osx-10.14.6/traceroute-asn.json | 1 + .../traceroute-mult-addresses.json | 1 + tests/fixtures/osx-10.14.6/traceroute-q.json | 1 + tests/fixtures/osx-10.14.6/traceroute.json | 1 + .../traceroute6-mult-addresses.json | 1 + ...ess.out => traceroute6-mult-addresses.out} | 0 tests/fixtures/osx-10.14.6/traceroute6.json | 1 + tests/test_traceroute.py | 78 ++++++++++++++++--- 9 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/centos-7.7/traceroute.json create mode 100644 tests/fixtures/osx-10.14.6/traceroute-asn.json create mode 100644 tests/fixtures/osx-10.14.6/traceroute-mult-addresses.json create mode 100644 tests/fixtures/osx-10.14.6/traceroute-q.json create mode 100644 tests/fixtures/osx-10.14.6/traceroute.json create mode 100644 tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.json rename tests/fixtures/osx-10.14.6/{traceroute6-multi-address.out => traceroute6-mult-addresses.out} (100%) create mode 100644 tests/fixtures/osx-10.14.6/traceroute6.json diff --git a/tests/fixtures/centos-7.7/traceroute.json b/tests/fixtures/centos-7.7/traceroute.json new file mode 100644 index 00000000..1946407f --- /dev/null +++ b/tests/fixtures/centos-7.7/traceroute.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.197.67", "destination_name": "www.cnn.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 4.024}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 3.683}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 3.706}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 24.038}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 23.911}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 23.724}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 42.273}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 42.213}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 42.083}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "12.122.2.77", "name": "12.122.2.77", "rtt": 36.789}, {"annotation": null, "asn": null, "ip": "12.122.2.77", "name": "12.122.2.77", "rtt": 43.691}, {"annotation": null, "asn": null, "ip": "12.122.2.77", "name": "12.122.2.77", "rtt": 36.597}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "12.122.2.94", "name": "sd2ca21crs.ip.att.net", "rtt": 41.587}, {"annotation": null, "asn": null, "ip": "12.122.2.94", "name": "sd2ca21crs.ip.att.net", "rtt": 40.24}, {"annotation": null, "asn": null, "ip": "12.122.2.94", "name": "sd2ca21crs.ip.att.net", "rtt": 44.659}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "12.123.215.161", "name": "12.123.215.161", "rtt": 37.858}, {"annotation": null, "asn": null, "ip": "12.123.215.161", "name": "12.123.215.161", "rtt": 37.321}, {"annotation": null, "asn": null, "ip": "12.123.215.161", "name": "12.123.215.161", "rtt": 37.092}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 13, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 14, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 15, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 16, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 17, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 18, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 19, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 20, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 21, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 22, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 23, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 24, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 25, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 26, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 27, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 28, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 29, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 30, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute-asn.json b/tests/fixtures/osx-10.14.6/traceroute-asn.json new file mode 100644 index 00000000..5ae90f6e --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-asn.json @@ -0,0 +1 @@ +{"destination_ip": "8.8.8.8", "destination_name": "8.8.8.8", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": 198949, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 6.07}, {"annotation": null, "asn": 198949, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 5.721}, {"annotation": null, "asn": 198949, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 5.269}]}, {"hop": 2, "probes": [{"annotation": null, "asn": 0, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 160.025}, {"annotation": null, "asn": 0, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 178.69}, {"annotation": null, "asn": 0, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 33.759}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": 7018, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 37.783}, {"annotation": null, "asn": 7018, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 23.782}, {"annotation": null, "asn": 7018, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 24.958}]}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.json b/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.json new file mode 100644 index 00000000..fce2ad3e --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-mult-addresses.json @@ -0,0 +1 @@ +{"destination_ip": "151.101.129.67", "destination_name": "cnn.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 4.478}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 3.907}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 4.849}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 23.53}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 26.518}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 23.48}]}, {"hop": 3, "probes": []}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute-q.json b/tests/fixtures/osx-10.14.6/traceroute-q.json new file mode 100644 index 00000000..75e23ca5 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute-q.json @@ -0,0 +1 @@ +{"destination_ip": "8.8.8.8", "destination_name": "8.8.8.8", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 3.317}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 6.373}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 6.967}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 5.299}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 4.605}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 28.829}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 20.073}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 26.238}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 22.052}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 22.519}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}, {"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute.json b/tests/fixtures/osx-10.14.6/traceroute.json new file mode 100644 index 00000000..19ac25c1 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute.json @@ -0,0 +1 @@ +{"destination_ip": "8.8.8.8", "destination_name": "8.8.8.8", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 12.07}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 4.328}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice", "rtt": 4.167}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 20.595}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 26.13}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 28.555}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 149.663}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 27.761}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 160.709}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 27.131}, {"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 160.459}, {"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 32.274}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 143.143}, {"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 27.034}, {"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 152.676}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "12.255.10.234", "name": "12.255.10.234", "rtt": 24.912}, {"annotation": null, "asn": null, "ip": "12.255.10.234", "name": "12.255.10.234", "rtt": 23.802}, {"annotation": null, "asn": null, "ip": "12.255.10.234", "name": "12.255.10.234", "rtt": 157.338}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "8.8.8.8", "name": "dns.google", "rtt": 30.84}, {"annotation": null, "asn": null, "ip": "8.8.8.8", "name": "dns.google", "rtt": 22.503}, {"annotation": null, "asn": null, "ip": "8.8.8.8", "name": "dns.google", "rtt": 23.538}]}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.json b/tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.json new file mode 100644 index 00000000..badd27b3 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:200::323", "destination_name": "turner-tls.map.fastly.net", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 27.635}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 20.383}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 23.438}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 20.118}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 20.327}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 21.213}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/osx-10.14.6/traceroute6-multi-address.out b/tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.out similarity index 100% rename from tests/fixtures/osx-10.14.6/traceroute6-multi-address.out rename to tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.out diff --git a/tests/fixtures/osx-10.14.6/traceroute6.json b/tests/fixtures/osx-10.14.6/traceroute6.json new file mode 100644 index 00000000..badd27b3 --- /dev/null +++ b/tests/fixtures/osx-10.14.6/traceroute6.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42:200::323", "destination_name": "turner-tls.map.fastly.net", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 27.635}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 20.383}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 23.438}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 20.118}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 20.327}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 21.213}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/test_traceroute.py b/tests/test_traceroute.py index afb3af6c..97fbb856 100644 --- a/tests/test_traceroute.py +++ b/tests/test_traceroute.py @@ -13,30 +13,60 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/traceroute.out'), 'r', encoding='utf-8') as f: self.centos_7_7_traceroute = f.read() - with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a.out'), 'r', encoding='utf-8') as f: - self.osx_10_14_6_traceroute_a = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-no-header.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_noheader = f.read() - with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a2.out'), 'r', encoding='utf-8') as f: - self.osx_10_14_6_traceroute_a2 = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-asn.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_asn = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-mult-addresses.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_mult_addresses = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-q.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_q = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute6_mult_addresses = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute6 = f.read() # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/traceroute.json'), 'r', encoding='utf-8') as f: self.centos_7_7_traceroute_json = json.loads(f.read()) - with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-a.json'), 'r', encoding='utf-8') as f: - self.osx_10_14_6_traceroute_a_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-asn.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_asn_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-mult-addresses.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_mult_addresses_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute-q.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_q_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6-mult-addresses.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute6_mult_addresses_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.json'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_traceroute6_json = json.loads(f.read()) def test_traceroute_nodata(self): """ Test 'traceroute' with no data """ - self.assertEqual(jc.parsers.traceroute.parse('', quiet=True), []) + self.assertEqual(jc.parsers.traceroute.parse('', quiet=True), {}) def test_traceroute_noheader(self): """ Test 'traceroute' with missing header row. Should generate a ParseError exception """ - pass + self.assertRaises(jc.parsers.traceroute.ParseError, jc.parsers.traceroute.parse, self.osx_10_14_6_traceroute_noheader) def test_traceroute_centos_7_7(self): """ @@ -48,7 +78,37 @@ class MyTests(unittest.TestCase): """ Test 'traceroute -a' on OSX 10.14.6 """ - self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute_a, quiet=True), self.osx_10_14_6_traceroute_a_json) + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute_asn, quiet=True), self.osx_10_14_6_traceroute_asn_json) + + def test_traceroute_mult_addresses_osx_10_14_6(self): + """ + Test 'traceroute' with multiple addresses returned via dns on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute_mult_addresses, quiet=True), self.osx_10_14_6_traceroute_mult_addresses_json) + + def test_traceroute_q_osx_10_14_6(self): + """ + Test 'traceroute -q' on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute_q, quiet=True), self.osx_10_14_6_traceroute_q_json) + + def test_traceroute_osx_10_14_6(self): + """ + Test 'traceroute' on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute, quiet=True), self.osx_10_14_6_traceroute_json) + + def test_traceroute6_mult_addresses_osx_10_14_6(self): + """ + Test 'traceroute6' with multiple addresses returned via dns on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute6_mult_addresses, quiet=True), self.osx_10_14_6_traceroute6_mult_addresses_json) + + def test_traceroute6_osx_10_14_6(self): + """ + Test 'traceroute6' on OSX 10.14.6 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute6, quiet=True), self.osx_10_14_6_traceroute6_json) if __name__ == '__main__': From 8444690133b6a7522822ab279e97ede6ded17ba9 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 13:47:29 -0700 Subject: [PATCH 44/80] add traceroute --- man/jc.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/jc.1 b/man/jc.1 index 3f38e3d0..a1386bd3 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -204,6 +204,10 @@ systemctl list-unit-files command parser timedatectl status command parser .TP .B +\fB--traceroute\fP +traceroute command parser +.TP +.B \fB--uname\fP uname \fB-a\fP command parser .TP From d0b7ea68a005daff313e44808b256656313a78a3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 13:47:47 -0700 Subject: [PATCH 45/80] check for key in dictionary --- jc/parsers/traceroute.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 47d47b6c..4c2adb44 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -331,7 +331,7 @@ def process(proc_data): int_list = ['hop', 'asn'] float_list = ['rtt'] - if proc_data['hops']: + if 'hops' in proc_data: for entry in proc_data['hops']: for key in int_list: if key in entry: @@ -347,7 +347,7 @@ def process(proc_data): except (ValueError, TypeError): entry[key] = None - if entry['probes']: + if 'probes' in entry: for item in entry['probes']: for key in int_list: if key in item: From 928e39cd103b96b8c3ccc8d85c930ffb419296c6 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 14:16:41 -0700 Subject: [PATCH 46/80] add generic traceroute tests --- tests/fixtures/generic/traceroute1.json | 1 + tests/fixtures/generic/traceroute2.json | 1 + tests/fixtures/generic/traceroute3.json | 1 + tests/fixtures/generic/traceroute4.json | 1 + tests/fixtures/generic/traceroute5.json | 1 + tests/fixtures/generic/traceroute6.json | 1 + tests/fixtures/generic/traceroute7.json | 1 + tests/fixtures/generic/traceroute8.json | 1 + tests/test_traceroute.py | 96 +++++++++++++++++++++++++ 9 files changed, 104 insertions(+) create mode 100644 tests/fixtures/generic/traceroute1.json create mode 100644 tests/fixtures/generic/traceroute2.json create mode 100644 tests/fixtures/generic/traceroute3.json create mode 100644 tests/fixtures/generic/traceroute4.json create mode 100644 tests/fixtures/generic/traceroute5.json create mode 100644 tests/fixtures/generic/traceroute6.json create mode 100644 tests/fixtures/generic/traceroute7.json create mode 100644 tests/fixtures/generic/traceroute8.json diff --git a/tests/fixtures/generic/traceroute1.json b/tests/fixtures/generic/traceroute1.json new file mode 100644 index 00000000..27b88891 --- /dev/null +++ b/tests/fixtures/generic/traceroute1.json @@ -0,0 +1 @@ +{"destination_ip": "173.207.22.152", "destination_name": "http://google.es", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.676}, {"annotation": null, "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.763}, {"annotation": null, "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.91}]}, {"hop": 2, "probes": [{"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.266}, {"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.404}, {"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.493}]}, {"hop": 3, "probes": [{"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 0.967}, {"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 0.961}, {"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 1.085}]}, {"hop": 4, "probes": [{"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.096}, {"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.086}, {"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.049}]}, {"hop": 5, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.81}, {"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.845}, {"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.82}]}, {"hop": 6, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 29.055}, {"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 29.013}, {"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 28.977}]}, {"hop": 7, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 3.468}, {"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 8.007}, {"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 7.89}]}, {"hop": 8, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.498}, {"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.307}, {"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.399}]}, {"hop": 9, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.25}, {"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.268}, {"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.236}]}, {"hop": 10, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.418}, {"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.41}, {"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.369}]}, {"hop": 11, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.617}, {"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.594}, {"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.603}]}, {"hop": 12, "probes": [{"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 10.01}, {"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 9.182}, {"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 44.983}]}, {"hop": 13, "probes": [{"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 10.852}, {"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 11.185}, {"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 10.876}]}, {"hop": 14, "probes": [{"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.192}, {"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.471}, {"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.502}]}, {"hop": 15, "probes": [{"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.652}, {"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.664}, {"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.777}]}]} diff --git a/tests/fixtures/generic/traceroute2.json b/tests/fixtures/generic/traceroute2.json new file mode 100644 index 00000000..acd85297 --- /dev/null +++ b/tests/fixtures/generic/traceroute2.json @@ -0,0 +1 @@ +{"destination_ip": "216.58.194.46", "destination_name": "google.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "216.230.231.141", "name": "216-230-231-141.static.houston.tx.oplink.net", "rtt": 198.574}, {"annotation": null, "asn": null, "ip": "216.230.231.141", "name": "216-230-231-141.static.houston.tx.oplink.net", "rtt": null}, {"annotation": null, "asn": null, "ip": "216.230.231.141", "name": "216-230-231-141.static.houston.tx.oplink.net", "rtt": 198.65}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "72.14.242.34", "name": "72.14.242.34", "rtt": 4.932}, {"annotation": null, "asn": null, "ip": "72.14.242.34", "name": "72.14.242.34", "rtt": 4.945}, {"annotation": null, "asn": null, "ip": "72.14.242.34", "name": "72.14.242.34", "rtt": 4.951}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "108.170.230.116", "name": "108.170.230.116", "rtt": 4.687}, {"annotation": null, "asn": null, "ip": "108.170.230.116", "name": "108.170.230.116", "rtt": 4.798}, {"annotation": null, "asn": null, "ip": "108.170.230.116", "name": "108.170.230.116", "rtt": 4.688}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "108.170.252.130", "name": "108.170.252.130", "rtt": 4.825}, {"annotation": null, "asn": null, "ip": "108.170.252.130", "name": "108.170.252.130", "rtt": 4.844}, {"annotation": null, "asn": null, "ip": "108.170.252.130", "name": "108.170.252.130", "rtt": 4.797}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "108.170.233.117", "name": "108.170.233.117", "rtt": 5.386}, {"annotation": null, "asn": null, "ip": "108.170.233.117", "name": "108.170.233.117", "rtt": 5.288}, {"annotation": null, "asn": null, "ip": "108.170.233.117", "name": "108.170.233.117", "rtt": 5.324}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "216.239.63.250", "name": "216.239.63.250", "rtt": 5.305}, {"annotation": null, "asn": null, "ip": "216.239.63.250", "name": "216.239.63.250", "rtt": 5.369}, {"annotation": null, "asn": null, "ip": "216.239.63.250", "name": "216.239.63.250", "rtt": 5.406}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": "108.170.240.129", "name": "108.170.240.129", "rtt": 6.005}, {"annotation": null, "asn": null, "ip": "108.170.240.129", "name": "108.170.240.129", "rtt": 5.93}, {"annotation": null, "asn": null, "ip": "108.170.240.129", "name": "108.170.240.129", "rtt": 5.983}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": "209.85.242.53", "name": "209.85.242.53", "rtt": 4.973}, {"annotation": null, "asn": null, "ip": "209.85.242.53", "name": "209.85.242.53", "rtt": 4.973}, {"annotation": null, "asn": null, "ip": "209.85.242.53", "name": "209.85.242.53", "rtt": 4.979}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": "216.58.194.46", "name": "dfw25s12-in-f46.1e100.net", "rtt": 4.871}, {"annotation": null, "asn": null, "ip": "216.58.194.46", "name": "dfw25s12-in-f46.1e100.net", "rtt": 4.884}, {"annotation": null, "asn": null, "ip": "216.58.194.46", "name": "dfw25s12-in-f46.1e100.net", "rtt": 4.863}]}]} diff --git a/tests/fixtures/generic/traceroute3.json b/tests/fixtures/generic/traceroute3.json new file mode 100644 index 00000000..a7f26646 --- /dev/null +++ b/tests/fixtures/generic/traceroute3.json @@ -0,0 +1 @@ +{"destination_ip": "31.13.82.36", "destination_name": "facebook.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "175.41.192.133", "name": "ec2-175-41-192-133.ap-northeast-1.compute.amazonaws.com", "rtt": 1.002}, {"annotation": null, "asn": null, "ip": "175.41.192.133", "name": "ec2-175-41-192-133.ap-northeast-1.compute.amazonaws.com", "rtt": null}, {"annotation": null, "asn": null, "ip": "175.41.192.133", "name": "ec2-175-41-192-133.ap-northeast-1.compute.amazonaws.com", "rtt": 1.006}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "100.65.10.33", "name": "100.65.10.33", "rtt": 0.269}, {"annotation": null, "asn": null, "ip": "100.65.10.33", "name": "100.65.10.33", "rtt": 0.282}, {"annotation": null, "asn": null, "ip": "100.65.10.33", "name": "100.65.10.33", "rtt": 0.32}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "54.239.52.186", "name": "54.239.52.186", "rtt": 1.411}, {"annotation": null, "asn": null, "ip": "54.239.52.186", "name": "54.239.52.186", "rtt": 1.431}, {"annotation": null, "asn": null, "ip": "54.239.52.186", "name": "54.239.52.186", "rtt": 1.433}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "52.95.31.89", "name": "52.95.31.89", "rtt": 2.612}, {"annotation": null, "asn": null, "ip": "52.95.31.89", "name": "52.95.31.89", "rtt": 2.634}, {"annotation": null, "asn": null, "ip": "52.95.31.89", "name": "52.95.31.89", "rtt": 2.659}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": "52.95.31.56", "name": "52.95.31.56", "rtt": 1.017}, {"annotation": null, "asn": null, "ip": "52.95.31.56", "name": "52.95.31.56", "rtt": 1.028}, {"annotation": null, "asn": null, "ip": "52.95.31.56", "name": "52.95.31.56", "rtt": 1.048}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": "52.95.31.149", "name": "52.95.31.149", "rtt": 7.042}, {"annotation": null, "asn": null, "ip": "52.95.31.149", "name": "52.95.31.149", "rtt": 7.057}, {"annotation": null, "asn": null, "ip": "52.95.31.149", "name": "52.95.31.149", "rtt": 7.06}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": "54.239.53.66", "name": "54.239.53.66", "rtt": 7.828}, {"annotation": null, "asn": null, "ip": "54.239.53.66", "name": "54.239.53.66", "rtt": 7.81}, {"annotation": null, "asn": null, "ip": "54.239.53.66", "name": "54.239.53.66", "rtt": 7.997}]}, {"hop": 13, "probes": [{"annotation": null, "asn": null, "ip": "54.239.53.82", "name": "54.239.53.82", "rtt": 7.12}, {"annotation": null, "asn": null, "ip": "54.239.53.82", "name": "54.239.53.82", "rtt": 7.126}, {"annotation": null, "asn": null, "ip": "54.239.53.82", "name": "54.239.53.82", "rtt": 7.178}]}, {"hop": 14, "probes": [{"annotation": null, "asn": null, "ip": "63.222.51.9", "name": "63-222-51-9.static.pccwglobal.net", "rtt": 7.657}, {"annotation": null, "asn": null, "ip": "63.222.51.9", "name": "63-222-51-9.static.pccwglobal.net", "rtt": 7.611}, {"annotation": null, "asn": null, "ip": "63.222.51.9", "name": "63-222-51-9.static.pccwglobal.net", "rtt": 7.669}]}, {"hop": 15, "probes": [{"annotation": null, "asn": null, "ip": "63.218.250.169", "name": "HundredGE0-4-0-3.br02.tok02.pccwbtn.net", "rtt": 8.13}, {"annotation": null, "asn": null, "ip": "63.218.250.169", "name": "HundredGE0-4-0-3.br02.tok02.pccwbtn.net", "rtt": 8.368}, {"annotation": null, "asn": null, "ip": "63.218.250.169", "name": "HundredGE0-4-0-3.br02.tok02.pccwbtn.net", "rtt": 8.402}]}, {"hop": 16, "probes": [{"annotation": null, "asn": null, "ip": "63.218.251.118", "name": "63-218-251-118.static.pccwglobal.net", "rtt": 30.511}, {"annotation": null, "asn": null, "ip": "63.218.251.118", "name": "63-218-251-118.static.pccwglobal.net", "rtt": 20.379}, {"annotation": null, "asn": null, "ip": "63.218.251.118", "name": "63-218-251-118.static.pccwglobal.net", "rtt": 20.352}]}, {"hop": 17, "probes": [{"annotation": null, "asn": null, "ip": "157.240.40.9", "name": "po104.psw04.nrt1.tfbnw.net", "rtt": 8.341}, {"annotation": null, "asn": null, "ip": "157.240.40.9", "name": "po104.psw04.nrt1.tfbnw.net", "rtt": 8.303}, {"annotation": null, "asn": null, "ip": "157.240.40.9", "name": "po104.psw04.nrt1.tfbnw.net", "rtt": 8.312}]}, {"hop": 18, "probes": [{"annotation": null, "asn": null, "ip": "173.252.67.191", "name": "173.252.67.191", "rtt": 8.298}, {"annotation": null, "asn": null, "ip": "173.252.67.191", "name": "173.252.67.191", "rtt": 8.328}, {"annotation": null, "asn": null, "ip": "173.252.67.191", "name": "173.252.67.191", "rtt": 8.359}]}, {"hop": 19, "probes": [{"annotation": null, "asn": null, "ip": "31.13.82.36", "name": "edge-star-mini-shv-01-nrt1.facebook.com", "rtt": 8.214}, {"annotation": null, "asn": null, "ip": "31.13.82.36", "name": "edge-star-mini-shv-01-nrt1.facebook.com", "rtt": 8.198}, {"annotation": null, "asn": null, "ip": "31.13.82.36", "name": "edge-star-mini-shv-01-nrt1.facebook.com", "rtt": 8.192}]}]} diff --git a/tests/fixtures/generic/traceroute4.json b/tests/fixtures/generic/traceroute4.json new file mode 100644 index 00000000..cb3324ed --- /dev/null +++ b/tests/fixtures/generic/traceroute4.json @@ -0,0 +1 @@ +{"destination_ip": "64.13.192.208", "destination_name": "example.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "72.10.62.1", "name": "72.10.62.1", "rtt": 1.0}, {"annotation": null, "asn": null, "ip": "72.10.62.1", "name": "72.10.62.1", "rtt": 0.739}, {"annotation": null, "asn": null, "ip": "72.10.62.1", "name": "72.10.62.1", "rtt": 0.702}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "10.101.248.1", "name": "10.101.248.1", "rtt": 0.683}, {"annotation": null, "asn": null, "ip": "10.101.248.1", "name": "10.101.248.1", "rtt": 0.385}, {"annotation": null, "asn": null, "ip": "10.101.248.1", "name": "10.101.248.1", "rtt": 0.315}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": "10.104.65.161", "name": "10.104.65.161", "rtt": 0.791}, {"annotation": null, "asn": null, "ip": "10.104.65.161", "name": "10.104.65.161", "rtt": 0.703}, {"annotation": null, "asn": null, "ip": "10.104.65.161", "name": "10.104.65.161", "rtt": 0.686}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "10.104.0.1", "name": "10.104.0.1", "rtt": 1.43}, {"annotation": null, "asn": null, "ip": "10.104.0.1", "name": "10.104.0.1", "rtt": 1.31}, {"annotation": null, "asn": null, "ip": "10.104.0.1", "name": "10.104.0.1", "rtt": 1.063}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "10.0.10.33", "name": "10.0.10.33", "rtt": 2.652}, {"annotation": null, "asn": null, "ip": "10.0.10.33", "name": "10.0.10.33", "rtt": 2.26}, {"annotation": null, "asn": null, "ip": "10.0.10.33", "name": "10.0.10.33", "rtt": 5.353}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "64.13.192.208", "name": "www.example.com", "rtt": 3.384}, {"annotation": null, "asn": null, "ip": "64.13.192.208", "name": "www.example.com", "rtt": 8.001}, {"annotation": null, "asn": null, "ip": "64.13.192.208", "name": "www.example.com", "rtt": 2.439}]}]} diff --git a/tests/fixtures/generic/traceroute5.json b/tests/fixtures/generic/traceroute5.json new file mode 100644 index 00000000..d5d9b79c --- /dev/null +++ b/tests/fixtures/generic/traceroute5.json @@ -0,0 +1 @@ +{"destination_ip": "104.18.42.178", "destination_name": "10xhostings.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": 0.894}, {"annotation": null, "asn": null, "ip": null, "name": null, "rtt": 0.89}, {"annotation": null, "asn": null, "ip": null, "name": null, "rtt": 0.876}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": "204.141.42.25", "name": "204.141.42.25", "rtt": 2.818}, {"annotation": null, "asn": null, "ip": "204.141.42.25", "name": "204.141.42.25", "rtt": 2.825}, {"annotation": null, "asn": null, "ip": "204.141.42.25", "name": "204.141.42.25", "rtt": 2.825}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "204.141.42.9", "name": "204.141.42.9", "rtt": 1.014}, {"annotation": null, "asn": null, "ip": "204.141.42.9", "name": "204.141.42.9", "rtt": 1.017}, {"annotation": null, "asn": null, "ip": "204.141.42.9", "name": "204.141.42.9", "rtt": 1.082}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "128.241.1.145", "name": "xe-0-0-46-2.a00.sttlwa01.us.bb.gin.ntt.net", "rtt": 30.105}, {"annotation": null, "asn": null, "ip": "128.241.1.145", "name": "xe-0-0-46-2.a00.sttlwa01.us.bb.gin.ntt.net", "rtt": 30.125}, {"annotation": null, "asn": null, "ip": "128.241.1.145", "name": "xe-0-0-46-2.a00.sttlwa01.us.bb.gin.ntt.net", "rtt": 30.125}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "129.250.5.117", "name": "ae-9.r04.sttlwa01.us.bb.gin.ntt.net", "rtt": 32.346}, {"annotation": null, "asn": null, "ip": "129.250.5.117", "name": "ae-9.r04.sttlwa01.us.bb.gin.ntt.net", "rtt": 31.946}, {"annotation": null, "asn": null, "ip": "129.250.5.117", "name": "ae-9.r04.sttlwa01.us.bb.gin.ntt.net", "rtt": 31.96}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "129.250.5.86", "name": "ae-0.a01.sttlwa01.us.bb.gin.ntt.net", "rtt": 32.836}, {"annotation": null, "asn": null, "ip": "129.250.5.86", "name": "ae-0.a01.sttlwa01.us.bb.gin.ntt.net", "rtt": 32.749}, {"annotation": null, "asn": null, "ip": "129.250.5.86", "name": "ae-0.a01.sttlwa01.us.bb.gin.ntt.net", "rtt": 32.743}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "131.103.117.86", "name": "ae-0.cloudflare.sttlwa01.us.bb.gin.ntt.net", "rtt": 44.601}, {"annotation": null, "asn": null, "ip": "131.103.117.86", "name": "ae-0.cloudflare.sttlwa01.us.bb.gin.ntt.net", "rtt": 42.886}, {"annotation": null, "asn": null, "ip": "131.103.117.86", "name": "ae-0.cloudflare.sttlwa01.us.bb.gin.ntt.net", "rtt": 42.874}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "104.18.42.178", "name": "104.18.42.178", "rtt": 29.614}, {"annotation": null, "asn": null, "ip": "104.18.42.178", "name": "104.18.42.178", "rtt": 29.69}, {"annotation": null, "asn": null, "ip": "104.18.42.178", "name": "104.18.42.178", "rtt": 30.461}]}]} diff --git a/tests/fixtures/generic/traceroute6.json b/tests/fixtures/generic/traceroute6.json new file mode 100644 index 00000000..acaf6e6b --- /dev/null +++ b/tests/fixtures/generic/traceroute6.json @@ -0,0 +1 @@ +{"destination_ip": "52.22.122.82", "destination_name": "alexa.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "130.185.80.253", "name": "130.185.80.253", "rtt": 0.374}, {"annotation": null, "asn": null, "ip": "130.185.80.253", "name": "130.185.80.253", "rtt": null}, {"annotation": null, "asn": null, "ip": "130.185.80.253", "name": "130.185.80.253", "rtt": 0.474}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "94.46.128.26", "name": "94.46.128.26", "rtt": 0.44}, {"annotation": null, "asn": null, "ip": "94.46.128.26", "name": "94.46.128.26", "rtt": 0.457}, {"annotation": null, "asn": null, "ip": "94.46.128.26", "name": "94.46.128.26", "rtt": 0.459}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": "80.231.158.49", "name": "ix-xe-1-3-0-0.tcore1.pv9-lisbon.as6453.net", "rtt": 0.436}, {"annotation": null, "asn": null, "ip": "80.231.158.49", "name": "ix-xe-1-3-0-0.tcore1.pv9-lisbon.as6453.net", "rtt": 0.436}, {"annotation": null, "asn": null, "ip": "80.231.158.49", "name": "ix-xe-1-3-0-0.tcore1.pv9-lisbon.as6453.net", "rtt": 0.446}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "80.231.158.30", "name": "if-ae-1-3.tcore1.sv8-highbridge.as6453.net", "rtt": 100.3}, {"annotation": null, "asn": null, "ip": "80.231.158.30", "name": "if-ae-1-3.tcore1.sv8-highbridge.as6453.net", "rtt": 100.346}, {"annotation": null, "asn": null, "ip": "80.231.158.30", "name": "if-ae-1-3.tcore1.sv8-highbridge.as6453.net", "rtt": 100.362}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "80.231.139.1", "name": "if-ae-2-2.tcore2.sv8-highbridge.as6453.net", "rtt": 100.737}, {"annotation": null, "asn": null, "ip": "80.231.139.1", "name": "if-ae-2-2.tcore2.sv8-highbridge.as6453.net", "rtt": 100.787}, {"annotation": null, "asn": null, "ip": "80.231.139.1", "name": "if-ae-2-2.tcore2.sv8-highbridge.as6453.net", "rtt": 100.863}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "80.231.139.42", "name": "if-ae-11-2.tcore1.l78-london.as6453.net", "rtt": 94.576}, {"annotation": null, "asn": null, "ip": "80.231.139.42", "name": "if-ae-11-2.tcore1.l78-london.as6453.net", "rtt": 94.647}, {"annotation": null, "asn": null, "ip": "80.231.139.42", "name": "if-ae-11-2.tcore1.l78-london.as6453.net", "rtt": 94.631}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "80.231.130.106", "name": "if-ae-66-2.tcore2.nto-new-york.as6453.net", "rtt": 104.775}, {"annotation": null, "asn": null, "ip": "80.231.130.106", "name": "if-ae-66-2.tcore2.nto-new-york.as6453.net", "rtt": 105.059}, {"annotation": null, "asn": null, "ip": "80.231.130.106", "name": "if-ae-66-2.tcore2.nto-new-york.as6453.net", "rtt": 105.146}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "66.110.96.5", "name": "if-ae-12-2.tcore1.n75-new-york.as6453.net", "rtt": 100.043}, {"annotation": null, "asn": null, "ip": "66.110.96.5", "name": "if-ae-12-2.tcore1.n75-new-york.as6453.net", "rtt": 100.096}, {"annotation": null, "asn": null, "ip": "66.110.96.5", "name": "if-ae-12-2.tcore1.n75-new-york.as6453.net", "rtt": 100.089}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "66.110.96.157", "name": "66.110.96.157", "rtt": 101.514}, {"annotation": null, "asn": null, "ip": "66.110.96.157", "name": "66.110.96.157", "rtt": 101.055}, {"annotation": null, "asn": null, "ip": "66.110.96.157", "name": "66.110.96.157", "rtt": 101.058}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": "52.93.31.33", "name": "52.93.31.33", "rtt": 100.489}, {"annotation": null, "asn": null, "ip": "52.93.31.33", "name": "52.93.31.33", "rtt": 100.113}, {"annotation": null, "asn": null, "ip": "52.93.31.33", "name": "52.93.31.33", "rtt": 100.065}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": "52.93.4.0", "name": "52.93.4.0", "rtt": 93.575}, {"annotation": null, "asn": null, "ip": "52.93.4.0", "name": "52.93.4.0", "rtt": 93.473}, {"annotation": null, "asn": null, "ip": "52.93.4.0", "name": "52.93.4.0", "rtt": 93.491}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 13, "probes": [{"annotation": null, "asn": null, "ip": "54.240.229.143", "name": "54.240.229.143", "rtt": 94.307}, {"annotation": null, "asn": null, "ip": "54.240.229.143", "name": "54.240.229.143", "rtt": 94.732}, {"annotation": null, "asn": null, "ip": "54.240.229.143", "name": "54.240.229.143", "rtt": 94.683}]}, {"hop": 14, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 15, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 16, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 17, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 18, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 19, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 20, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 21, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 22, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 23, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 24, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 25, "probes": [{"annotation": null, "asn": null, "ip": "52.93.28.172", "name": "52.93.28.172", "rtt": 94.27}, {"annotation": null, "asn": null, "ip": "52.93.28.172", "name": "52.93.28.172", "rtt": 94.296}, {"annotation": null, "asn": null, "ip": "52.93.28.172", "name": "52.93.28.172", "rtt": 94.294}]}, {"hop": 26, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 27, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 28, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 29, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 30, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/generic/traceroute7.json b/tests/fixtures/generic/traceroute7.json new file mode 100644 index 00000000..0bdfb92c --- /dev/null +++ b/tests/fixtures/generic/traceroute7.json @@ -0,0 +1 @@ +{"destination_ip": "181.40.91.83", "destination_name": "paraguay.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": 128742, "ip": "192.168.0.1", "name": "192.168.0.1", "rtt": 9.173}, {"annotation": null, "asn": 128742, "ip": "192.168.0.1", "name": "192.168.0.1", "rtt": 5.49}, {"annotation": null, "asn": 128742, "ip": "192.168.0.1", "name": "192.168.0.1", "rtt": 5.197}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 3, "probes": [{"annotation": null, "asn": 0, "ip": "192.168.117.58", "name": "192.168.117.58", "rtt": 26.768}, {"annotation": null, "asn": 0, "ip": "192.168.117.58", "name": "192.168.117.58", "rtt": 17.878}, {"annotation": null, "asn": 0, "ip": "192.168.117.58", "name": "192.168.117.58", "rtt": 16.443}]}, {"hop": 4, "probes": [{"annotation": null, "asn": 0, "ip": "192.168.15.1", "name": "192.168.15.1", "rtt": 16.229}, {"annotation": null, "asn": 0, "ip": "192.168.15.1", "name": "192.168.15.1", "rtt": 23.514}, {"annotation": null, "asn": 0, "ip": "192.168.15.1", "name": "192.168.15.1", "rtt": 16.878}]}, {"hop": 5, "probes": [{"annotation": null, "asn": 0, "ip": "91.122.105.27", "name": "91.122.105.27", "rtt": 17.825}, {"annotation": null, "asn": 0, "ip": "91.122.105.27", "name": "91.122.105.27", "rtt": 22.906}, {"annotation": null, "asn": 0, "ip": "91.122.105.27", "name": "91.122.105.27", "rtt": 29.003}]}, {"hop": 6, "probes": [{"annotation": null, "asn": 0, "ip": "94.142.122.45", "name": "94.142.122.45", "rtt": 42.79}, {"annotation": null, "asn": 0, "ip": "94.142.122.45", "name": "94.142.122.45", "rtt": 46.352}, {"annotation": null, "asn": 0, "ip": "94.142.122.44", "name": "94.142.122.44", "rtt": 41.479}]}, {"hop": 7, "probes": [{"annotation": null, "asn": 0, "ip": "94.142.124.46", "name": "94.142.124.46", "rtt": 62.692}, {"annotation": null, "asn": 0, "ip": "94.142.124.46", "name": "94.142.124.46", "rtt": 44.691}, {"annotation": null, "asn": 0, "ip": "5.53.0.153", "name": "5.53.0.153", "rtt": 61.049}]}, {"hop": 8, "probes": [{"annotation": null, "asn": 0, "ip": "181.40.42.30", "name": "pool-30-42-40-181.telecel.com.py", "rtt": 65.148}, {"annotation": null, "asn": 0, "ip": "5.53.0.155", "name": "5.53.0.155", "rtt": 65.096}, {"annotation": null, "asn": 0, "ip": "181.40.42.30", "name": "pool-30-42-40-181.telecel.com.py", "rtt": 65.157}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/generic/traceroute8.json b/tests/fixtures/generic/traceroute8.json new file mode 100644 index 00000000..b0f6f779 --- /dev/null +++ b/tests/fixtures/generic/traceroute8.json @@ -0,0 +1 @@ +{"destination_ip": "2606:4700:3030::6812:3e4e", "destination_name": "baeldung.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.083}, {"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.048}, {"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.044}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.128}, {"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.047}, {"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.025}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 1.106}, {"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 25.83}, {"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 1.007}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 0.908}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.197}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.097}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.515}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.744}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.785}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.466}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.538}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.337}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.857}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.839}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.901}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.717}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.419}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.325}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 2.115}, {"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 1.985}, {"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 2.272}]}]} diff --git a/tests/test_traceroute.py b/tests/test_traceroute.py index 97fbb856..fdc7b198 100644 --- a/tests/test_traceroute.py +++ b/tests/test_traceroute.py @@ -34,6 +34,30 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.out'), 'r', encoding='utf-8') as f: self.osx_10_14_6_traceroute6 = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute1.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute1 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute2.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute2 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute3.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute3 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute4.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute4 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute5.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute5 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute6.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute6 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute7.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute7 = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute8.out'), 'r', encoding='utf-8') as f: + self.generic_traceroute8 = f.read() + # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/traceroute.json'), 'r', encoding='utf-8') as f: self.centos_7_7_traceroute_json = json.loads(f.read()) @@ -56,6 +80,30 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_traceroute6_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute1.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute1_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute2.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute2_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute3.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute3_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute4.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute4_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute5.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute5_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute6.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute6_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute7.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute7_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute8.json'), 'r', encoding='utf-8') as f: + self.generic_traceroute8_json = json.loads(f.read()) + def test_traceroute_nodata(self): """ Test 'traceroute' with no data @@ -110,6 +158,54 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute6, quiet=True), self.osx_10_14_6_traceroute6_json) + def test_traceroute1_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute1, quiet=True), self.generic_traceroute1_json) + + def test_traceroute2_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute2, quiet=True), self.generic_traceroute2_json) + + def test_traceroute3_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute3, quiet=True), self.generic_traceroute3_json) + + def test_traceroute4_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute4, quiet=True), self.generic_traceroute4_json) + + def test_traceroute5_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute5, quiet=True), self.generic_traceroute5_json) + + def test_traceroute6_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute6, quiet=True), self.generic_traceroute6_json) + + def test_traceroute7_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute7, quiet=True), self.generic_traceroute7_json) + + def test_traceroute8_generic(self): + """ + Test 'traceroute' + """ + self.assertEqual(jc.parsers.traceroute.parse(self.generic_traceroute8, quiet=True), self.generic_traceroute8_json) + if __name__ == '__main__': unittest.main() From f5e546c6fa7cba166284a0976887d6b82451d3e8 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:16:24 -0700 Subject: [PATCH 47/80] add support for simple key/value pairs --- jc/parsers/ini.py | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index fc162d49..86f8237d 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -2,7 +2,9 @@ Usage: - specify --ini as the first argument if the piped input is coming from an INI file + Specify --ini as the first argument if the piped input is coming from an INI file or any + simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. + Comment prefix can be '#' or ';'. Comments must be on their own line. Compatibility: @@ -47,8 +49,8 @@ import configparser class info(): - version = '1.1' - description = 'INI file parser' + version = '1.2' + description = 'INI file parser. Also parses files/output containing simple key/value pairs' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' details = 'Using configparser from the standard library' @@ -73,12 +75,26 @@ def process(proc_data): Dictionary representing an ini document: { - ini document converted to a dictionary - see configparser standard library documentation for more details + ini or key/value document converted to a dictionary - see configparser standard + library documentation for more details. + + Note: Values starting and ending with quotation marks will have the marks removed. + If you would like to keep the quotation markes, use the -r or raw=True argument. } """ + # remove quotation marks from beginning and end of values + for heading in proc_data: + # standard ini files with headers + if isinstance(proc_data[heading], dict): + for key, value in proc_data[heading].items(): + if value.startswith('"') and value.endswith('"'): + proc_data[heading][key] = value.lstrip('"').rstrip('"') + + # simple key/value files with no headers + else: + if proc_data[heading].startswith('"') and proc_data[heading].endswith('"'): + proc_data[heading] = proc_data[heading].lstrip('"').rstrip('"') - # No further processing return proc_data @@ -103,9 +119,17 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): - ini = configparser.ConfigParser() - ini.read_string(data) - raw_output = {s: dict(ini.items(s)) for s in ini.sections()} + ini = configparser.ConfigParser(allow_no_value=True) + try: + ini.read_string(data) + raw_output = {s: dict(ini.items(s)) for s in ini.sections()} + + except configparser.MissingSectionHeaderError: + data = '[data]\n' + data + ini.read_string(data) + output_dict = {s: dict(ini.items(s)) for s in ini.sections()} + for key, value in output_dict['data'].items(): + raw_output[key] = value if raw: return raw_output From b7d4ddc7ced2c3aabf3a857b53a0bf1b62eb6a2c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:16:54 -0700 Subject: [PATCH 48/80] add tests for key/value files --- tests/fixtures/generic/keyvalue-ifcfg.json | 1 + tests/fixtures/generic/keyvalue-ifcfg.txt | 19 +++++++++++++++++ tests/fixtures/generic/keyvalue.json | 1 + tests/fixtures/generic/keyvalue.txt | 5 +++++ tests/test_ini.py | 24 ++++++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 tests/fixtures/generic/keyvalue-ifcfg.json create mode 100644 tests/fixtures/generic/keyvalue-ifcfg.txt create mode 100644 tests/fixtures/generic/keyvalue.json create mode 100644 tests/fixtures/generic/keyvalue.txt diff --git a/tests/fixtures/generic/keyvalue-ifcfg.json b/tests/fixtures/generic/keyvalue-ifcfg.json new file mode 100644 index 00000000..3d399e7e --- /dev/null +++ b/tests/fixtures/generic/keyvalue-ifcfg.json @@ -0,0 +1 @@ +{"type": "Ethernet", "proxy_method": "none", "browser_only": "no", "bootproto": "dhcp", "defroute": "yes", "ipv4_failure_fatal": "no", "ipv6init": "yes", "ipv6_autoconf": "yes", "ipv6_defroute": "yes", "ipv6_failure_fatal": "no", "ipv6_addr_gen_mode": "stable-privacy", "name": "ens33", "uuid": "d92ece08-9e02-47d5-b2d2-92c80e155744", "device": "ens33", "onboot": "yes", "value_with_spaces": "this value includes spaces", "value_with_quotes_inside": "this value \"has quotation marks\" inside", "value_with_quotes_inside2": "\"this value\" has quotations at the beginning but not the end", "value_with_quotes_inside3": "this value has quotation marks \"at the end\""} diff --git a/tests/fixtures/generic/keyvalue-ifcfg.txt b/tests/fixtures/generic/keyvalue-ifcfg.txt new file mode 100644 index 00000000..8c3ae1e7 --- /dev/null +++ b/tests/fixtures/generic/keyvalue-ifcfg.txt @@ -0,0 +1,19 @@ +TYPE="Ethernet" +PROXY_METHOD="none" +BROWSER_ONLY="no" +BOOTPROTO="dhcp" +DEFROUTE="yes" +IPV4_FAILURE_FATAL="no" +IPV6INIT="yes" +IPV6_AUTOCONF="yes" +IPV6_DEFROUTE="yes" +IPV6_FAILURE_FATAL="no" +IPV6_ADDR_GEN_MODE="stable-privacy" +NAME="ens33" +UUID="d92ece08-9e02-47d5-b2d2-92c80e155744" +DEVICE="ens33" +ONBOOT="yes" +value_with_spaces: this value includes spaces +value_with_quotes_inside = this value "has quotation marks" inside +value_with_quotes_inside2 = "this value" has quotations at the beginning but not the end +value_with_quotes_inside3 : this value has quotation marks "at the end" diff --git a/tests/fixtures/generic/keyvalue.json b/tests/fixtures/generic/keyvalue.json new file mode 100644 index 00000000..5599f17c --- /dev/null +++ b/tests/fixtures/generic/keyvalue.json @@ -0,0 +1 @@ +{"value1": "hello", "value2": "true", "no_value": "", "value4": "3.14", "value5": "42"} diff --git a/tests/fixtures/generic/keyvalue.txt b/tests/fixtures/generic/keyvalue.txt new file mode 100644 index 00000000..666b913d --- /dev/null +++ b/tests/fixtures/generic/keyvalue.txt @@ -0,0 +1,5 @@ +value1 = hello +value2 = true +no_value +value4 = 3.14 +value5: 42 diff --git a/tests/test_ini.py b/tests/test_ini.py index 977886e1..c3f83714 100644 --- a/tests/test_ini.py +++ b/tests/test_ini.py @@ -16,6 +16,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/ini-iptelserver.ini'), 'r', encoding='utf-8') as f: self.generic_ini_iptelserver = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/keyvalue.txt'), 'r', encoding='utf-8') as f: + self.generic_ini_keyvalue = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/keyvalue-ifcfg.txt'), 'r', encoding='utf-8') as f: + self.generic_ini_keyvalue_ifcfg = f.read() + # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/ini-test.json'), 'r', encoding='utf-8') as f: self.generic_ini_test_json = json.loads(f.read()) @@ -23,6 +29,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/ini-iptelserver.json'), 'r', encoding='utf-8') as f: self.generic_ini_iptelserver_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/keyvalue.json'), 'r', encoding='utf-8') as f: + self.generic_ini_keyvalue_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/keyvalue-ifcfg.json'), 'r', encoding='utf-8') as f: + self.generic_ini_keyvalue_ifcfg_json = json.loads(f.read()) + def test_ini_nodata(self): """ Test the test ini file with no data @@ -41,6 +53,18 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.ini.parse(self.generic_ini_iptelserver, quiet=True), self.generic_ini_iptelserver_json) + def test_ini_keyvalue(self): + """ + Test a file that only includes key/value lines + """ + self.assertEqual(jc.parsers.ini.parse(self.generic_ini_keyvalue, quiet=True), self.generic_ini_keyvalue_json) + + def test_ini_keyvalue_ifcfg(self): + """ + Test a sample ifcfg key/value file that has quotation marks in the values + """ + self.assertEqual(jc.parsers.ini.parse(self.generic_ini_keyvalue_ifcfg, quiet=True), self.generic_ini_keyvalue_ifcfg_json) + if __name__ == '__main__': unittest.main() From 125dc2d9e051a82a4a438afe2e520212338353f5 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:17:16 -0700 Subject: [PATCH 49/80] add info about key/value files to doc --- docs/parsers/ini.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/parsers/ini.md b/docs/parsers/ini.md index 41ecc5bc..93e6091b 100644 --- a/docs/parsers/ini.md +++ b/docs/parsers/ini.md @@ -3,7 +3,9 @@ jc - JSON CLI output utility INI Parser Usage: - specify --ini as the first argument if the piped input is coming from an INI file + Specify --ini as the first argument if the piped input is coming from an INI file or any + simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. + Comment prefix can be '#' or ';'. Comments must be on their own line. Compatibility: @@ -64,8 +66,11 @@ Returns: Dictionary representing an ini document: { - ini document converted to a dictionary - see configparser standard library documentation for more details + ini or key/value document converted to a dictionary - see configparser standard + library documentation for more details. + + Note: Values starting and ending with quotation marks will have the marks removed. + If you would like to keep the quotation markes, use the -r or raw=True argument. } ## parse From c39b1a3356881a11a8f6fe9432897e6d67162f07 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:17:51 -0700 Subject: [PATCH 50/80] add ping, traceroute and update ini description --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e73bac4..d18c093b 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--hosts` enables the `/etc/hosts` file parser - `--id` enables the `id` command parser - `--ifconfig` enables the `ifconfig` command parser -- `--ini` enables the `INI` file parser +- `--ini` enables the `INI` file parser. Also parses files/output containing simple key/value pairs - `--iptables` enables the `iptables` command parser - `--jobs` enables the `jobs` command parser - `--last` enables the `last` and `lastb` command parser @@ -145,6 +145,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--netstat` enables the `netstat` command parser - `--ntpq` enables the `ntpq -p` command parser - `--passwd` enables the `/etc/passwd` file parser +- `--ping` enables the `ping` and `ping6` command parser - `--pip-list` enables the `pip list` command parser - `--pip-show` enables the `pip show` command parser - `--ps` enables the `ps` command parser @@ -158,6 +159,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--systemctl-ls` enables the `systemctl list-sockets` command parser - `--systemctl-luf` enables the `systemctl list-unit-files` command parser - `--timedatectl` enables the `timedatectl status` command parser +- `--traceroute` enables the `traceroute` and `traceroute6` command parser - `--uname` enables the `uname -a` command parser - `--uptime` enables the `uptime` command parser - `--w` enables the `w` command parser From c73c2ff879b3ed7a3e6f04e53e0a729e4f00ed21 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:23:30 -0700 Subject: [PATCH 51/80] add ping, traceroute, and ini update --- changelog.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 0a456799..1411c121 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,16 @@ jc changelog +20200724 v1.13.0 +- Add ping and ping6 command parser tested on linux, macos, and freebsd +- Add traceroute and traceroute6 command parser tested on linux, macos, and freebsd +- Update ini parser to support files only containing key/value pairs + + 20200711 v1.12.1 - Fix tests when using older version of pygments library 20200710 v1.12.0 -- Add sysctl command parser tested on linux, macOS, and freebsd12 +- Add sysctl command parser tested on linux, macOS, and freebsd - Update the cli code to allow older versions of the pygments library (2.3.0) for debian packaging - Code cleanup on the cli - Add tests for the cli From bcae0a99cd0ccce4ec8a67929f7c83a1095a5b88 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:23:45 -0700 Subject: [PATCH 52/80] add key/value to ini description --- man/jc.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/jc.1 b/man/jc.1 index a1386bd3..fb5efb99 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -101,7 +101,7 @@ ifconfig command parser .TP .B \fB--ini\fP -INI file parser +INI file parser. Also parses files/output containing simple key/value pairs .TP .B \fB--iptables\fP From ac10e576c167d20de259e47a6aa5b23fc998b4c3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:29:27 -0700 Subject: [PATCH 53/80] spelling --- docs/parsers/ini.md | 4 ++-- jc/parsers/ini.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/parsers/ini.md b/docs/parsers/ini.md index 93e6091b..4067caca 100644 --- a/docs/parsers/ini.md +++ b/docs/parsers/ini.md @@ -63,14 +63,14 @@ Parameters: Returns: - Dictionary representing an ini document: + Dictionary representing an ini or simple key/value pair document: { ini or key/value document converted to a dictionary - see configparser standard library documentation for more details. Note: Values starting and ending with quotation marks will have the marks removed. - If you would like to keep the quotation markes, use the -r or raw=True argument. + If you would like to keep the quotation marks, use the -r or raw=True argument. } ## parse diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index 86f8237d..a24be21c 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -72,14 +72,14 @@ def process(proc_data): Returns: - Dictionary representing an ini document: + Dictionary representing an ini or simple key/value pair document: { ini or key/value document converted to a dictionary - see configparser standard library documentation for more details. Note: Values starting and ending with quotation marks will have the marks removed. - If you would like to keep the quotation markes, use the -r or raw=True argument. + If you would like to keep the quotation marks, use the -r or raw=True argument. } """ # remove quotation marks from beginning and end of values From e774f67924c0e6195f79829b2ac75ce95f76fbaa Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Jul 2020 16:53:17 -0700 Subject: [PATCH 54/80] turn off interpolation and coerce None to '' --- jc/parsers/ini.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index a24be21c..0ff13746 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -87,13 +87,17 @@ def process(proc_data): # standard ini files with headers if isinstance(proc_data[heading], dict): for key, value in proc_data[heading].items(): - if value.startswith('"') and value.endswith('"'): + if value is not None and value.startswith('"') and value.endswith('"'): proc_data[heading][key] = value.lstrip('"').rstrip('"') + elif value is None: + proc_data[heading][key] = '' # simple key/value files with no headers else: - if proc_data[heading].startswith('"') and proc_data[heading].endswith('"'): + if proc_data[heading] is not None and proc_data[heading].startswith('"') and proc_data[heading].endswith('"'): proc_data[heading] = proc_data[heading].lstrip('"').rstrip('"') + elif proc_data[heading] is None: + proc_data[heading] = '' return proc_data @@ -119,7 +123,7 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): - ini = configparser.ConfigParser(allow_no_value=True) + ini = configparser.ConfigParser(allow_no_value=True, interpolation=None) try: ini.read_string(data) raw_output = {s: dict(ini.items(s)) for s in ini.sections()} From 57f66e6b1d554ff20b72959f5ebb9e7b2feffed2 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 09:19:48 -0700 Subject: [PATCH 55/80] add exception with hint to use "uname -a" --- changelog.txt | 2 +- jc/parsers/uname.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1411c121..6e76ded2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,7 +4,7 @@ jc changelog - Add ping and ping6 command parser tested on linux, macos, and freebsd - Add traceroute and traceroute6 command parser tested on linux, macos, and freebsd - Update ini parser to support files only containing key/value pairs - +- Update uname parser exception with a hint to use "uname -a" 20200711 v1.12.1 - Fix tests when using older version of pygments library diff --git a/jc/parsers/uname.py b/jc/parsers/uname.py index fe69ffd4..96014671 100644 --- a/jc/parsers/uname.py +++ b/jc/parsers/uname.py @@ -30,7 +30,7 @@ import jc.utils class info(): - version = '1.3' + version = '1.4' description = 'uname -a command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -43,6 +43,10 @@ class info(): __version__ = info.version +class ParseError(Exception): + pass + + def process(proc_data): """ Final processing to conform to the schema. @@ -94,6 +98,10 @@ def parse(data, raw=False, quiet=False): # check for OSX output if data.startswith('Darwin'): parsed_line = data.split() + + if len(parsed_line) < 5: + raise ParseError('Could not parse uname output. Make sure to use "uname -a".') + raw_output['machine'] = parsed_line.pop(-1) raw_output['kernel_name'] = parsed_line.pop(0) raw_output['node_name'] = parsed_line.pop(0) @@ -103,6 +111,10 @@ def parse(data, raw=False, quiet=False): # otherwise use linux parser else: parsed_line = data.split(maxsplit=3) + + if len(parsed_line) < 3: + raise ParseError('Could not parse uname output. Make sure to use "uname -a".') + raw_output['kernel_name'] = parsed_line.pop(0) raw_output['node_name'] = parsed_line.pop(0) raw_output['kernel_release'] = parsed_line.pop(0) From ca470a5d02fd9fbaf05d8b3b3bb1ffe9f4cf5af3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 09:20:00 -0700 Subject: [PATCH 56/80] add tracepath fixtures --- tests/fixtures/centos-7.7/tracepath.out | 34 ++++++++++++++++++++++++ tests/fixtures/centos-7.7/tracepath6.out | 5 ++++ 2 files changed, 39 insertions(+) create mode 100644 tests/fixtures/centos-7.7/tracepath.out create mode 100644 tests/fixtures/centos-7.7/tracepath6.out diff --git a/tests/fixtures/centos-7.7/tracepath.out b/tests/fixtures/centos-7.7/tracepath.out new file mode 100644 index 00000000..3491f7c3 --- /dev/null +++ b/tests/fixtures/centos-7.7/tracepath.out @@ -0,0 +1,34 @@ + 1?: [LOCALHOST] pmtu 1500 + 1: dsldevice.attlocal.net 4.063ms + 1: dsldevice.attlocal.net 6.368ms + 2: 76-220-24-1.lightspeed.sntcca.sbcglobal.net 24.092ms + 3: no reply + 4: 12.242.117.16 161.527ms + 5: no reply + 6: no reply + 3: 71.148.149.0 12000.559ms + 3: 71.148.149.0 11967.523ms + 3: 71.148.149.0 11829.634ms +10: no reply +11: no reply +12: no reply +13: no reply +14: no reply +15: no reply +16: no reply +17: no reply +18: no reply +19: no reply +20: no reply +21: no reply +22: no reply +23: no reply +24: no reply +25: no reply +26: no reply +27: no reply +28: no reply +29: no reply +30: no reply + Too many hops: pmtu 1500 + Resume: pmtu 1500 diff --git a/tests/fixtures/centos-7.7/tracepath6.out b/tests/fixtures/centos-7.7/tracepath6.out new file mode 100644 index 00000000..b3c22873 --- /dev/null +++ b/tests/fixtures/centos-7.7/tracepath6.out @@ -0,0 +1,5 @@ + 1?: [LOCALHOST] pmtu 1500 + 1: dust.inr.ac.ru 0.411ms + 2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480 + 2: 3ffe:2400:0:109::2 463.514ms reached + Resume: pmtu 1480 hops 2 back 2 From 360106c24d24e6a9697c00a158a14aaa334a4b1f Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 09:23:01 -0700 Subject: [PATCH 57/80] add tracepath --- changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 6e76ded2..41a45f2e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,9 @@ jc changelog -20200724 v1.13.0 +202007xx v1.13.0 - Add ping and ping6 command parser tested on linux, macos, and freebsd - Add traceroute and traceroute6 command parser tested on linux, macos, and freebsd +- Add tracepath command parser tested on linux - Update ini parser to support files only containing key/value pairs - Update uname parser exception with a hint to use "uname -a" From 38d10c97814ec69586c3b447c182f339772d6e22 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 09:29:30 -0700 Subject: [PATCH 58/80] add ping and traceroute examples --- README.md | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d18c093b..20bfa6cd 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--systemctl-ls` enables the `systemctl list-sockets` command parser - `--systemctl-luf` enables the `systemctl list-unit-files` command parser - `--timedatectl` enables the `timedatectl status` command parser +- `--tracepath` enables the `tracepath` and `tracepath6` command parser - `--traceroute` enables the `traceroute` and `traceroute6` command parser - `--uname` enables the `uname -a` command parser - `--uptime` enables the `uptime` command parser @@ -1912,6 +1913,59 @@ cat /etc/passwd | jc --passwd -p } ] ``` +### ping +```bash +ping 8.8.8.8 -c 3 | jc --ping -p # or: jc -p ping 8.8.8.8 -c 3 +``` +```json +{ + "destination_ip": "8.8.8.8", + "data_bytes": 56, + "pattern": null, + "destination": "8.8.8.8", + "packets_transmitted": 3, + "packets_received": 3, + "packet_loss_percent": 0.0, + "duplicates": 0, + "time_ms": 2005.0, + "round_trip_ms_min": 23.835, + "round_trip_ms_avg": 30.46, + "round_trip_ms_max": 34.838, + "round_trip_ms_stddev": 4.766, + "responses": [ + { + "type": "reply", + "timestamp": null, + "bytes": 64, + "response_ip": "8.8.8.8", + "icmp_seq": 1, + "ttl": 118, + "time_ms": 23.8, + "duplicate": false + }, + { + "type": "reply", + "timestamp": null, + "bytes": 64, + "response_ip": "8.8.8.8", + "icmp_seq": 2, + "ttl": 118, + "time_ms": 34.8, + "duplicate": false + }, + { + "type": "reply", + "timestamp": null, + "bytes": 64, + "response_ip": "8.8.8.8", + "icmp_seq": 3, + "ttl": 118, + "time_ms": 32.7, + "duplicate": false + } + ] +} +``` ### pip list ```bash pip list | jc --pip-list -p # or: jc -p pip list # or: jc -p pip3 list @@ -1931,7 +1985,6 @@ pip list | jc --pip-list -p # or: jc -p pip list # or: jc -p "version": "0.24.0" } ] - ``` ### pip show ```bash @@ -2424,6 +2477,82 @@ timedatectl | jc --timedatectl -p # or: jc -p timedatectl "dst_active": true } ``` +### traceroute +```bash +traceroute -m 3 8.8.8.8 | jc --traceroute -p # or: jc -p traceroute -m 3 8.8.8.8 +``` +```json +{ + "destination_ip": "8.8.8.8", + "destination_name": "8.8.8.8", + "hops": [ + { + "hop": 1, + "probes": [ + { + "annotation": null, + "asn": null, + "ip": "192.168.1.254", + "name": "dsldevice.local.net", + "rtt": 6.616 + }, + { + "annotation": null, + "asn": null, + "ip": "192.168.1.254", + "name": "dsldevice.local.net", + "rtt": 6.413 + }, + { + "annotation": null, + "asn": null, + "ip": "192.168.1.254", + "name": "dsldevice.local.net", + "rtt": 6.308 + } + ] + }, + { + "hop": 2, + "probes": [ + { + "annotation": null, + "asn": null, + "ip": "76.220.24.1", + "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", + "rtt": 29.367 + }, + { + "annotation": null, + "asn": null, + "ip": "76.220.24.1", + "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", + "rtt": 40.197 + }, + { + "annotation": null, + "asn": null, + "ip": "76.220.24.1", + "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", + "rtt": 29.162 + } + ] + }, + { + "hop": 3, + "probes": [ + { + "annotation": null, + "asn": null, + "ip": null, + "name": null, + "rtt": null + } + ] + } + ] +} +``` ### uname -a ```bash uname -a | jc --uname -p # or: jc -p uname -a From ebd8ee49a9f43063850e30c745c8cae46ee13de1 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 10:28:15 -0700 Subject: [PATCH 59/80] add key/value info to ini example --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20bfa6cd..7d785751 100644 --- a/README.md +++ b/README.md @@ -1242,7 +1242,7 @@ ifconfig | jc --ifconfig -p # or: jc -p ifconfig } ] ``` -### INI files +### INI and plain key/value pair files ```bash cat example.ini ``` @@ -1281,6 +1281,31 @@ cat example.ini | jc --ini -p } } ``` +```bash +cat keyvalue.txt +``` +``` +# this file contains key/value pairs +name = John Doe +address=555 California Drive +age: 34 +; comments can include # or ; +# delimiter can be = or : +# quoted values have quotation marks stripped by default +# but can be preserved with the -r argument +occupation:"Engineer" +``` +```bash +cat keyvalue.txt | jc --ini -p +``` +```json +{ + "name": "John Doe", + "address": "555 California Drive", + "age": "34", + "occupation": "Engineer" +} +``` ### iptables ```bash iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p iptables --line-numbers -v -L -t nat From 0314ca8c4831d24c169a0e4948421ecd638fd699 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 10:33:15 -0700 Subject: [PATCH 60/80] add trparse acknowledgement --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7d785751..0ab59318 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ Feel free to add/improve code or parsers! You can use the [`jc/parsers/foo.py`]( - [`ifconfig-parser`](https://github.com/KnightWhoSayNi/ifconfig-parser) module by KnightWhoSayNi - [`xmltodict`](https://github.com/martinblech/xmltodict) module by Martín Blech - [`ruamel.yaml`](https://pypi.org/project/ruamel.yaml) module by Anthon van der Neut +- [`trparse`](https://github.com/lbenitez000/trparse) module by Luis Benitez - Parsing [code](https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501) from Conor Heine adapted for some parsers - Excellent constructive feedback from [Ilya Sher](https://github.com/ilyash-b) From ce24149335cd8ed1e8513a2cf040432fe42d86b7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 10:33:25 -0700 Subject: [PATCH 61/80] formatting --- jc/parsers/ping.py | 1 - 1 file changed, 1 deletion(-) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 882da1f3..11a02279 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -112,7 +112,6 @@ class info(): description = 'ping command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' - # details = 'enter any other details here' # compatible options: linux, darwin, cygwin, win32, aix, freebsd compatible = ['linux', 'darwin', 'freebsd'] From c3c5ed11e68938e35920144406d37ea3b21d63dd Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 10:33:40 -0700 Subject: [PATCH 62/80] change name from tr to trparse --- jc/parsers/traceroute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 4c2adb44..cad5804f 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -93,7 +93,7 @@ class info(): description = 'traceroute command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' - details = 'Using the tr library by Luis Benitez at https://github.com/lbenitez000/trparse' + details = 'Using the trparse library by Luis Benitez at https://github.com/lbenitez000/trparse' # compatible options: linux, darwin, cygwin, win32, aix, freebsd compatible = ['linux', 'darwin', 'freebsd'] From a65e27540a8c5c7123d2fdf79fcbefa1e2f8afdc Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 11:01:45 -0700 Subject: [PATCH 63/80] update docs --- docgen.sh | 1 + docs/parsers/traceroute.md | 14 -------------- jc/parsers/traceroute.py | 10 ---------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/docgen.sh b/docgen.sh index 498893d9..27f78227 100755 --- a/docgen.sh +++ b/docgen.sh @@ -51,6 +51,7 @@ pydocmd simple jc.parsers.systemctl_lj+ > ../docs/parsers/systemctl_lj.md pydocmd simple jc.parsers.systemctl_ls+ > ../docs/parsers/systemctl_ls.md pydocmd simple jc.parsers.systemctl_luf+ > ../docs/parsers/systemctl_luf.md pydocmd simple jc.parsers.timedatectl+ > ../docs/parsers/timedatectl.md +pydocmd simple jc.parsers.tracepath+ > ../docs/parsers/tracepath.md pydocmd simple jc.parsers.traceroute+ > ../docs/parsers/traceroute.md pydocmd simple jc.parsers.uname+ > ../docs/parsers/uname.md pydocmd simple jc.parsers.uptime+ > ../docs/parsers/uptime.md diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md index 4370a7e8..3975cce8 100644 --- a/docs/parsers/traceroute.md +++ b/docs/parsers/traceroute.md @@ -101,20 +101,6 @@ Abstraction of a traceroute result. Hop(self, idx) ``` -Abstraction of a hop in a traceroute. - -## Probe -```python -Probe(self, name=None, ip=None, asn=None, rtt=None, annotation=None) -``` - -Abstraction of a probe in a traceroute. - -## loads -```python -loads(data) -``` -Parser entry point. Parses the output of a traceroute execution ## process ```python process(proc_data) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index cad5804f..bd6e091d 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -160,10 +160,6 @@ class Traceroute(object): class Hop(object): - """ - Abstraction of a hop in a traceroute. - """ - def __init__(self, idx): self.idx = idx # Hop count, starting at 1 (usually) self.probes = [] # Series of Probe instances @@ -191,10 +187,6 @@ class Hop(object): class Probe(object): - """ - Abstraction of a probe in a traceroute. - """ - def __init__(self, name=None, ip=None, asn=None, rtt=None, annotation=None): self.name = name self.ip = ip @@ -217,8 +209,6 @@ class Probe(object): def loads(data): - """Parser entry point. Parses the output of a traceroute execution""" - lines = data.splitlines() # Get headers From a8560dbc1598fa97de87594228b4cc10282d4197 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 11:01:57 -0700 Subject: [PATCH 64/80] add tracepath --- jc/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jc/cli.py b/jc/cli.py index bc0af389..a68ddeb1 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -77,6 +77,7 @@ parsers = [ 'systemctl-ls', 'systemctl-luf', 'timedatectl', + 'tracepath', 'traceroute', 'uname', 'uptime', From 842ea3a94bec3fcab76257fdde5514d1de3d57fa Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 11:02:13 -0700 Subject: [PATCH 65/80] add tracepath parser skeleton --- docs/parsers/tracepath.md | 64 ++++++++++++++++++++++++++++ jc/parsers/tracepath.py | 89 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 docs/parsers/tracepath.md create mode 100644 jc/parsers/tracepath.py diff --git a/docs/parsers/tracepath.md b/docs/parsers/tracepath.md new file mode 100644 index 00000000..955eb26a --- /dev/null +++ b/docs/parsers/tracepath.md @@ -0,0 +1,64 @@ +# jc.parsers.tracepath +jc - JSON CLI output utility tracepath Parser + +Usage: + + specify --tracepath as the first argument if the piped input is coming from tracepath + +Compatibility: + + 'linux' + +Examples: + + $ tracepath | jc --tracepath -p + [] + + $ tracepath | jc --tracepath -p -r + [] + +## info +```python +info(self, /, *args, **kwargs) +``` + +## process +```python +process(proc_data) +``` + +Final processing to conform to the schema. + +Parameters: + + proc_data: (dictionary) raw structured data to process + +Returns: + + List of dictionaries. Structured data with the following schema: + + [ + { + "tracepath": string, + "bar": boolean, + "baz": integer + } + ] + +## parse +```python +parse(data, raw=False, quiet=False) +``` + +Main text parsing function + +Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + +Returns: + + List of dictionaries. Raw or processed structured data. + diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py new file mode 100644 index 00000000..6c08d363 --- /dev/null +++ b/jc/parsers/tracepath.py @@ -0,0 +1,89 @@ +"""jc - JSON CLI output utility tracepath Parser + +Usage: + + specify --tracepath as the first argument if the piped input is coming from tracepath + +Compatibility: + + 'linux' + +Examples: + + $ tracepath | jc --tracepath -p + [] + + $ tracepath | jc --tracepath -p -r + [] +""" +import jc.utils + + +class info(): + version = '1.0' + description = 'tracepath command parser' + author = 'John Doe' + author_email = 'johndoe@gmail.com' + + # compatible options: linux, darwin, cygwin, win32, aix, freebsd + compatible = ['linux'] + magic_commands = ['tracepath', 'tracepath6'] + + +__version__ = info.version + + +def process(proc_data): + """ + Final processing to conform to the schema. + + Parameters: + + proc_data: (dictionary) raw structured data to process + + Returns: + + List of dictionaries. Structured data with the following schema: + + [ + { + "tracepath": string, + "bar": boolean, + "baz": integer + } + ] + """ + + # rebuild output for added semantic information + return proc_data + + +def parse(data, raw=False, quiet=False): + """ + Main text parsing function + + Parameters: + + data: (string) text data to parse + raw: (boolean) output preprocessed JSON if True + quiet: (boolean) suppress warning messages if True + + Returns: + + List of dictionaries. Raw or processed structured data. + """ + if not quiet: + jc.utils.compatibility(__name__, info.compatible) + + raw_output = [] + + if jc.utils.has_data(data): + + for line in filter(None, data.splitlines()): + # parse the content + pass + + if raw: + return raw_output + else: + return process(raw_output) From 12912521ecb376c36dfdd743b3c4195598fb9aac Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 11:04:27 -0700 Subject: [PATCH 66/80] doc update --- docs/parsers/traceroute.md | 7 ------- jc/parsers/traceroute.py | 4 ---- 2 files changed, 11 deletions(-) diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md index 3975cce8..4c6a2f5b 100644 --- a/docs/parsers/traceroute.md +++ b/docs/parsers/traceroute.md @@ -89,13 +89,6 @@ Examples: info(self, /, *args, **kwargs) ``` -## Traceroute -```python -Traceroute(self, dest_name, dest_ip) -``` - -Abstraction of a traceroute result. - ## Hop ```python Hop(self, idx) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index bd6e091d..9fd4646c 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -140,10 +140,6 @@ RE_PROBE_RTT_ANNOTATION = re.compile(r'(\d+\.?\d+)?\s+ms|(\s+\*\s+)\s*(!\S*)?') class Traceroute(object): - """ - Abstraction of a traceroute result. - """ - def __init__(self, dest_name, dest_ip): self.dest_name = dest_name self.dest_ip = dest_ip From 1e5d602caecd96c9056ad77f9fc50cf25bf6fdfd Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 13:48:46 -0700 Subject: [PATCH 67/80] working tracepath parser --- docs/parsers/tracepath.md | 120 ++++++++++++++++++++--- jc/parsers/tracepath.py | 196 ++++++++++++++++++++++++++++++++++---- 2 files changed, 286 insertions(+), 30 deletions(-) diff --git a/docs/parsers/tracepath.md b/docs/parsers/tracepath.md index 955eb26a..16bffe7d 100644 --- a/docs/parsers/tracepath.md +++ b/docs/parsers/tracepath.md @@ -11,11 +11,96 @@ Compatibility: Examples: - $ tracepath | jc --tracepath -p - [] + $ tracepath6 3ffe:2400:0:109::2 | jc --tracepath -p + { + "pmtu": 1480, + "forward_hops": 2, + "return_hops": 2, + "hops": [ + { + "ttl": 1, + "guess": true, + "host": "[LOCALHOST]", + "reply_ms": null, + "pmtu": 1500, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 1, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.411, + "pmtu": null, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.39, + "pmtu": 1480, + "asymmetric_difference": 1, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "3ffe:2400:0:109::2", + "reply_ms": 463.514, + "pmtu": null, + "asymmetric_difference": null, + "reached": true + } + ] + } + + $ tracepath6 3ffe:2400:0:109::2 | jc --tracepath -p -r + { + "pmtu": "1480", + "forward_hops": "2", + "return_hops": "2", + "hops": [ + { + "ttl": "1", + "guess": true, + "host": "[LOCALHOST]", + "reply_ms": null, + "pmtu": "1500", + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": "1", + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": "0.411", + "pmtu": null, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": "2", + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": "0.390", + "pmtu": "1480", + "asymmetric_difference": "1", + "reached": false + }, + { + "ttl": "2", + "guess": false, + "host": "3ffe:2400:0:109::2", + "reply_ms": "463.514", + "pmtu": null, + "asymmetric_difference": null, + "reached": true + } + ] + } - $ tracepath | jc --tracepath -p -r - [] ## info ```python @@ -35,15 +120,24 @@ Parameters: Returns: - List of dictionaries. Structured data with the following schema: + Dictionary. Structured data with the following schema: - [ - { - "tracepath": string, - "bar": boolean, - "baz": integer - } - ] + { + "pmtu": integer, + "forward_hops": integer, + "return_hops": integer, + "hops": [ + { + "ttl": integer, + "guess": boolean, + "host": string, + "reply_ms": float, + "pmtu": integer, + "asymmetric_difference": integer, + "reached": boolean + } + ] + } ## parse ```python @@ -60,5 +154,5 @@ Parameters: Returns: - List of dictionaries. Raw or processed structured data. + Dictionary. Raw or processed structured data. diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py index 6c08d363..f590033a 100644 --- a/jc/parsers/tracepath.py +++ b/jc/parsers/tracepath.py @@ -10,12 +10,98 @@ Compatibility: Examples: - $ tracepath | jc --tracepath -p - [] + $ tracepath6 3ffe:2400:0:109::2 | jc --tracepath -p + { + "pmtu": 1480, + "forward_hops": 2, + "return_hops": 2, + "hops": [ + { + "ttl": 1, + "guess": true, + "host": "[LOCALHOST]", + "reply_ms": null, + "pmtu": 1500, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 1, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.411, + "pmtu": null, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.39, + "pmtu": 1480, + "asymmetric_difference": 1, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "3ffe:2400:0:109::2", + "reply_ms": 463.514, + "pmtu": null, + "asymmetric_difference": null, + "reached": true + } + ] + } + + $ tracepath6 3ffe:2400:0:109::2 | jc --tracepath -p -r + { + "pmtu": "1480", + "forward_hops": "2", + "return_hops": "2", + "hops": [ + { + "ttl": "1", + "guess": true, + "host": "[LOCALHOST]", + "reply_ms": null, + "pmtu": "1500", + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": "1", + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": "0.411", + "pmtu": null, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": "2", + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": "0.390", + "pmtu": "1480", + "asymmetric_difference": "1", + "reached": false + }, + { + "ttl": "2", + "guess": false, + "host": "3ffe:2400:0:109::2", + "reply_ms": "463.514", + "pmtu": null, + "asymmetric_difference": null, + "reached": true + } + ] + } - $ tracepath | jc --tracepath -p -r - [] """ +import re import jc.utils @@ -43,18 +129,59 @@ def process(proc_data): Returns: - List of dictionaries. Structured data with the following schema: + Dictionary. Structured data with the following schema: - [ - { - "tracepath": string, - "bar": boolean, - "baz": integer - } - ] + { + "pmtu": integer, + "forward_hops": integer, + "return_hops": integer, + "hops": [ + { + "ttl": integer, + "guess": boolean, + "host": string, + "reply_ms": float, + "pmtu": integer, + "asymmetric_difference": integer, + "reached": boolean + } + ] + } """ + int_list = ['pmtu', 'forward_hops', 'return_hops', 'ttl', 'asymmetric_difference'] + float_list = ['reply_ms'] + + for key, value in proc_data.items(): + for item in int_list: + if key in int_list: + try: + proc_data[key] = int(proc_data[key]) + except (ValueError, TypeError): + proc_data[key] = None + + for item in int_list: + if key in float_list: + try: + proc_data[key] = float(proc_data[key]) + except (ValueError, TypeError): + proc_data[key] = None + + if 'hops' in proc_data: + for entry in proc_data['hops']: + for key in int_list: + if key in entry: + try: + entry[key] = int(entry[key]) + except (ValueError, TypeError): + entry[key] = None + + for key in float_list: + if key in entry: + try: + entry[key] = float(entry[key]) + except (ValueError, TypeError): + entry[key] = None - # rebuild output for added semantic information return proc_data @@ -70,18 +197,53 @@ def parse(data, raw=False, quiet=False): Returns: - List of dictionaries. Raw or processed structured data. + Dictionary. Raw or processed structured data. """ if not quiet: jc.utils.compatibility(__name__, info.compatible) - raw_output = [] + RE_TTL_HOST = re.compile(r'^\s?(?P\d+)(?P\??):\s+(?P(?:no reply|\S+))') # groups: ttl, ttl_guess, host + RE_PMTU = re.compile(r'\spmtu\s(?P[\d]+)') # group: pmtu + RE_REPLY_MS = re.compile(r'\s(?P\d*\.\d*)ms') # group: reply_ms + RE_ASYMM = re.compile(r'\sasymm\s+(?P[\d]+)') # group: asymm + RE_REACHED = re.compile(r'\sreached') + RE_SUMMARY = re.compile(r'\s+Resume:\s+pmtu\s+(?P\d+)(?:\s+hops\s+(?P\d+))?(?:\s+back\s+(?P\d+))?') # groups: pmtu, hops, back + + raw_output = {} if jc.utils.has_data(data): + hops = [] for line in filter(None, data.splitlines()): - # parse the content - pass + # grab hop information + ttl_host = re.search(RE_TTL_HOST, line) + pmtu = re.search(RE_PMTU, line) + reply_ms = re.search(RE_REPLY_MS, line) + asymm = re.search(RE_ASYMM, line) + reached = re.search(RE_REACHED, line) + summary = re.search(RE_SUMMARY, line) + + if ttl_host: + hop = { + 'ttl': ttl_host.group('ttl'), + 'guess': bool(ttl_host.group('ttl_guess')), + 'host': ttl_host.group('host') if ttl_host.group('host') != 'no reply' else None, + 'reply_ms': reply_ms.group('reply_ms') if reply_ms else None, + 'pmtu': pmtu.group('pmtu') if pmtu else None, + 'asymmetric_difference': asymm.group('asymm') if asymm else None, + 'reached': bool(reached) + } + + hops.append(hop) + continue + + elif summary: + raw_output = { + 'pmtu': summary.group('pmtu') if summary.group('pmtu') else None, + 'forward_hops': summary.group('hops') if summary.group('hops') else None, + 'return_hops': summary.group('back') if summary.group('back') else None, + 'hops': hops + } if raw: return raw_output From d18ff73e880c7d34957f2713857cc83094f914cc Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 13:51:51 -0700 Subject: [PATCH 68/80] update author info --- jc/parsers/tracepath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py index f590033a..f3ac5072 100644 --- a/jc/parsers/tracepath.py +++ b/jc/parsers/tracepath.py @@ -108,8 +108,8 @@ import jc.utils class info(): version = '1.0' description = 'tracepath command parser' - author = 'John Doe' - author_email = 'johndoe@gmail.com' + author = 'Kelly Brazil' + author_email = 'kellyjonbrazil@gmail.com' # compatible options: linux, darwin, cygwin, win32, aix, freebsd compatible = ['linux'] From f52f3163bcaf8d7e784f02505e81456e8240295b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 13:57:58 -0700 Subject: [PATCH 69/80] add tracepath example --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index 0ab59318..bbac0ff8 100644 --- a/README.md +++ b/README.md @@ -2503,6 +2503,55 @@ timedatectl | jc --timedatectl -p # or: jc -p timedatectl "dst_active": true } ``` +### tracepath +```bash +tracepath6 3ffe:2400:0:109::2 | jc --tracepath -p +``` +```json +{ + "pmtu": 1480, + "forward_hops": 2, + "return_hops": 2, + "hops": [ + { + "ttl": 1, + "guess": true, + "host": "[LOCALHOST]", + "reply_ms": null, + "pmtu": 1500, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 1, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.411, + "pmtu": null, + "asymmetric_difference": null, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "dust.inr.ac.ru", + "reply_ms": 0.39, + "pmtu": 1480, + "asymmetric_difference": 1, + "reached": false + }, + { + "ttl": 2, + "guess": false, + "host": "3ffe:2400:0:109::2", + "reply_ms": 463.514, + "pmtu": null, + "asymmetric_difference": null, + "reached": true + } + ] +} +``` ### traceroute ```bash traceroute -m 3 8.8.8.8 | jc --traceroute -p # or: jc -p traceroute -m 3 8.8.8.8 From 6086920332575cd7db1b38262a3b4ba8fbfae7ab Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:13:32 -0700 Subject: [PATCH 70/80] update ParseError message --- jc/parsers/traceroute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 9fd4646c..ed4c89c9 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -384,7 +384,7 @@ def parse(data, raw=False, quiet=False): # check if header row exists, otherwise raise exception if not data.splitlines()[0].startswith('traceroute to ') and not data.splitlines()[0].startswith('traceroute6 to '): - raise ParseError('Traceroute header line not found. Be sure to redirect STDERR to STDOUT on OSX/FreeBSD.') + raise ParseError('Traceroute header line not found. Be sure to redirect STDERR to STDOUT on some operating systems.') tr = loads(data) hops = tr.hops From f9dacc3f95b32e1431914ae0b0dc5c8e8840d5a7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:18:13 -0700 Subject: [PATCH 71/80] fixup for ipv6 --- jc/parsers/route.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index a8604a06..7777f4c0 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -182,6 +182,10 @@ def parse(data, raw=False, quiet=False): jc.utils.compatibility(__name__, info.compatible) cleandata = data.splitlines()[1:] + + # fixup header row for ipv6 + cleandata[0].replace('Next Hop', 'Next_Hop') + raw_output = [] if jc.utils.has_data(data): From e60457157839daba385202906997dec48c9c4950 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:20:51 -0700 Subject: [PATCH 72/80] fix next_hop fix --- jc/parsers/route.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index 7777f4c0..03f6ee36 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -184,7 +184,7 @@ def parse(data, raw=False, quiet=False): cleandata = data.splitlines()[1:] # fixup header row for ipv6 - cleandata[0].replace('Next Hop', 'Next_Hop') + cleandata[0] = cleandata[0].replace('Next Hop', 'Next_Hop') raw_output = [] From 5d5da8d33fa6ab77c745d338d1a2e2e8f2e4c697 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:27:11 -0700 Subject: [PATCH 73/80] more fixes for ipv6 fix --- jc/parsers/route.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index 03f6ee36..3c93546c 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -183,13 +183,13 @@ def parse(data, raw=False, quiet=False): cleandata = data.splitlines()[1:] - # fixup header row for ipv6 - cleandata[0] = cleandata[0].replace('Next Hop', 'Next_Hop') - raw_output = [] if jc.utils.has_data(data): + # fixup header row for ipv6 + cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ') + cleandata[0] = cleandata[0].lower() raw_output = jc.parsers.universal.simple_table_parse(cleandata) From b2c385dc4f63e3e15f47e986deac0524967214a0 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:30:09 -0700 Subject: [PATCH 74/80] change 'if' to 'iface' --- jc/parsers/route.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index 3c93546c..ff8f21dc 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -188,7 +188,7 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): # fixup header row for ipv6 - cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ') + cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ').replace(' If', ' Iface') cleandata[0] = cleandata[0].lower() raw_output = jc.parsers.universal.simple_table_parse(cleandata) From 7a4f30b843d8f11711abbb8f9bb263f945ff87ea Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:37:44 -0700 Subject: [PATCH 75/80] fix for iface issue --- jc/parsers/route.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index ff8f21dc..b14558b5 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -84,7 +84,7 @@ import jc.parsers.universal class info(): - version = '1.3' + version = '1.4' description = 'route command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -188,7 +188,9 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): # fixup header row for ipv6 - cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ').replace(' If', ' Iface') + if ' Next Hop ' in cleandata[0]: + cleandata[0] = cleandata[0].replace(' If', ' Iface') + cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ') cleandata[0] = cleandata[0].lower() raw_output = jc.parsers.universal.simple_table_parse(cleandata) From 5baa6cc865634142690e78596c640db35e110b29 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:44:13 -0700 Subject: [PATCH 76/80] add route parser update --- changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 41a45f2e..3a1d3f7a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,11 +1,12 @@ jc changelog -202007xx v1.13.0 +20200727 v1.13.0 - Add ping and ping6 command parser tested on linux, macos, and freebsd - Add traceroute and traceroute6 command parser tested on linux, macos, and freebsd - Add tracepath command parser tested on linux - Update ini parser to support files only containing key/value pairs - Update uname parser exception with a hint to use "uname -a" +- Update route parser to support IPv6 tables 20200711 v1.12.1 - Fix tests when using older version of pygments library From a5f97febd3066b9e95a18d6b73162a7d206c5845 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 16:47:41 -0700 Subject: [PATCH 77/80] update traceroute, tracepath, and uname tests --- tests/fixtures/centos-7.7/tracepath.json | 1 + tests/fixtures/centos-7.7/tracepath6.json | 1 + tests/fixtures/freebsd12/traceroute.json | 1 + tests/fixtures/freebsd12/traceroute.out | 14 +++++++ tests/fixtures/freebsd12/traceroute6.json | 1 + tests/fixtures/freebsd12/traceroute6.out | 34 +++++++++++++++++ tests/fixtures/osx-10.14.6/uname.out | 1 + tests/test_tracepath.py | 46 +++++++++++++++++++++++ tests/test_traceroute.py | 24 ++++++++++++ tests/test_uname.py | 9 +++++ 10 files changed, 132 insertions(+) create mode 100644 tests/fixtures/centos-7.7/tracepath.json create mode 100644 tests/fixtures/centos-7.7/tracepath6.json create mode 100644 tests/fixtures/freebsd12/traceroute.json create mode 100644 tests/fixtures/freebsd12/traceroute.out create mode 100644 tests/fixtures/freebsd12/traceroute6.json create mode 100644 tests/fixtures/freebsd12/traceroute6.out create mode 100644 tests/fixtures/osx-10.14.6/uname.out create mode 100644 tests/test_tracepath.py diff --git a/tests/fixtures/centos-7.7/tracepath.json b/tests/fixtures/centos-7.7/tracepath.json new file mode 100644 index 00000000..dd689345 --- /dev/null +++ b/tests/fixtures/centos-7.7/tracepath.json @@ -0,0 +1 @@ +{"pmtu": 1500, "forward_hops": null, "return_hops": null, "hops": [{"ttl": 1, "guess": true, "host": "[LOCALHOST]", "reply_ms": null, "pmtu": 1500, "asymmetric_difference": null, "reached": false}, {"ttl": 1, "guess": false, "host": "dsldevice.attlocal.net", "reply_ms": 4.063, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 1, "guess": false, "host": "dsldevice.attlocal.net", "reply_ms": 6.368, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 2, "guess": false, "host": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "reply_ms": 24.092, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 3, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 4, "guess": false, "host": "12.242.117.16", "reply_ms": 161.527, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 5, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 6, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 3, "guess": false, "host": "71.148.149.0", "reply_ms": 12000.559, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 3, "guess": false, "host": "71.148.149.0", "reply_ms": 11967.523, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 3, "guess": false, "host": "71.148.149.0", "reply_ms": 11829.634, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 10, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 11, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 12, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 13, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 14, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 15, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 16, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 17, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 18, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 19, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 20, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 21, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 22, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 23, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 24, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 25, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 26, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 27, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 28, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 29, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 30, "guess": false, "host": null, "reply_ms": null, "pmtu": null, "asymmetric_difference": null, "reached": false}]} diff --git a/tests/fixtures/centos-7.7/tracepath6.json b/tests/fixtures/centos-7.7/tracepath6.json new file mode 100644 index 00000000..71a463ae --- /dev/null +++ b/tests/fixtures/centos-7.7/tracepath6.json @@ -0,0 +1 @@ +{"pmtu": 1480, "forward_hops": 2, "return_hops": 2, "hops": [{"ttl": 1, "guess": true, "host": "[LOCALHOST]", "reply_ms": null, "pmtu": 1500, "asymmetric_difference": null, "reached": false}, {"ttl": 1, "guess": false, "host": "dust.inr.ac.ru", "reply_ms": 0.411, "pmtu": null, "asymmetric_difference": null, "reached": false}, {"ttl": 2, "guess": false, "host": "dust.inr.ac.ru", "reply_ms": 0.39, "pmtu": 1480, "asymmetric_difference": 1, "reached": false}, {"ttl": 2, "guess": false, "host": "3ffe:2400:0:109::2", "reply_ms": 463.514, "pmtu": null, "asymmetric_difference": null, "reached": true}]} diff --git a/tests/fixtures/freebsd12/traceroute.json b/tests/fixtures/freebsd12/traceroute.json new file mode 100644 index 00000000..f776d28d --- /dev/null +++ b/tests/fixtures/freebsd12/traceroute.json @@ -0,0 +1 @@ +{"destination_ip": "8.8.8.8", "destination_name": "8.8.8.8", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 3.263}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 4.146}, {"annotation": null, "asn": null, "ip": "192.168.1.254", "name": "dsldevice.attlocal.net", "rtt": 4.273}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 20.839}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 23.434}, {"annotation": null, "asn": null, "ip": "76.220.24.1", "name": "76-220-24-1.lightspeed.sntcca.sbcglobal.net", "rtt": 22.032}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 33.17}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 26.593}, {"annotation": null, "asn": null, "ip": "12.122.149.186", "name": "12.122.149.186", "rtt": 32.851}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 26.045}, {"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 29.235}, {"annotation": null, "asn": null, "ip": "12.122.3.70", "name": "sffca22crs.ip.att.net", "rtt": 28.28}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 25.3}, {"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 24.156}, {"annotation": null, "asn": null, "ip": "12.122.163.61", "name": "12.122.163.61", "rtt": 24.849}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "12.255.10.226", "name": "12.255.10.226", "rtt": 25.375}, {"annotation": null, "asn": null, "ip": "12.255.10.224", "name": "12.255.10.224", "rtt": 24.011}, {"annotation": null, "asn": null, "ip": "12.255.10.224", "name": "12.255.10.224", "rtt": 25.322}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "108.170.243.1", "name": "108.170.243.1", "rtt": 29.376}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "8.8.8.8", "name": "dns.google", "rtt": 23.228}, {"annotation": null, "asn": null, "ip": "209.85.252.251", "name": "209.85.252.251", "rtt": 24.548}, {"annotation": null, "asn": null, "ip": "108.170.237.23", "name": "108.170.237.23", "rtt": 24.332}]}]} diff --git a/tests/fixtures/freebsd12/traceroute.out b/tests/fixtures/freebsd12/traceroute.out new file mode 100644 index 00000000..725f7013 --- /dev/null +++ b/tests/fixtures/freebsd12/traceroute.out @@ -0,0 +1,14 @@ +traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 40 byte packets + 1 dsldevice.attlocal.net (192.168.1.254) 3.263 ms 4.146 ms 4.273 ms + 2 76-220-24-1.lightspeed.sntcca.sbcglobal.net (76.220.24.1) 20.839 ms 23.434 ms 22.032 ms + 3 * * * + 4 12.122.149.186 (12.122.149.186) 33.170 ms 26.593 ms 32.851 ms + 5 sffca22crs.ip.att.net (12.122.3.70) 26.045 ms 29.235 ms 28.280 ms + 6 12.122.163.61 (12.122.163.61) 25.300 ms 24.156 ms 24.849 ms + 7 12.255.10.226 (12.255.10.226) 25.375 ms + 12.255.10.224 (12.255.10.224) 24.011 ms 25.322 ms + 8 * 108.170.243.1 (108.170.243.1) 29.376 ms * + 9 dns.google (8.8.8.8) 23.228 ms + 209.85.252.251 (209.85.252.251) 24.548 ms + 108.170.237.23 (108.170.237.23) 24.332 ms + diff --git a/tests/fixtures/freebsd12/traceroute6.json b/tests/fixtures/freebsd12/traceroute6.json new file mode 100644 index 00000000..f8864ad2 --- /dev/null +++ b/tests/fixtures/freebsd12/traceroute6.json @@ -0,0 +1 @@ +{"destination_ip": "2a04:4e42::323", "destination_name": "turner-tls.map.fastly.net", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 27.603}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 28.659}, {"annotation": null, "asn": null, "ip": "2001:506:6000:11b:71:156:212:143", "name": null, "rtt": 33.235}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 36.731}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 28.875}, {"annotation": null, "asn": null, "ip": "2001:1890:ff:ff08:12:242:117:16", "name": null, "rtt": 28.959}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 10, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 11, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 12, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 13, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 14, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 15, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 16, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 17, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 18, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 19, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 20, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 21, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 22, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 23, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 24, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 25, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 26, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 27, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 28, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 29, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 30, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}, {"hop": 31, "probes": [{"annotation": null, "asn": null, "ip": null, "name": null, "rtt": null}]}]} diff --git a/tests/fixtures/freebsd12/traceroute6.out b/tests/fixtures/freebsd12/traceroute6.out new file mode 100644 index 00000000..eb4709fa --- /dev/null +++ b/tests/fixtures/freebsd12/traceroute6.out @@ -0,0 +1,34 @@ +traceroute6: Warning: turner-tls.map.fastly.net has multiple addresses; using 2a04:4e42::323 +traceroute6 to turner-tls.map.fastly.net (2a04:4e42::323) from 2600:1700:bab0:d40:250:56ff:fe26:c5b4, 64 hops max, 20 byte packets + 1 * * * + 2 2001:506:6000:11b:71:156:212:143 27.603 ms 28.659 ms 33.235 ms + 3 * * * + 4 2001:1890:ff:ff08:12:242:117:16 36.731 ms 28.875 ms 28.959 ms + 5 * * * + 6 * * * + 7 * * * + 8 * * * + 9 * * * +10 * * * +11 * * * +12 * * * +13 * * * +14 * * * +15 * * * +16 * * * +17 * * * +18 * * * +19 * * * +20 * * * +21 * * * +22 * * * +23 * * * +24 * * * +25 * * * +26 * * * +27 * * * +28 * * * +29 * * * +30 * * * +31 * * * + diff --git a/tests/fixtures/osx-10.14.6/uname.out b/tests/fixtures/osx-10.14.6/uname.out new file mode 100644 index 00000000..b81c54fc --- /dev/null +++ b/tests/fixtures/osx-10.14.6/uname.out @@ -0,0 +1 @@ +Darwin diff --git a/tests/test_tracepath.py b/tests/test_tracepath.py new file mode 100644 index 00000000..d5ccbb5b --- /dev/null +++ b/tests/test_tracepath.py @@ -0,0 +1,46 @@ +import os +import unittest +import json +import jc.parsers.tracepath + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) + + +class MyTests(unittest.TestCase): + + def setUp(self): + # input + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/tracepath.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_tracepath = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/tracepath6.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_tracepath6 = f.read() + + # output + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/tracepath.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_tracepath_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/tracepath6.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_tracepath6_json = json.loads(f.read()) + + def test_tracepath_nodata(self): + """ + Test 'tracepath' with no data + """ + self.assertEqual(jc.parsers.tracepath.parse('', quiet=True), {}) + + def test_tracepath_centos_7_7(self): + """ + Test 'tracepath' on Centos 7.7 + """ + self.assertEqual(jc.parsers.tracepath.parse(self.centos_7_7_tracepath, quiet=True), self.centos_7_7_tracepath_json) + + def test_tracepath6_centos_7_7(self): + """ + Test 'tracepath6' on Centos 7.7 + """ + self.assertEqual(jc.parsers.tracepath.parse(self.centos_7_7_tracepath6, quiet=True), self.centos_7_7_tracepath6_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_traceroute.py b/tests/test_traceroute.py index fdc7b198..31bfdfcd 100644 --- a/tests/test_traceroute.py +++ b/tests/test_traceroute.py @@ -34,6 +34,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.out'), 'r', encoding='utf-8') as f: self.osx_10_14_6_traceroute6 = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/traceroute.out'), 'r', encoding='utf-8') as f: + self.freebsd12_traceroute = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/traceroute6.out'), 'r', encoding='utf-8') as f: + self.freebsd12_traceroute6 = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute1.out'), 'r', encoding='utf-8') as f: self.generic_traceroute1 = f.read() @@ -80,6 +86,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/traceroute6.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_traceroute6_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/traceroute.json'), 'r', encoding='utf-8') as f: + self.freebsd12_traceroute_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/traceroute6.json'), 'r', encoding='utf-8') as f: + self.freebsd12_traceroute6_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/traceroute1.json'), 'r', encoding='utf-8') as f: self.generic_traceroute1_json = json.loads(f.read()) @@ -158,6 +170,18 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.traceroute.parse(self.osx_10_14_6_traceroute6, quiet=True), self.osx_10_14_6_traceroute6_json) + def test_traceroute_freebsd12(self): + """ + Test 'traceroute' on freebsd12 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.freebsd12_traceroute, quiet=True), self.freebsd12_traceroute_json) + + def test_traceroute6_freebsd12(self): + """ + Test 'traceroute6' on freebsd12 + """ + self.assertEqual(jc.parsers.traceroute.parse(self.freebsd12_traceroute6, quiet=True), self.freebsd12_traceroute6_json) + def test_traceroute1_generic(self): """ Test 'traceroute' diff --git a/tests/test_uname.py b/tests/test_uname.py index ca2ca2de..41bc22a1 100644 --- a/tests/test_uname.py +++ b/tests/test_uname.py @@ -22,6 +22,9 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/uname-a.out'), 'r', encoding='utf-8') as f: self.osx_10_14_6_uname_a = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/uname.out'), 'r', encoding='utf-8') as f: + self.osx_10_14_6_uname = f.read() + # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/uname-a.json'), 'r', encoding='utf-8') as f: self.centos_7_7_uname_a_json = json.loads(f.read()) @@ -41,6 +44,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.uname.parse('', quiet=True), {}) + def test_uname_no_a(self): + """ + Test 'uname' without -a option. Should generate a ParseError exception + """ + self.assertRaises(jc.parsers.uname.ParseError, jc.parsers.uname.parse, self.osx_10_14_6_uname) + def test_uname_centos_7_7(self): """ Test 'uname -a' on Centos 7.7 From ff1e32ad2ee156f105f5069c6b14a65b22784dfa Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 16:49:34 -0700 Subject: [PATCH 78/80] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ee76b23..d23701b8 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.12.1', + version='1.13.0', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='Converts the output of popular command-line tools and file-types to JSON.', From 724d825745b6f1692eb3b068c3fb59d14892e690 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 19:02:11 -0700 Subject: [PATCH 79/80] add tracepath parser --- man/jc.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/jc.1 b/man/jc.1 index fb5efb99..16f346f5 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -204,6 +204,10 @@ systemctl list-unit-files command parser timedatectl status command parser .TP .B +\fB--tracepath\fP +tracepath command parser +.TP +.B \fB--traceroute\fP traceroute command parser .TP From 6badd3fb1e1cf6d1ee99614fadc20d54be8039aa Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 19:02:23 -0700 Subject: [PATCH 80/80] add parser count test --- tests/test_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index d07485ce..d998ee23 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -191,4 +191,5 @@ class MyTests(unittest.TestCase): def test_cli_about_jc(self): self.assertEqual(jc.cli.about_jc()['name'], 'jc') - self.assertGreaterEqual(jc.cli.about_jc()['parser_count'], 50) + self.assertGreaterEqual(jc.cli.about_jc()['parser_count'], 55) + self.assertEqual(jc.cli.about_jc()['parser_count'], len(jc.cli.about_jc()['parsers']))