def test_create_floatingip(self): """Create floatingip: fip1.""" resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' args = [name] position_names = ['floating_network_id'] position_values = [name] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_floatingip_with_subnet_id(self): # Create floatingip: fip1 on a given subnet id. resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' subnet_id = 'mysubnetid' args = [name, '--subnet', subnet_id] position_values = [name, subnet_id] position_names = ['floating_network_id', 'subnet_id'] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_floatingip_with_ip_address_of_floating_ip(self): # Create floatingip: fip1 with a given IP address of floating IP. resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' addr = '10.0.0.99' args = [name, '--floating-ip-address', addr] position_values = [name, addr] position_names = ['floating_network_id', 'floating_ip_address'] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_floatingip_with_dns_name_and_dns_domain(self): # Create floatingip: fip1 with dns name and dns domain. resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' dns_name_name = 'my-floatingip' dns_domain_name = 'my-domain.org.' args = [name, '--dns-name', dns_name_name, '--dns-domain', dns_domain_name] position_names = ['floating_network_id', 'dns_name', 'dns_domain'] position_values = [name, dns_name_name, dns_domain_name] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_floatingip(self): # Create floatingip: fip1. resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' args = [name, '--description', 'floats like a butterfly'] position_names = ['floating_network_id'] position_values = [name] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values, description='floats like a butterfly')
def test_create_floatingip_and_port_and_address(self): """Create floatingip: fip1 with a given port and address.""" resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' pid = 'mypid' addr = '10.0.0.99' args = [name, '--port_id', pid, '--fixed_ip_address', addr] position_names = ['floating_network_id', 'port_id', 'fixed_ip_address'] position_values = [name, pid, addr] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values) # Test dashed options args = [name, '--port-id', pid, '--fixed-ip-address', addr] position_names = ['floating_network_id', 'port_id', 'fixed_ip_address'] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_floatingip_and_port(self): """Create floatingip: fip1.""" resource = 'floatingip' cmd = fip.CreateFloatingIP(test_cli20.MyApp(sys.stdout), None) name = 'fip1' myid = 'myid' pid = 'mypid' args = [name, '--port_id', pid] position_names = ['floating_network_id', 'port_id'] position_values = [name, pid] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values) # Test dashed options args = [name, '--port-id', pid] position_names = ['floating_network_id', 'port_id'] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)