def test_create_router_null_name(self): """ Tests the neutron_utils.create_neutron_subnet() function when the subnet CIDR value is None """ this_router_settings = create_network.RouterSettings() self.router = neutron_utils.create_router(self.neutron, this_router_settings) validate_router(self.neutron, None, True)
def test_create_router_empty_name(self): """ Tests the neutron_utils.create_neutron_net() function """ this_router_settings = create_network.RouterSettings(name='') self.router = neutron_utils.create_router(self.neutron, this_router_settings) validate_router(self.neutron, '', True)
def test_create_router_with_public_interface(self): """ Tests the neutron_utils.create_neutron_net() function when an external gateway is requested """ self.net_config = openstack_tests.OSNetworkConfig('test-priv-net', 'test-priv-subnet', '10.2.1.0/24', 'test-router', 'external') self.router = neutron_utils.create_router(self.neutron, self.net_config.router_settings) validate_router(self.neutron, self.net_config.router_name, True)
def test_add_interface_router_null_subnet(self): """ Tests the neutron_utils.add_interface_router() function for an Exception when the subnet value is None """ self.network = neutron_utils.create_network(self.neutron, self.net_config.network_settings) self.assertEqual(self.net_config.net_name, self.network['network']['name']) self.assertTrue(validate_network(self.neutron, self.net_config.net_name, True)) self.router = neutron_utils.create_router(self.neutron, self.net_config.router_settings) validate_router(self.neutron, self.net_config.router_name, True) with self.assertRaises(Exception): self.interface_router = neutron_utils.add_interface_router(self.neutron, self.router, self.subnet)
def test_add_interface_router(self): """ Tests the neutron_utils.add_interface_router() function """ self.network = neutron_utils.create_network(self.neutron, self.net_config.network_settings) self.assertEqual(self.net_config.net_name, self.network['network']['name']) self.assertTrue(validate_network(self.neutron, self.net_config.net_name, True)) self.subnet = neutron_utils.create_subnet(self.neutron, self.net_config.subnet_settings, self.network) validate_subnet(self.neutron, self.net_config.subnet_name, self.net_config.subnet_cidr, True) self.router = neutron_utils.create_router(self.neutron, self.net_config.router_settings) validate_router(self.neutron, self.net_config.router_name, True) self.interface_router = neutron_utils.add_interface_router(self.neutron, self.router, self.subnet) validate_interface_router(self.interface_router, self.router, self.subnet)
def test_create_router_simple(self): """ Tests the neutron_utils.create_neutron_net() function when an external gateway is requested """ self.router = neutron_utils.create_router(self.neutron, self.net_config.router_settings) validate_router(self.neutron, self.net_config.router_name, True)