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