mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
fix and test for osx arp entries without ifscope
This commit is contained in:
1
tests/fixtures/osx-10.14.6/arp-a2.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/arp-a2.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"name": null, "address": "169.254.81.142", "hwtype": "ethernet", "hwaddress": "60:93:17:3a:28:fc", "iface": "en0"}, {"name": "my-iphone.attlocal.net", "address": "192.168.1.64", "hwtype": "ethernet", "hwaddress": "e0:33:8f:68:39:d6", "iface": "en0"}, {"name": "my-mbp.attlocal.net", "address": "192.168.1.72", "hwtype": "ethernet", "hwaddress": "f0:18:98:3:d7:34", "iface": "en0"}, {"name": "c6180.attlocal.net", "address": "192.168.1.74", "hwtype": "ethernet", "hwaddress": "9c:b6:54:5f:fa:7c", "iface": "en0"}, {"name": "ipad.attlocal.net", "address": "192.168.1.75", "hwtype": "ethernet", "hwaddress": "4c:56:9e:5f:c7:4c", "iface": "en0"}, {"name": "mycloudex2ultra.attlocal.net", "address": "192.168.1.80", "hwtype": "ethernet", "hwaddress": "0:90:a9:ed:f4:3f", "iface": "en0"}, {"name": "family-room-5.attlocal.net", "address": "192.168.1.88", "hwtype": "ethernet", "hwaddress": "c8:d0:84:c3:e3:2d", "iface": "en0"}, {"name": "bedroom.attlocal.net", "address": "192.168.1.89", "hwtype": "ethernet", "hwaddress": "d0:3:4b:3b:29:a5", "iface": "en0"}, {"name": "heriphone.attlocal.net", "address": "192.168.1.178", "hwtype": "ethernet", "hwaddress": "90:e1:7b:ef:1:45", "iface": "en0"}, {"name": "upstairs.attlocal.net", "address": "192.168.1.186", "hwtype": "ethernet", "hwaddress": "50:32:37:d7:e5:7b", "iface": "en0"}, {"name": "rbr50.attlocal.net", "address": "192.168.1.216", "hwtype": "ethernet", "hwaddress": "3c:37:86:25:fd:f7", "iface": "en0"}, {"name": "my-mac.attlocal.net", "address": "192.168.1.221", "hwtype": "ethernet", "hwaddress": "a4:83:e7:2e:f2:8f", "iface": "en0"}, {"name": "irobot-d41934.attlocal.net", "address": "192.168.1.242", "hwtype": "ethernet", "hwaddress": "50:14:79:f2:4f:3e", "iface": "en0"}, {"name": "rbs50.attlocal.net", "address": "192.168.1.253", "hwtype": "ethernet", "hwaddress": "3c:37:86:1f:dd:a3", "iface": "en0"}, {"name": "dsldevice.attlocal.net", "address": "192.168.1.254", "hwtype": "ethernet", "hwaddress": "fc:ae:34:f1:3f:80", "iface": "en0"}, {"name": null, "address": "192.168.1.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "en0"}, {"name": null, "address": "192.168.71.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "vmnet8"}, {"name": null, "address": "192.168.101.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "vmnet1"}, {"name": null, "address": "224.0.0.251", "hwtype": "ethernet", "hwaddress": "1:0:5e:0:0:eb", "iface": "en0"}, {"name": null, "address": "239.255.255.250", "hwtype": "ethernet", "hwaddress": "1:0:5e:7f:ff:fe", "iface": "en0"}]
|
20
tests/fixtures/osx-10.14.6/arp-a2.out
vendored
Normal file
20
tests/fixtures/osx-10.14.6/arp-a2.out
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
? (169.254.81.142) at 60:93:17:3a:28:fc on en0 [ethernet]
|
||||
my-iphone.attlocal.net (192.168.1.64) at e0:33:8f:68:39:d6 on en0 ifscope [ethernet]
|
||||
my-mbp.attlocal.net (192.168.1.72) at f0:18:98:3:d7:34 on en0 ifscope [ethernet]
|
||||
c6180.attlocal.net (192.168.1.74) at 9c:b6:54:5f:fa:7c on en0 ifscope [ethernet]
|
||||
ipad.attlocal.net (192.168.1.75) at 4c:56:9e:5f:c7:4c on en0 ifscope [ethernet]
|
||||
mycloudex2ultra.attlocal.net (192.168.1.80) at 0:90:a9:ed:f4:3f on en0 ifscope [ethernet]
|
||||
family-room-5.attlocal.net (192.168.1.88) at c8:d0:84:c3:e3:2d on en0 ifscope [ethernet]
|
||||
bedroom.attlocal.net (192.168.1.89) at d0:3:4b:3b:29:a5 on en0 ifscope [ethernet]
|
||||
heriphone.attlocal.net (192.168.1.178) at 90:e1:7b:ef:1:45 on en0 ifscope [ethernet]
|
||||
upstairs.attlocal.net (192.168.1.186) at 50:32:37:d7:e5:7b on en0 ifscope [ethernet]
|
||||
rbr50.attlocal.net (192.168.1.216) at 3c:37:86:25:fd:f7 on en0 ifscope [ethernet]
|
||||
my-mac.attlocal.net (192.168.1.221) at a4:83:e7:2e:f2:8f on en0 ifscope permanent [ethernet]
|
||||
irobot-d41934.attlocal.net (192.168.1.242) at 50:14:79:f2:4f:3e on en0 ifscope [ethernet]
|
||||
rbs50.attlocal.net (192.168.1.253) at 3c:37:86:1f:dd:a3 on en0 ifscope [ethernet]
|
||||
dsldevice.attlocal.net (192.168.1.254) at fc:ae:34:f1:3f:80 on en0 ifscope [ethernet]
|
||||
? (192.168.1.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
|
||||
? (192.168.71.255) at ff:ff:ff:ff:ff:ff on vmnet8 ifscope [ethernet]
|
||||
? (192.168.101.255) at ff:ff:ff:ff:ff:ff on vmnet1 ifscope [ethernet]
|
||||
? (224.0.0.251) at 1:0:5e:0:0:eb on en0 ifscope permanent [ethernet]
|
||||
? (239.255.255.250) at 1:0:5e:7f:ff:fe on en0 ifscope permanent [ethernet]
|
@ -34,6 +34,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/arp-a.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_arp_a = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/arp-a2.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_arp_a2 = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/arp.json'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_arp_json = json.loads(f.read())
|
||||
@ -59,6 +62,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/arp-a.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_arp_a_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/arp-a2.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_arp_a2_json = json.loads(f.read())
|
||||
|
||||
def test_arp_centos_7_7(self):
|
||||
"""
|
||||
Test 'arp' on Centos 7.7
|
||||
@ -107,6 +113,12 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.arp.parse(self.osx_10_14_6_arp_a, quiet=True), self.osx_10_14_6_arp_a_json)
|
||||
|
||||
def test_arp_a2_osx_10_14_6(self):
|
||||
"""
|
||||
Test 'arp -a' with entries with no ifscope on OSX 10.14.6
|
||||
"""
|
||||
self.assertEqual(jc.parsers.arp.parse(self.osx_10_14_6_arp_a2, quiet=True), self.osx_10_14_6_arp_a2_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user