Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / variables / vpnservice / configureSwitches.py
1 import json
2
3
4 def get_variables(mininet1_ip, mininet2_ip):
5     vpn_instances = {
6         "vpn-instance": [
7             {
8                 "description": "Test VPN Instance 1",
9                 "vpn-instance-name": "testVpn1",
10                 "ipv4-family": {
11                     "route-distinguisher": "100:1",
12                     "export-route-policy": "300:1",
13                     "import-route-policy": "200:1",
14                     "apply-label": {
15                         "apply-label-per-route": "true"
16                     }
17                 }
18             },
19             {
20                 "description": "Test VPN Instance 2",
21                 "vpn-instance-name": "testVpn2",
22                 "ipv4-family": {
23                     "route-distinguisher": "400:1",
24                     "export-route-policy": "500:1",
25                     "import-route-policy": "600:1",
26                     "apply-label": {
27                         "apply-label-per-route": "true"
28                     }
29                 }
30             }
31         ]
32     }
33     ietf_interfaces = {
34         "interface": [
35             {
36                 "name": "s1-eth1",
37                 "type": "iana-if-type:l2vlan",
38                 "odl-interface:of-port-id": "openflow:1:1",
39                 "enabled": "true"
40             },
41             {
42                 "name": "s1-eth2",
43                 "type": "iana-if-type:l2vlan",
44                 "odl-interface:of-port-id": "openflow:1:2",
45                 "enabled": "true"
46             },
47             {
48                 "name": "s2-eth1",
49                 "type": "iana-if-type:l2vlan",
50                 "odl-interface:of-port-id": "openflow:2:1",
51                 "enabled": "true"
52             },
53             {
54                 "name": "s2-eth2",
55                 "type": "iana-if-type:l2vlan",
56                 "odl-interface:of-port-id": "openflow:2:2",
57                 "enabled": "true"
58             },
59             {
60                 "enabled": "true",
61                 "odl-interface:of-port-id": "openflow:1:3",
62                 "description": "VM Port mpls",
63                 "name": "s1-gre1",
64                 "type": "odl-interface:l3tunnel",
65                 "odl-interface:tunnel-type": "odl-interface:tunnel-type-gre",
66                 "odl-interface:local-ip": mininet1_ip,
67                 "odl-interface:remote-ip": mininet2_ip
68             },
69             {
70                 "enabled": "true",
71                 "odl-interface:of-port-id": "openflow:2:3",
72                 "description": "VM Port mpls",
73                 "name": "s2-gre1",
74                 "type": "odl-interface:l3tunnel",
75                 "odl-interface:tunnel-type": "odl-interface:tunnel-type-gre",
76                 "odl-interface:local-ip": mininet2_ip,
77                 "odl-interface:remote-ip": mininet1_ip
78             }
79         ]
80     }
81     vpn_interfaces = {
82         "vpn-interface": [
83             {
84                 "odl-l3vpn:adjacency": [
85                     {
86                         "odl-l3vpn:ip_address": "10.0.0.1",
87                         "odl-l3vpn:mac_address": "00:00:00:00:00:01"
88                     }
89                 ],
90                 "vpn-instance-name": "testVpn1",
91                 "name": "s1-eth1"
92             },
93             {
94                 "odl-l3vpn:adjacency": [
95                     {
96                         "odl-l3vpn:ip_address": "10.0.0.2",
97                         "odl-l3vpn:mac_address": "00:00:00:00:00:02"
98                     }
99                 ],
100                 "vpn-instance-name": "testVpn2",
101                 "name": "s1-eth2"
102             },
103             {
104                 "odl-l3vpn:adjacency": [
105                     {
106                         "odl-l3vpn:ip_address": "10.0.0.3",
107                         "odl-l3vpn:mac_address": "00:00:00:00:00:03"
108                     }
109                 ],
110                 "vpn-instance-name": "testVpn1",
111                 "name": "s2-eth1"
112             },
113             {
114                 "odl-l3vpn:adjacency": [
115                     {
116                         "odl-l3vpn:ip_address": "10.0.0.4",
117                         "odl-l3vpn:mac_address": "00:00:00:00:00:04"
118                     }
119                 ],
120                 "vpn-instance-name": "testVpn2",
121                 "name": "s2-eth2"
122             }
123         ]
124     }
125     vpn_inst_data = json.dumps(vpn_instances)
126     ietf_int_data = json.dumps(ietf_interfaces)
127     vpn_int_data = json.dumps(vpn_interfaces)
128     variables = {'vpn_instances': vpn_inst_data,
129                  'ietf_interfaces': ietf_int_data,
130                  'vpn_interfaces': vpn_int_data}
131     return variables