Exemplo n.º 1
0
    def testExampleNetconf(self):
        output = {
            'static_0_200': {
                'gw': '192.168.0.1',
                'netmask': '255.255.255.0',
                'ip_end': '192.168.0.10',
                'ip_start': '192.168.0.2'
            },
            'eth0': {
                'network_id': 0,
                'vlan_ids': [200, 204, 240]
            },
            'eth1': {
                'network_id': 1,
                'vlan_ids': [200, 124]
            },
            'eth2': {
                'network_id': 0,
                'vlan_ids': [204, 240]
            },
            'eth3': {
                'network_id': 1,
                'vlan_ids': [200]
            }
        }

        self.assertTrue(
            ack_cli.parse_netconf_file("autocertkit/networkconf.example") ==
            output)
Exemplo n.º 2
0
    def testExampleNetconf(self):
        output = {'eth0': {'network_id': 0, 'vlan_ids': [200, 204, 240],
                           'vf_driver_name': self.default_vf_driver_name, 'vf_driver_pkg': self.default_vf_driver_pkg,
                           'max_vf_num': '8'},
                  'eth1': {'network_id': 1, 'vlan_ids': [200, 124],
                           'vf_driver_name': self.default_vf_driver_name, 'vf_driver_pkg': '',
                           'max_vf_num': '8'},
                  'eth2': {'network_id': 0, 'vlan_ids': [204, 240],
                           'vf_driver_name': '', 'vf_driver_pkg': self.default_vf_driver_pkg,
                           'max_vf_num': '8'},
                  'eth3': {'network_id': 1, 'vlan_ids': [200],
                           'vf_driver_name': '', 'vf_driver_pkg': '',
                           'max_vf_num': ''},
                  'static_0_200': {'gw': '192.168.0.1',
                                   'netmask': '255.255.255.0',
                                   'ip_end': '192.168.0.10',
                                   'ip_start': '192.168.0.2'},
                  'static_management': {'gw': '192.168.0.1',
                                        'netmask': '255.255.255.0',
                                        'ip_end': '192.168.0.10',
                                        'ip_start': '192.168.0.2'}
                  }

        self.assertTrue(ack_cli.parse_netconf_file(
            "autocertkit/networkconf.example") == output)
Exemplo n.º 3
0
    def testExampleNetconf(self):
        output = {'static_0_200': {'gw': '192.168.0.1',
                                'netmask': '255.255.255.0',
                                'ip_end': '192.168.0.10',
                                'ip_start': '192.168.0.2'},
                'eth0': {'network_id': 0, 'vlan_ids': [200, 204, 240]},
                'eth1': {'network_id': 1, 'vlan_ids': [200, 124]},
                'eth2': {'network_id': 0, 'vlan_ids': [204, 240]},
                'eth3': {'network_id': 1, 'vlan_ids': [200]}
                }

        self.assertTrue(ack_cli.parse_netconf_file("autocertkit/networkconf.example") == output)
Exemplo n.º 4
0
    def testExampleNetconf(self):
        output = {
            "static_0_200": {
                "gw": "192.168.0.1",
                "netmask": "255.255.255.0",
                "ip_end": "192.168.0.10",
                "ip_start": "192.168.0.2",
            },
            "eth0": {"network_id": 0, "vlan_ids": [200, 204, 240]},
            "eth1": {"network_id": 1, "vlan_ids": [200, 124]},
            "eth2": {"network_id": 0, "vlan_ids": [204, 240]},
            "eth3": {"network_id": 1, "vlan_ids": [200]},
        }

        self.assertTrue(ack_cli.parse_netconf_file("autocertkit/networkconf.example") == output)
Exemplo n.º 5
0
    def testExampleNetconf(self):
        output = {
            'eth0': {
                'network_id': 0,
                'vlan_ids': [200, 204, 240],
                'vf_driver_name': self.default_vf_driver_name,
                'vf_driver_pkg': self.default_vf_driver_pkg,
                'max_vf_num': '8'
            },
            'eth1': {
                'network_id': 1,
                'vlan_ids': [200, 124],
                'vf_driver_name': self.default_vf_driver_name,
                'vf_driver_pkg': '',
                'max_vf_num': '8'
            },
            'eth2': {
                'network_id': 0,
                'vlan_ids': [204, 240],
                'vf_driver_name': '',
                'vf_driver_pkg': self.default_vf_driver_pkg,
                'max_vf_num': '8'
            },
            'eth3': {
                'network_id': 1,
                'vlan_ids': [200],
                'vf_driver_name': '',
                'vf_driver_pkg': '',
                'max_vf_num': ''
            },
            'static_0_200': {
                'gw': '192.168.0.1',
                'netmask': '255.255.255.0',
                'ip_end': '192.168.0.10',
                'ip_start': '192.168.0.2'
            },
            'static_management': {
                'gw': '192.168.0.1',
                'netmask': '255.255.255.0',
                'ip_end': '192.168.0.10',
                'ip_start': '192.168.0.2'
            }
        }

        self.assertTrue(
            ack_cli.parse_netconf_file("autocertkit/networkconf.example") ==
            output)
Exemplo n.º 6
0
 def _runTest(self, content, output=None, exception=None):
     filename = self._create_netconf_file(content)
     if exception:
         self.assertRaises(exception, ack_cli.parse_netconf_file, filename)
     else:
         self.assertTrue(ack_cli.parse_netconf_file(filename) == output)
Exemplo n.º 7
0
 def _runTest(self, content, output=None, exception=None):
     filename = self._create_netconf_file(content)
     if exception:
         self.assertRaises(exception, ack_cli.parse_netconf_file, filename)
     else:
         self.assertTrue(ack_cli.parse_netconf_file(filename) == output)