Beispiel #1
0
 def test__get_nets(self):
     expected_net = {
         'id':
         'network0',
         'ip_address':
         '10.10.0.2',
         'link':
         1,
         'netmask':
         '255.255.255.0',
         'network_id':
         1,
         'routes': [{
             'gateway': '10.10.0.1',
             'netmask': '0.0.0.0',
             'network': '0.0.0.0'
         }, {
             'gateway': '192.168.1.1',
             'netmask': '255.255.255.0',
             'network': '0.0.0.0'
         }],
         'type':
         'ipv4'
     }
     net = netutils._get_nets(self.netinfo[0],
                              self.netinfo[0]['network']['subnets'][0], 4,
                              0, 1)
     self.assertEqual(expected_net, net)
Beispiel #2
0
 def test__get_nets(self):
     expected_net = {
         'id': 'network0',
         'ip_address': '10.10.0.2',
         'link': 1,
         'netmask': '255.255.255.0',
         'network_id': 1,
         'routes': [
             {
                 'gateway': '10.10.0.1',
                 'netmask': '0.0.0.0',
                 'network': '0.0.0.0'},
             {
                 'gateway': '192.168.1.1',
                 'netmask': '255.255.255.0',
                 'network': '0.0.0.0'}],
             'services': [
                 {'address': '1.2.3.4', 'type': 'dns'},
                 {'address': '2.3.4.5', 'type': 'dns'}
             ],
         'type': 'ipv4'
     }
     net = netutils._get_nets(
         self.netinfo[0], self.netinfo[0]['network']['subnets'][0], 4, 0, 1)
     self.assertEqual(expected_net, net)