srikanth | 116e6e8 | 2014-08-19 07:22:37 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2013 Big Switch Networks, Inc. |
| 3 | # |
| 4 | # Licensed under the Eclipse Public License, Version 1.0 (the |
| 5 | # "License"); you may not use this file except in compliance with the |
| 6 | # License. You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.eclipse.org/legal/epl-v10.html |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | # implied. See the License for the specific language governing |
| 14 | # permissions and limitations under the License. |
| 15 | # |
| 16 | |
| 17 | # This i data file for testing Rest APIs |
| 18 | # This file is read by RestApiTests.py |
| 19 | |
| 20 | test_dpid="11:22:33:44:55:66:77:01" |
| 21 | test_dpid2="11:22:33:44:55:66:77:01" |
| 22 | test_mac ="11:22:33:44:55:01" |
| 23 | test_vns_id ="test_vns_id_1" |
| 24 | test_flow_entry_name = "test_flow_entry_name" |
| 25 | test_vns_acl_name = "test_vns_acl" |
| 26 | test_syncd_config_id = "test_syncd_config_id" |
| 27 | test_syncd_transport_config_test_data="test_sync_transport_config_id" |
| 28 | test_syncd_transport_config_name = "test_syncd_transport_cfg_name" |
| 29 | test_vns_interface_rule_name = "test_vns_intf_rule_name" |
| 30 | test_vns_interface_name = "test_vns_intf_name" |
| 31 | test_vns_interface_acl_direction = "in" |
| 32 | test_vns_interface_acl_id = "test_vns_interface_acl_id" |
| 33 | test_vns_acl_name_id = test_vns_id+"|"+test_vns_acl_name |
| 34 | test_vns_acl_entry_type = "ip" |
| 35 | test_acl_entry_seq_no = "10" |
| 36 | test_vns_acl_entry_id = test_vns_acl_name_id+"|"+test_acl_entry_seq_no |
| 37 | test_vns_acl_entry_src_ip="11.22.33.44" |
| 38 | test_vns_acl_entry_action="deny" |
| 39 | test_vns_acl_entry_type="deny" |
| 40 | test_tag_name = "test_tag_name" |
| 41 | test_tag_value = "test_tag_value" |
| 42 | test_tag_id = test_vns_id+"|"+test_tag_name+"|"+test_tag_value |
| 43 | test_tag_mapping_id = test_tag_id+"|"+test_mac |
| 44 | |
| 45 | model_switch_test_data={"path":"model/switch", "data":{"dpid":test_dpid}, "id":"dpid"} |
| 46 | model_host_test_data ={"path":"model/host", "data":{"mac":test_mac}, "id":"mac"} |
| 47 | model_flow_entry_test_data = {"path":"model/flow-entry", "data":{"switch":test_dpid, "name":test_flow_entry_name}, "id":"name"} |
| 48 | model_vns_definition_test_data = {"path":"model/vns-definition", "data":{"id":test_vns_id}, "id":"id"} |
| 49 | model_vns_acl_test_data = {"path":"model/vns-access-list", "data":{"vns":test_vns_id, "name":test_vns_acl_name_id}, "id":"name"} |
| 50 | model_host_network_address_test_data = {"path":"model/host-network-address", \ |
| 51 | "data":{"id":"ea:81:27:2a:6b:6b-10.0.0.1"}, "id":"id"} |
| 52 | model_syncd_config_test_data = {"path":"model/syncd-config", "data":{"id":test_syncd_config_id}, "id":"id"} |
| 53 | model_tag_test_data = {"path":"model/tag", "data":{"id":test_tag_id, \ |
| 54 | "name":"tagname", "value":"tagvalue", "namespace":test_vns_id}, "id":"id"} |
| 55 | model_tag_mapping_test_data = {"path":"model/tag-mapping", "data":{"id": test_tag_mapping_id, \ |
| 56 | "tag": test_tag_id, "type": "host", "host": test_mac}, "id":"id"} |
| 57 | model_syncd_transport_config_test_data = {"path":"model/syncd-transport-config", |
| 58 | "data":{"id":"test_syncd_transport_config_test_data", "type":"random1", "args":"test_args", \ |
| 59 | "config":test_syncd_config_id, "target-cluster":"Testcluster", "name":test_syncd_transport_config_name}, "id":"id"} |
| 60 | model_syncd_progress_info_test_data = {"path":"model/syncd-progress-info", "data":{"id":test_syncd_config_id}, "id":"id"} |
| 61 | model_vns_interface_rule_test_data ={"path":"model/vns-interface-rule", \ |
| 62 | "data":{"id":test_vns_id+"|"+test_vns_interface_rule_name, "vns":test_vns_id}, "id":"id"} |
| 63 | model_vns_interface_acl_test_data = {"path":"model/vns-interface-access-list", "data":{"id":test_vns_interface_acl_id, \ |
| 64 | "in-out":test_vns_interface_acl_direction, "vns-interface":test_vns_interface_name, "vns-access-list":test_vns_acl_name_id}, "id":"id"} |
| 65 | model_vns_acl_entry_test_data = {"path":"model/vns-access-list-entry", \ |
| 66 | "data":{"id":test_vns_acl_entry_id, "src-ip":test_vns_acl_entry_src_ip, \ |
| 67 | "action":test_vns_acl_entry_action, "vns-access-list":test_vns_acl_name_id, "type":test_vns_acl_entry_type}, "id":"id"} |
| 68 | |
| 69 | test_index=0 |
| 70 | rest_api_test_data = {} |
| 71 | rest_api_test_data[test_index] = model_switch_test_data ; test_index += 1 |
| 72 | rest_api_test_data[test_index] = model_host_test_data; test_index += 1 |
| 73 | rest_api_test_data[test_index] = model_flow_entry_test_data; test_index += 1 |
| 74 | rest_api_test_data[test_index] = model_vns_definition_test_data; test_index += 1 |
| 75 | rest_api_test_data[test_index] = model_vns_acl_test_data; test_index += 1 |
| 76 | rest_api_test_data[test_index] = model_host_network_address_test_data; test_index += 1 |
| 77 | rest_api_test_data[test_index] = model_syncd_config_test_data; test_index += 1 |
| 78 | rest_api_test_data[test_index] = model_tag_test_data; test_index += 1 |
| 79 | rest_api_test_data[test_index] = model_tag_mapping_test_data; test_index += 1 |
| 80 | rest_api_test_data[test_index] = model_syncd_transport_config_test_data; test_index += 1 |
| 81 | rest_api_test_data[test_index] = model_syncd_progress_info_test_data; test_index += 1 |
| 82 | rest_api_test_data[test_index] = model_vns_interface_rule_test_data; test_index += 1 |
| 83 | rest_api_test_data[test_index] = model_vns_interface_acl_test_data; test_index += 1 |
| 84 | rest_api_test_data[test_index] = model_vns_acl_entry_test_data; test_index += 1 |