1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add final ping_s tests

This commit is contained in:
Kelly Brazil
2021-09-21 22:47:48 -07:00
parent 39ef88078f
commit a6f859a55e
18 changed files with 150 additions and 135 deletions

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":0,"ttl":59,"time_ms":89.422},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":1,"ttl":59,"time_ms":116.712},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":2,"ttl":59,"time_ms":147.964},{"type":"summary","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":"0xff","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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"151.101.1.67","icmp_seq":0,"ttl":59,"time_ms":39.048},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"151.101.1.67","icmp_seq":1,"ttl":59,"time_ms":29.954},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"151.101.1.67","icmp_seq":2,"ttl":59,"time_ms":50.674},{"type":"summary","destination_ip":"151.101.1.67","sent_bytes":1400,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":0,"ttl":59,"time_ms":28.042},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":1,"ttl":59,"time_ms":34.786},{"type":"reply","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"151.101.1.67","icmp_seq":2,"ttl":59,"time_ms":41.182},{"type":"summary","destination_ip":"151.101.1.67","sent_bytes":56,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.221","icmp_seq":0,"ttl":64,"time_ms":0.235},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.88","icmp_seq":0,"ttl":64,"time_ms":4.224},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.89","icmp_seq":0,"ttl":64,"time_ms":8.37},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.72","icmp_seq":0,"ttl":64,"time_ms":62.635},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.246","icmp_seq":0,"ttl":255,"time_ms":62.805},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.78","icmp_seq":0,"ttl":128,"time_ms":63.803},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.251","icmp_seq":0,"ttl":64,"time_ms":63.857},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.217","icmp_seq":0,"ttl":255,"time_ms":672.974},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.186","icmp_seq":0,"ttl":64,"time_ms":673.123},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.75","icmp_seq":0,"ttl":64,"time_ms":673.358},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.221","icmp_seq":1,"ttl":64,"time_ms":0.291},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.78","icmp_seq":1,"ttl":128,"time_ms":7.898},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.88","icmp_seq":1,"ttl":64,"time_ms":7.927},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.89","icmp_seq":1,"ttl":64,"time_ms":10.077},{"type":"reply","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"192.168.1.250","icmp_seq":0,"ttl":64,"time_ms":1084.262},{"type":"summary","destination_ip":"192.168.1.255","sent_bytes":56,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":0,"ttl":64,"time_ms":0.05},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":1,"ttl":64,"time_ms":0.104},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":"0xff","response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":2,"ttl":64,"time_ms":0.079},{"type":"summary","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":"0xff","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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"127.0.0.1","icmp_seq":0,"ttl":64,"time_ms":0.053},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"127.0.0.1","icmp_seq":1,"ttl":64,"time_ms":0.108},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":1400,"pattern":null,"response_bytes":1408,"response_ip":"127.0.0.1","icmp_seq":2,"ttl":64,"time_ms":0.089},{"type":"summary","destination_ip":"127.0.0.1","sent_bytes":1400,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":0,"ttl":64,"time_ms":0.052},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":1,"ttl":64,"time_ms":0.095},{"type":"reply","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":null,"response_bytes":64,"response_ip":"127.0.0.1","icmp_seq":2,"ttl":64,"time_ms":0.05},{"type":"summary","destination_ip":"127.0.0.1","sent_bytes":56,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":0},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":1},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":2},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":3},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":4},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"destination_host_unreachable","bytes":"92","destination_ip":"192.168.1.220","response_ip":"192.168.1.220"},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":5},{"type":"timeout","destination_ip":"192.168.1.220","sent_bytes":56,"pattern":null,"icmp_seq":6}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":0,"ttl":59,"time_ms":32.992},{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":1,"ttl":59,"time_ms":34.757},{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":2,"ttl":59,"time_ms":36.07},{"type":"summary","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":"0xff","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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"2a04:4e42:600::323","sent_bytes":128,"pattern":null,"bytes":"88","response_ip":"2a04:4e42:600::323","icmp_seq":0,"ttl":59,"time_ms":26.292},{"type":"reply","destination_ip":"2a04:4e42:600::323","sent_bytes":128,"pattern":null,"bytes":"88","response_ip":"2a04:4e42:600::323","icmp_seq":1,"ttl":59,"time_ms":64.712},{"type":"reply","destination_ip":"2a04:4e42:600::323","sent_bytes":128,"pattern":null,"bytes":"88","response_ip":"2a04:4e42:600::323","icmp_seq":2,"ttl":59,"time_ms":25.933},{"type":"summary","destination_ip":"2a04:4e42:600::323","sent_bytes":128,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":0,"ttl":59,"time_ms":27.684},{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":1,"ttl":59,"time_ms":31.824},{"type":"reply","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"2a04:4e42:200::323","icmp_seq":2,"ttl":59,"time_ms":30.0},{"type":"summary","destination_ip":"2a04:4e42:200::323","sent_bytes":56,"pattern":null,"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}]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"::1","icmp_seq":0,"ttl":64,"time_ms":0.077},{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"::1","icmp_seq":1,"ttl":64,"time_ms":0.156},{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":"0xff","bytes":"16","response_ip":"::1","icmp_seq":2,"ttl":64,"time_ms":0.139},{"type":"summary","destination_ip":"::1","sent_bytes":56,"pattern":"0xff","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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"::1","sent_bytes":1448,"pattern":null,"bytes":"1408","response_ip":"::1","icmp_seq":0,"ttl":64,"time_ms":0.093},{"type":"reply","destination_ip":"::1","sent_bytes":1448,"pattern":null,"bytes":"1408","response_ip":"::1","icmp_seq":1,"ttl":64,"time_ms":0.161},{"type":"reply","destination_ip":"::1","sent_bytes":1448,"pattern":null,"bytes":"1408","response_ip":"::1","icmp_seq":2,"ttl":64,"time_ms":0.152},{"type":"summary","destination_ip":"::1","sent_bytes":1448,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"::1","icmp_seq":0,"ttl":64,"time_ms":0.071},{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"::1","icmp_seq":1,"ttl":64,"time_ms":0.153},{"type":"reply","destination_ip":"::1","sent_bytes":56,"pattern":null,"bytes":"16","response_ip":"::1","icmp_seq":2,"ttl":64,"time_ms":0.122},{"type":"summary","destination_ip":"::1","sent_bytes":56,"pattern":null,"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}]

View File

@ -0,0 +1 @@
[{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":1596585008.591169,"icmp_seq":1},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":1596585009.631169,"icmp_seq":2},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":1596585010.671173,"icmp_seq":3},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":1596585011.711167,"icmp_seq":4}]

View File

@ -0,0 +1 @@
[{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":null,"icmp_seq":1},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":null,"icmp_seq":2},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":null,"icmp_seq":3},{"type":"timeout","destination_ip":"192.168.120.164","sent_bytes":56,"pattern":null,"timestamp":null,"icmp_seq":4}]

View File

@ -341,63 +341,57 @@ class MyTests(unittest.TestCase):
self.freebsd12_ping6_ip_streaming_json = json.loads(f.read()) self.freebsd12_ping6_ip_streaming_json = json.loads(f.read())
# osx: # 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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-p-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_hostname_p_json = json.loads(f.read()) self.osx_10_14_6_ping_hostname_p_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-s-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_hostname_s_json = json.loads(f.read()) self.osx_10_14_6_ping_hostname_s_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-hostname-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_hostname_json = json.loads(f.read()) self.osx_10_14_6_ping_hostname_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-p-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_ip_p_json = json.loads(f.read()) self.osx_10_14_6_ping_ip_p_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-s-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_ip_s_json = json.loads(f.read()) self.osx_10_14_6_ping_ip_s_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_ip_json = json.loads(f.read()) self.osx_10_14_6_ping_ip_streaming_json = json.loads(f.read())
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-unreachable.json'), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-unreachable-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_ip_unreachable_json = json.loads(f.read()) self.osx_10_14_6_ping_ip_unreachable_streaming_json = json.loads(f.read())
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-unknown-errors.json'), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-p-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping_ip_unknown_errors_json = json.loads(f.read()) self.osx_10_14_6_ping6_hostname_p_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-s-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_hostname_p_json = json.loads(f.read()) self.osx_10_14_6_ping6_hostname_s_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-hostname-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_hostname_s_json = json.loads(f.read()) self.osx_10_14_6_ping6_hostname_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-p-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_hostname_json = json.loads(f.read()) self.osx_10_14_6_ping6_ip_p_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-s-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_ip_p_json = json.loads(f.read()) self.osx_10_14_6_ping6_ip_s_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_ip_s_json = json.loads(f.read()) self.osx_10_14_6_ping6_ip_streaming_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: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping-ip-dup-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_ip_json = json.loads(f.read()) self.osx_10_14_6_ping_ip_dup_streaming_json = json.loads(f.read())
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-unparsable.json'), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ping6-ip-dup-streaming.json'), 'r', encoding='utf-8') as f:
# self.osx_10_14_6_ping6_ip_unparsable_json = json.loads(f.read()) self.osx_10_14_6_ping6_ip_dup_streaming_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())
# 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())
# raspberry pi # raspberry pi
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/pi/ping-ip-O.json'), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/pi/ping-ip-O-streaming.json'), 'r', encoding='utf-8') as f:
# self.pi_ping_ip_O_json = json.loads(f.read()) self.pi_ping_ip_O_streaming_json = json.loads(f.read())
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/pi/ping-ip-O-D.json'), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/pi/ping-ip-O-D-streaming.json'), 'r', encoding='utf-8') as f:
# self.pi_ping_ip_O_D_json = json.loads(f.read()) self.pi_ping_ip_O_D_streaming_json = json.loads(f.read())
def test_ping_nodata(self): def test_ping_nodata(self):
""" """
@ -681,119 +675,123 @@ class MyTests(unittest.TestCase):
""" """
self.assertEqual(list(jc.parsers.ping_s.parse(self.freebsd12_ping6_ip.splitlines())), self.freebsd12_ping6_ip_streaming_json) self.assertEqual(list(jc.parsers.ping_s.parse(self.freebsd12_ping6_ip.splitlines())), self.freebsd12_ping6_ip_streaming_json)
# def test_ping_hostname_p_osx_10_14_6(self): def test_ping_hostname_p_osx_10_14_6(self):
# """ """
# Test 'ping <hostname> -p' on osx 10.14.6 Test 'ping <hostname> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_hostname_p.splitlines())), self.osx_10_14_6_ping_hostname_p_streaming_json)
# def test_ping_hostname_s_osx_10_14_6(self): def test_ping_hostname_s_osx_10_14_6(self):
# """ """
# Test 'ping <hostname> -s' on osx 10.14.6 Test 'ping <hostname> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_hostname_s.splitlines())), self.osx_10_14_6_ping_hostname_s_streaming_json)
# def test_ping_ping_hostname_osx_10_14_6(self): def test_ping_hostname_osx_10_14_6(self):
# """ """
# Test 'ping <hostname>' on osx 10.14.6 Test 'ping <hostname>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_hostname.splitlines())), self.osx_10_14_6_ping_hostname_streaming_json)
# def test_ping_ip_p_osx_10_14_6(self): def test_ping_ip_p_osx_10_14_6(self):
# """ """
# Test 'ping <ip> -p' on osx 10.14.6 Test 'ping <ip> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip_p.splitlines())), self.osx_10_14_6_ping_ip_p_streaming_json)
# def test_ping_ip_s_osx_10_14_6(self): def test_ping_ip_s_osx_10_14_6(self):
# """ """
# Test 'ping <ip> -s' on osx 10.14.6 Test 'ping <ip> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip_s.splitlines())), self.osx_10_14_6_ping_ip_s_streaming_json)
# def test_ping_ip_osx_10_14_6(self): def test_ping_ip_osx_10_14_6(self):
# """ """
# Test 'ping <ip>' on osx 10.14.6 Test 'ping <ip>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip.splitlines())), self.osx_10_14_6_ping_ip_streaming_json)
# def test_ping_ip_unreachable_osx_10_14_6(self): def test_ping_ip_unreachable_osx_10_14_6(self):
# """ """
# Test 'ping <ip>' with host unreachable error on osx 10.14.6 Test 'ping <ip>' with host unreachable error on osx 10.14.6
# """ """
# self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_unreachable, quiet=True), self.osx_10_14_6_ping_ip_unreachable_json) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip_unreachable.splitlines())), self.osx_10_14_6_ping_ip_unreachable_streaming_json)
# def test_ping_ip_unknown_errors_osx_10_14_6(self): def test_ping_ip_unknown_errors_osx_10_14_6(self):
# """ """
# Test 'ping <ip>' with unknown/unparsable errors on osx 10.14.6 Test 'ping <ip>' with unknown/unparsable errors on osx 10.14.6
# """ """
# self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping_ip_unknown_errors, quiet=True), self.osx_10_14_6_ping_ip_unknown_errors_json) g = jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip_unknown_errors.splitlines())
with self.assertRaises(IndexError):
list(g)
# def test_ping6_hostname_p_osx_10_14_6(self): def test_ping6_hostname_p_osx_10_14_6(self):
# """ """
# Test 'ping6 <hostname> -p' on osx 10.14.6 Test 'ping6 <hostname> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_hostname_p.splitlines())), self.osx_10_14_6_ping6_hostname_p_streaming_json)
# def test_ping6_hostname_s_osx_10_14_6(self): def test_ping6_hostname_s_osx_10_14_6(self):
# """ """
# Test 'ping6 <hostname> -s' on osx 10.14.6 Test 'ping6 <hostname> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_hostname_s.splitlines())), self.osx_10_14_6_ping6_hostname_s_streaming_json)
# def test_ping6_hostname_osx_10_14_6(self): def test_ping6_hostname_osx_10_14_6(self):
# """ """
# Test 'ping6 <hostname>' on osx 10.14.6 Test 'ping6 <hostname>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_hostname.splitlines())), self.osx_10_14_6_ping6_hostname_streaming_json)
# def test_ping6_ip_p_osx_10_14_6(self): def test_ping6_ip_p_osx_10_14_6(self):
# """ """
# Test 'ping6 <ip> -p' on osx 10.14.6 Test 'ping6 <ip> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_ip_p.splitlines())), self.osx_10_14_6_ping6_ip_p_streaming_json)
# def test_ping6_ip_s_osx_10_14_6(self): def test_ping6_ip_s_osx_10_14_6(self):
# """ """
# Test 'ping6 <ip> -s' on osx 10.14.6 Test 'ping6 <ip> -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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_ip_s.splitlines())), self.osx_10_14_6_ping6_ip_s_streaming_json)
# def test_ping6_ip_osx_10_14_6(self): def test_ping6_ip_osx_10_14_6(self):
# """ """
# Test 'ping6 <ip>' on osx 10.14.6 Test 'ping6 <ip>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_ip.splitlines())), self.osx_10_14_6_ping6_ip_streaming_json)
# def test_ping6_ip_unparsable_osx_10_14_6(self): def test_ping6_ip_unparsable_osx_10_14_6(self):
# """ """
# Test 'ping6 <ip>' with unparsable lines on osx 10.14.6 Test 'ping6 <ip>' with unparsable lines on osx 10.14.6
# """ """
# self.assertEqual(jc.parsers.ping.parse(self.osx_10_14_6_ping6_ip_unparsable, quiet=True), self.osx_10_14_6_ping6_ip_unparsable_json) g = jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_ip_unparsable.splitlines())
with self.assertRaises(IndexError):
list(g)
# def test_ping_ip_dup_osx_10_14_6(self): def test_ping_ip_dup_osx_10_14_6(self):
# """ """
# Test 'ping <ip>' to broadcast IP to get duplicate replies on osx 10.14.6 Test 'ping <ip>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping_ip_dup.splitlines())), self.osx_10_14_6_ping_ip_dup_streaming_json)
# def test_ping6_ip_dup_osx_10_14_6(self): def test_ping6_ip_dup_osx_10_14_6(self):
# """ """
# Test 'ping6 <ip>' to broadcast IP to get duplicate replies on osx 10.14.6 Test 'ping6 <ip>' 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) self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_ip_dup.splitlines())), self.osx_10_14_6_ping6_ip_dup_streaming_json)
# def test_ping_ip_O_pi(self): def test_ping_ip_O_pi(self):
# """ """
# Test 'ping6 <ip> -O' on raspberry pi Test 'ping6 <ip> -O' on raspberry pi
# """ """
# self.assertEqual(jc.parsers.ping.parse(self.pi_ping_ip_O, quiet=True), self.pi_ping_ip_O_json) self.assertEqual(list(jc.parsers.ping_s.parse(self.pi_ping_ip_O.splitlines())), self.pi_ping_ip_O_streaming_json)
# def test_ping_ip_O_D_pi(self): def test_ping_ip_O_D_pi(self):
# """ """
# Test 'ping6 <ip> -O -D' on raspberry pi Test 'ping6 <ip> -O -D' on raspberry pi
# """ """
# self.assertEqual(jc.parsers.ping.parse(self.pi_ping_ip_O_D, quiet=True), self.pi_ping_ip_O_D_json) self.assertEqual(list(jc.parsers.ping_s.parse(self.pi_ping_ip_O_D.splitlines())), self.pi_ping_ip_O_D_streaming_json)
if __name__ == '__main__': if __name__ == '__main__':