def test_create_flow_classifier_with_mandatory_params(self): """create flow-classifier: flow1.""" resource = 'flow_classifier' cmd = fc.FlowClassifierCreate(test_cli20.MyApp(sys.stdout), None) myid = 'myid' name = 'flow1' ethertype = 'IPv4' args = [name, '--ethertype', ethertype] position_names = ['name', 'ethertype'] position_values = [name, ethertype] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)
def test_create_flow_classifier_with_all_params(self): """create flow-classifier: flow1.""" resource = 'flow_classifier' cmd = fc.FlowClassifierCreate(test_cli20.MyApp(sys.stdout), None) myid = 'myid' name = 'flow1' protocol_name = 'TCP' ethertype = 'IPv4' source_port = '0:65535' source_port_min = 0 source_port_max = 65535 destination_port = '1:65534' destination_port_min = 1 destination_port_max = 65534 source_ip = '192.168.1.0/24' destination_ip = '192.168.2.0/24' logical_source_port = '4a334cd4-fe9c-4fae-af4b-321c5e2eb051' logical_destination_port = '1278dcd4-459f-62ed-754b-87fc5e4a6751' description = 'my-desc' l7_param = "url=my_url" l7_param_expected = {"url": "my_url"} args = [ name, '--protocol', protocol_name, '--ethertype', ethertype, '--source-port', source_port, '--destination-port', destination_port, '--source-ip-prefix', source_ip, '--destination-ip-prefix', destination_ip, '--logical-source-port', logical_source_port, '--logical-destination-port', logical_destination_port, '--description', description, '--l7-parameters', l7_param ] position_names = [ 'name', 'protocol', 'ethertype', 'source_port_range_min', 'source_port_range_max', 'destination_port_range_min', 'destination_port_range_max', 'source_ip_prefix', 'destination_ip_prefix', 'logical_source_port', 'logical_destination_port', 'description', 'l7_parameters' ] position_values = [ name, protocol_name, ethertype, source_port_min, source_port_max, destination_port_min, destination_port_max, source_ip, destination_ip, logical_source_port, logical_destination_port, description, l7_param_expected ] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values)