Exemple #1
0
 def test_create_vip_with_all_params(self):
     """lb-vip-create with all params."""
     resource = 'vip'
     cmd = vip.CreateVip(test_cli20.MyApp(sys.stdout), None)
     pool_id = 'my-pool-id'
     name = 'my-name'
     description = 'my-desc'
     address = '10.0.0.2'
     admin_state = False
     connection_limit = '1000'
     subnet_id = 'subnet-id'
     protocol_port = '80'
     protocol = 'TCP'
     tenant_id = 'my-tenant'
     my_id = 'my-id'
     args = ['--name', name,
             '--description', description,
             '--address', address,
             '--admin-state-down',
             '--connection-limit', connection_limit,
             '--protocol-port', protocol_port,
             '--protocol', protocol,
             '--subnet-id', subnet_id,
             '--tenant-id', tenant_id,
             pool_id]
     position_names = ['pool_id', 'name', 'description', 'address',
                       'admin_state_up', 'connection_limit',
                       'protocol_port', 'protocol', 'subnet_id',
                       'tenant_id']
     position_values = [pool_id, name, description, address,
                        admin_state, connection_limit, protocol_port,
                        protocol, subnet_id,
                        tenant_id]
     self._test_create_resource(resource, cmd, name, my_id, args,
                                position_names, position_values)
Exemple #2
0
 def test_create_vip_with_session_persistence_params(self):
     """lb-vip-create with mandatory and session-persistence params."""
     resource = 'vip'
     cmd = vip.CreateVip(test_cli20.MyApp(sys.stdout), None)
     pool_id = 'my-pool-id'
     name = 'my-name'
     subnet_id = 'subnet-id'
     protocol_port = '1000'
     protocol = 'TCP'
     tenant_id = 'my-tenant'
     my_id = 'my-id'
     args = ['--name', name,
             '--protocol-port', protocol_port,
             '--protocol', protocol,
             '--subnet-id', subnet_id,
             '--tenant-id', tenant_id,
             pool_id,
             '--session-persistence', 'type=dict',
             'type=cookie,cookie_name=pie',
             '--optional-param', 'any']
     position_names = ['pool_id', 'name', 'protocol_port', 'protocol',
                       'subnet_id', 'tenant_id', 'optional_param']
     position_values = [pool_id, name, protocol_port, protocol,
                        subnet_id, tenant_id, 'any']
     extra_body = {
         'session_persistence': {
             'type': 'cookie',
             'cookie_name': 'pie',
         },
     }
     self._test_create_resource(resource, cmd, name, my_id, args,
                                position_names, position_values,
                                admin_state_up=True, extra_body=extra_body)
 def test_create_vip_with_mandatory_params(self):
     """lb-vip-create with all mandatory params."""
     resource = 'vip'
     cmd = vip.CreateVip(test_cli20.MyApp(sys.stdout), None)
     pool_id = 'my-pool-id'
     name = 'my-name'
     subnet_id = 'subnet-id'
     protocol_port = '1000'
     protocol = 'tcp'
     tenant_id = 'my-tenant'
     my_id = 'my-id'
     args = [
         '--name', name, '--protocol-port', protocol_port, '--protocol',
         protocol, '--subnet-id', subnet_id, '--tenant-id', tenant_id,
         pool_id
     ]
     position_names = [
         'pool_id', 'name', 'protocol_port', 'protocol', 'subnet_id',
         'tenant_id'
     ]
     position_values = [
         pool_id, name, protocol_port, protocol, subnet_id, tenant_id
     ]
     self._test_create_resource(resource,
                                cmd,
                                name,
                                my_id,
                                args,
                                position_names,
                                position_values,
                                admin_state_up=True)