def test_find_floating_network(self): floating_network = CONF.tobiko.neutron.floating_network if not floating_network: tobiko.skip('floating_network not configured') network = neutron.find_network(name=floating_network) self.assertIn(floating_network, [network['name'], network['id']]) self.assertEqual(self.stack.gateway_network_id, network['id'])
def test_get_ipv6_subnet(self): if not self.stack.has_ipv6: tobiko.skip("Stack {stack} has no IPv6 subnet", stack=self.stack.stack_name) subnet = neutron.get_subnet(self.stack.ipv6_subnet_id) self.assertEqual(self.stack.ipv6_subnet_id, subnet['id']) self.assertEqual(self.stack.ipv6_subnet_details, subnet)
def open_file(filename, mode): try: lzma = import_lzma() except ImportError: tobiko.skip( "Package lzma or backports.lzma is required to decompress " "{filename!r} (mode={mode!r}) XZ image file " "({python_version!r}).", filename=filename, mode=mode, python_version=sys.version) return lzma.LZMAFile(filename=filename, mode=mode)
def test_get_router(self): if not self.stack.has_gateway: tobiko.skip("Stack {stack} has no gateway router", stack=self.stack.stack_name) router = neutron.get_router(self.stack.gateway_id) self.assertEqual(self.stack.gateway_id, router['id'])
def test_ipv6_subnet_gateway_ip(self): if not self.stack.has_ipv6 or not self.stack.has_gateway: tobiko.skip('Stack {!s} has no IPv6 gateway', self.stack.stack_name) self.assertIn(self.stack.ipv6_subnet_gateway_ip, self.stack.ipv6_gateway_addresses)
def test_gateway_network(self): if not self.stack.has_gateway: tobiko.skip('Stack {!s} has no gateway', self.stack.stack_name) self.assertEqual( self.stack.gateway_network_id, self.stack.gateway_details['external_gateway_info']['network_id'])
def test_ipv6_subnet_cidr(self): if not self.stack.has_ipv6: tobiko.skip('Stack {!s} has no ipv6 subnet', self.stack.stack_name) subnet = neutron.find_subnet(cidr=str(self.stack.ipv6_subnet_cidr)) self.assertEqual(neutron.get_subnet(self.stack.ipv6_subnet_id), subnet)
def cleanup_fixture(self): tobiko.skip('some-reason')
def setup_fixture(self): tobiko.skip('some-reason')
def ipv6_subnet_gateway_ip(self): if not self.stack.network_stack.has_ipv6: tobiko.skip('Stack {!s} has no ipv6 subnet', self.stack.network_stack.stack_name) return self.stack.network_stack.ipv6_subnet_gateway_ip
def setUp(self): super(RouterTest, self).setUp() if not self.stack.network_stack.has_gateway: tobiko.skip('Stack {!s} has no gateway', self.stack.network_stack.stack_name)