Update Robot Framework format - step 7
[integration/test.git] / csit / suites / groupbasedpolicy / GBPSFC / 6-node / demo-symmetric-chain / 035_track_curl_h35_2_h36_2.robot
1 *** Settings ***
2 Documentation       Deep inspection of HTTP traffic on symmetric chain.
3 ...                 Nodes are located on the same VM.
4
5 Library             SSHLibrary
6 Resource            ../../../../../libraries/GBP/OpenFlowUtils.robot
7 Resource            ../Variables.robot
8 Resource            ../Connections.robot
9
10 Suite Setup         Start Connections
11 Suite Teardown      Close Connections
12
13
14 *** Test Cases ***
15 Start HTTP on h36_2 on Port 80
16     [Documentation]    Starting HTTP service on docker container.
17     Set Test Variables
18     ...    client_name=h35_2
19     ...    client_ip=10.0.35.2
20     ...    server_name=h36_2
21     ...    server_ip=10.0.36.2
22     ...    service_port=80
23     ...    ether_type=0x0800
24     ...    proto=6
25     ...    vxlan_gpe_port=2
26     Switch Connection    GPSFC1_CONNECTION
27     Start HTTP Service on Docker    ${SERVER_NAME}    ${SERVICE_PORT}
28
29 Curl h36_2 from h35_2
30     [Documentation]    Test HTTP request from a docker container to serving docker container.
31     Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    service_port=${SERVICE_PORT}
32
33 Start Endless Curl on h35_2 on port 80
34     [Documentation]    Starting endless HTTP session for traffic inspection.
35     Start Endless Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    ${SERVICE_PORT}    sleep=1
36
37 On GBPSFC1 Send HTTP req h35_2-h36_2 to GBPSFC2
38     [Documentation]    HTTP traffic inspection.
39     Switch Connection    GPSFC1_CONNECTION
40     ${flow}    Inspect Classifier Outbound
41     ...    in_port=4
42     ...    out_port=${VXLAN_GPE_PORT}
43     ...    eth_type=${ETHER_TYPE}
44     ...    inner_src_ip=${CLIENT_IP}
45     ...    inner_dst_ip=${SERVER_IP}
46     ...    next_hop_ip=${GBPSFC2}
47     ...    nsi=255
48     ...    proto=${PROTO}
49     ...    dst_port=${SERVICE_PORT}
50     ${nsp_35_2-nsp_36_2}    GET NSP Value From Flow    ${flow}
51     Set Global Variable    ${NSP_path1}    ${nsp_35_2-nsp_36_2}
52
53 On GBPSFC2 Send HTTP req h35_2-h36_2 to GBPSFC3
54     [Documentation]    HTTP traffic inspection.
55     Switch Connection    GPSFC2_CONNECTION
56     Inspect Service Function Forwarder
57     ...    in_port=${VXLAN_GPE_PORT}
58     ...    out_port=${VXLAN_GPE_PORT}
59     ...    outer_src_ip=${GBPSFC1}
60     ...    outer_dst_ip=${GBPSFC2}
61     ...    eth_type=${ETHER_TYPE}
62     ...    inner_src_ip=${CLIENT_IP}
63     ...    inner_dst_ip=${SERVER_IP}
64     ...    next_hop_ip=${GBPSFC3}
65     ...    nsp=${NSP_path1}
66     ...    nsi=255
67     ...    proto=${PROTO}
68
69 On GBPSFC3 Send HTTP req h35_2-h36_2 to GBPSFC2
70     [Documentation]    HTTP traffic inspection.
71     Switch Connection    GPSFC3_CONNECTION
72     Inspect Service Function
73     ...    in_port=${VXLAN_GPE_PORT}
74     ...    out_port=${VXLAN_GPE_PORT}
75     ...    outer_src_ip=${GBPSFC2}
76     ...    outer_dst_ip=${GBPSFC3}
77     ...    eth_type=${ETHER_TYPE}
78     ...    inner_src_ip=${CLIENT_IP}
79     ...    inner_dst_ip=${SERVER_IP}
80     ...    next_hop_ip=${GBPSFC2}
81     ...    nsp=${NSP_path1}
82     ...    received_nsi=255
83
84 On GBPSFC2 Send HTTP req h35_2-h36_2 to GBPSFC4
85     [Documentation]    HTTP traffic inspection.
86     Switch Connection    GPSFC2_CONNECTION
87     Inspect Service Function Forwarder
88     ...    in_port=${VXLAN_GPE_PORT}
89     ...    out_port=${VXLAN_GPE_PORT}
90     ...    outer_src_ip=${GBPSFC3}
91     ...    outer_dst_ip=${GBPSFC2}
92     ...    eth_type=${ETHER_TYPE}
93     ...    inner_src_ip=${CLIENT_IP}
94     ...    inner_dst_ip=${SERVER_IP}
95     ...    next_hop_ip=${GBPSFC4}
96     ...    nsp=${NSP_path1}
97     ...    nsi=254
98     ...    proto=${PROTO}
99
100 On GBPSFC4 Send HTTP req h35_2-h36_2 to GBPSFC5
101     [Documentation]    HTTP traffic inspection.
102     Switch Connection    GPSFC4_CONNECTION
103     Inspect Service Function Forwarder
104     ...    in_port=${VXLAN_GPE_PORT}
105     ...    out_port=${VXLAN_GPE_PORT}
106     ...    outer_src_ip=${GBPSFC2}
107     ...    outer_dst_ip=${GBPSFC4}
108     ...    eth_type=${ETHER_TYPE}
109     ...    inner_src_ip=${CLIENT_IP}
110     ...    inner_dst_ip=${SERVER_IP}
111     ...    next_hop_ip=${GBPSFC5}
112     ...    nsp=${NSP_path1}
113     ...    nsi=254
114     ...    proto=${PROTO}
115
116 On GBPSFC5 Send HTTP req h35_2-h36_2 to GBPSFC4
117     [Documentation]    HTTP traffic inspection.
118     Switch Connection    GPSFC5_CONNECTION
119     Inspect Service Function
120     ...    in_port=${VXLAN_GPE_PORT}
121     ...    out_port=${VXLAN_GPE_PORT}
122     ...    outer_src_ip=${GBPSFC4}
123     ...    outer_dst_ip=${GBPSFC5}
124     ...    eth_type=${ETHER_TYPE}
125     ...    inner_src_ip=${CLIENT_IP}
126     ...    inner_dst_ip=${SERVER_IP}
127     ...    next_hop_ip=${GBPSFC4}
128     ...    nsp=${NSP_path1}
129     ...    received_nsi=254
130
131 On GBPSFC4 Send HTTP req h35_2-h36_2 to GBPSFC1
132     [Documentation]    HTTP traffic inspection.
133     Switch Connection    GPSFC4_CONNECTION
134     Inspect Service Function Forwarder
135     ...    in_port=${VXLAN_GPE_PORT}
136     ...    out_port=${VXLAN_GPE_PORT}
137     ...    outer_src_ip=${GBPSFC5}
138     ...    outer_dst_ip=${GBPSFC4}
139     ...    eth_type=${ETHER_TYPE}
140     ...    inner_src_ip=${CLIENT_IP}
141     ...    inner_dst_ip=${SERVER_IP}
142     ...    next_hop_ip=${GBPSFC1}
143     ...    nsp=${NSP_path1}
144     ...    nsi=253
145     ...    proto=${PROTO}
146
147 On GBPSFC1 Send HTTP req h35_2-h36_2 to h36_2
148     [Documentation]    HTTP traffic inspection.
149     Switch Connection    GPSFC1_CONNECTION
150     Inspect Classifier Inbound
151     ...    in_port=${VXLAN_GPE_PORT}
152     ...    out_port=6
153     ...    eth_type=${ETHER_TYPE}
154     ...    inner_src_ip=${CLIENT_IP}
155     ...    inner_dst_ip=${SERVER_IP}
156     ...    outer_src_ip=${GBPSFC4}
157     ...    outer_dst_ip=${GBPSFC1}
158     ...    nsp=${NSP_path1}
159     ...    nsi=253
160     ...    proto=${PROTO}
161
162 On GBPSFC1 Send HTTP resp h36_2-h35_2 to GBPSFC4
163     [Documentation]    HTTP traffic inspection.
164     Switch Connection    GPSFC1_CONNECTION
165     ${flow}    Inspect Classifier Outbound
166     ...    in_port=6
167     ...    out_port=${VXLAN_GPE_PORT}
168     ...    eth_type=${ETHER_TYPE}
169     ...    inner_src_ip=${SERVER_IP}
170     ...    inner_dst_ip=${CLIENT_IP}
171     ...    next_hop_ip=${GBPSFC4}
172     ...    nsi=255
173     ...    proto=${PROTO}
174     ...    src_port=${SERVICE_PORT}
175     ${nsp_36_2-nsp_35_2}    GET NSP Value From Flow    ${flow}
176     Set Global Variable    ${NSP_path2}    ${nsp_36_2-nsp_35_2}
177
178 On GBPSFC4 Send HTTP resp h36_2-h35_2 to GBPSFC5
179     [Documentation]    HTTP traffic inspection.
180     Switch Connection    GPSFC4_CONNECTION
181     Inspect Service Function Forwarder
182     ...    in_port=${VXLAN_GPE_PORT}
183     ...    out_port=${VXLAN_GPE_PORT}
184     ...    outer_src_ip=${GBPSFC1}
185     ...    outer_dst_ip=${GBPSFC4}
186     ...    eth_type=${ETHER_TYPE}
187     ...    inner_src_ip=${SERVER_IP}
188     ...    inner_dst_ip=${CLIENT_IP}
189     ...    next_hop_ip=${GBPSFC5}
190     ...    nsp=${NSP_path2}
191     ...    nsi=255
192     ...    proto=${PROTO}
193
194 On GBPSFC5 Send HTTP resp h36_2-h35_2 to GBPSFC4
195     [Documentation]    HTTP traffic inspection.
196     Switch Connection    GPSFC5_CONNECTION
197     Inspect Service Function
198     ...    in_port=${VXLAN_GPE_PORT}
199     ...    out_port=${VXLAN_GPE_PORT}
200     ...    outer_src_ip=${GBPSFC4}
201     ...    outer_dst_ip=${GBPSFC5}
202     ...    eth_type=${ETHER_TYPE}
203     ...    inner_src_ip=${SERVER_IP}
204     ...    inner_dst_ip=${CLIENT_IP}
205     ...    next_hop_ip=${GBPSFC4}
206     ...    nsp=${NSP_path2}
207     ...    received_nsi=255
208
209 On GBPSFC4 Send HTTP resp h36_2-h35_2 to GBPSFC2
210     [Documentation]    HTTP traffic inspection.
211     Switch Connection    GPSFC4_CONNECTION
212     Inspect Service Function Forwarder
213     ...    in_port=${VXLAN_GPE_PORT}
214     ...    out_port=${VXLAN_GPE_PORT}
215     ...    outer_src_ip=${GBPSFC5}
216     ...    outer_dst_ip=${GBPSFC4}
217     ...    eth_type=${ETHER_TYPE}
218     ...    inner_src_ip=${SERVER_IP}
219     ...    inner_dst_ip=${CLIENT_IP}
220     ...    next_hop_ip=${GBPSFC2}
221     ...    nsp=${NSP_path2}
222     ...    nsi=254
223     ...    proto=${PROTO}
224
225 On GBPSFC2 Send HTTP resp h36_2-h35_2 to GBPSFC3
226     [Documentation]    HTTP traffic inspection.
227     Switch Connection    GPSFC2_CONNECTION
228     Inspect Service Function Forwarder
229     ...    in_port=${VXLAN_GPE_PORT}
230     ...    out_port=${VXLAN_GPE_PORT}
231     ...    outer_src_ip=${GBPSFC4}
232     ...    outer_dst_ip=${GBPSFC2}
233     ...    eth_type=${ETHER_TYPE}
234     ...    inner_src_ip=${SERVER_IP}
235     ...    inner_dst_ip=${CLIENT_IP}
236     ...    next_hop_ip=${GBPSFC3}
237     ...    nsp=${NSP_path2}
238     ...    nsi=254
239     ...    proto=${PROTO}
240
241 On GBPSFC3 Send HTTP resp h36_2-h35_2 to GBPSFC2
242     [Documentation]    HTTP traffic inspection.
243     Switch Connection    GPSFC3_CONNECTION
244     Inspect Service Function
245     ...    in_port=${VXLAN_GPE_PORT}
246     ...    out_port=${VXLAN_GPE_PORT}
247     ...    outer_src_ip=${GBPSFC2}
248     ...    outer_dst_ip=${GBPSFC3}
249     ...    eth_type=${ETHER_TYPE}
250     ...    inner_src_ip=${SERVER_IP}
251     ...    inner_dst_ip=${CLIENT_IP}
252     ...    next_hop_ip=${GBPSFC2}
253     ...    nsp=${NSP_path2}
254     ...    received_nsi=254
255
256 On GBPSFC2 Send HTTP resp h36_2-h35_2 to GBPSFC1
257     [Documentation]    HTTP traffic inspection.
258     Switch Connection    GPSFC2_CONNECTION
259     Inspect Service Function Forwarder
260     ...    in_port=${VXLAN_GPE_PORT}
261     ...    out_port=${VXLAN_GPE_PORT}
262     ...    outer_src_ip=${GBPSFC3}
263     ...    outer_dst_ip=${GBPSFC2}
264     ...    eth_type=${ETHER_TYPE}
265     ...    inner_src_ip=${SERVER_IP}
266     ...    inner_dst_ip=${CLIENT_IP}
267     ...    next_hop_ip=${GBPSFC1}
268     ...    nsp=${NSP_path2}
269     ...    nsi=253
270     ...    proto=${PROTO}
271
272 On GBPSFC1 Send HTTP resp h36_2-h35_2 to h35_2
273     [Documentation]    HTTP traffic inspection.
274     Switch Connection    GPSFC1_CONNECTION
275     Inspect Classifier Inbound
276     ...    in_port=${VXLAN_GPE_PORT}
277     ...    out_port=4
278     ...    eth_type=${ETHER_TYPE}
279     ...    inner_src_ip=${SERVER_IP}
280     ...    inner_dst_ip=${CLIENT_IP}
281     ...    outer_src_ip=${GBPSFC2}
282     ...    outer_dst_ip=${GBPSFC1}
283     ...    nsp=${NSP_path2}
284     ...    nsi=253
285     ...    proto=${PROTO}
286
287 Compare NSPs
288     [Documentation]    Verifying that different paths were taken.
289     Should Not Be Equal As Numbers    ${NSP_path1}    ${NSP_path2}
290
291 Stop Endless Curl on h35_2 on port 80
292     [Documentation]    Stopping endless HTTP session after traffic inspection finishes.
293     Switch Connection    GPSFC1_CONNECTION
294     Stop Endless Curl from Docker    ${CLIENT_NAME}
295
296 Stop HTTP on h36_2 on Port 80
297     [Documentation]    Stopping HTTP service on the docker container.
298     Stop HTTP Service on Docker    ${SERVER_NAME}