示例#1
0
 def test_interfaces_ifconfig_netbsd(self):
     interfaces = network._netbsd_interfaces_ifconfig(NETBSD)
     self.assertEqual(
         interfaces,
         {
             "lo0": {
                 "inet": [{"address": "127.0.0.1", "netmask": "255.0.0.0"}],
                 "inet6": [
                     {"address": "fe80::1", "prefixlen": "64", "scope": "lo0"}
                 ],
                 "up": True,
             },
             "vioif0": {
                 "hwaddr": "00:a0:98:e6:83:18",
                 "inet": [
                     {
                         "address": "192.168.1.80",
                         "broadcast": "192.168.1.255",
                         "netmask": "255.255.255.0",
                     }
                 ],
                 "inet6": [
                     {
                         "address": "fe80::2a0:98ff:fee6:8318",
                         "prefixlen": "64",
                         "scope": "vioif0",
                     }
                 ],
                 "up": True,
             },
         },
     )
示例#2
0
 def test_interfaces_ifconfig_netbsd(self):
     interfaces = network._netbsd_interfaces_ifconfig(NETBSD)
     self.assertEqual(
         interfaces, {
             'lo0': {
                 'inet': [{
                     'address': '127.0.0.1',
                     'netmask': '255.0.0.0'
                 }],
                 'inet6': [{
                     'address': 'fe80::1',
                     'prefixlen': '64',
                     'scope': 'lo0'
                 }],
                 'up':
                 True
             },
             'vioif0': {
                 'hwaddr':
                 '00:a0:98:e6:83:18',
                 'inet': [{
                     'address': '192.168.1.80',
                     'broadcast': '192.168.1.255',
                     'netmask': '255.255.255.0'
                 }],
                 'inet6': [{
                     'address': 'fe80::2a0:98ff:fee6:8318',
                     'prefixlen': '64',
                     'scope': 'vioif0'
                 }],
                 'up':
                 True
             }
         })