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