Update Robot Framework format - step 7
[integration/test.git] / csit / suites / groupbasedpolicy / GBPSFC / 6-node / demo-asymmetric-chain / 036_track_curl_h35_3_h36_4.robot
1 *** Settings ***
2 Documentation       Deep inspection of HTTP traffic on asymmetric chain.
3 ...                 Nodes are located on different VMs.
4
5 Library             SSHLibrary
6 Resource            ../../../../../libraries/GBP/OpenFlowUtils.robot
7 Resource            ../../../../../libraries/GBP/ConnUtils.robot
8 Resource            ../Variables.robot
9 Resource            ../Connections.robot
10
11 Suite Setup         Start Connections
12 Suite Teardown      Close Connections
13
14
15 *** Test Cases ***
16 Start HTTP on h36_4 on Port 80
17     [Documentation]    Starting HTTP service on docker container.
18     Set Test Variables
19     ...    client_name=h35_3
20     ...    client_ip=10.0.35.3
21     ...    server_name=h36_4
22     ...    server_ip=10.0.36.4
23     ...    service_port=80
24     ...    ether_type=0x0800
25     ...    proto=6
26     ...    vxlan_gpe_port=2
27     ...    vxlan_port=3
28     Switch Connection    GPSFC6_CONNECTION
29     Start HTTP Service on Docker    ${SERVER_NAME}    ${SERVICE_PORT}
30
31 Curl h36_2 from h35_3
32     [Documentation]    Test HTTP request from a docker container to serving docker container.
33     Switch Connection    GPSFC1_CONNECTION
34     Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    service_port=${SERVICE_PORT}
35
36 Start Endless Curl on h35_3 on port 80
37     [Documentation]    Starting endless HTTP session for traffic inspection.
38     Start Endless Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    ${SERVICE_PORT}    sleep=1
39
40 On GBPSFC1 Send HTTP req h35_3-h36_4 to GBPSFC2
41     [Documentation]    HTTP traffic inspection.
42     Switch Connection    GPSFC1_CONNECTION
43     ${flow}    Inspect Classifier Outbound
44     ...    in_port=5
45     ...    out_port=${VXLAN_GPE_PORT}
46     ...    eth_type=${ETHER_TYPE}
47     ...    inner_src_ip=${CLIENT_IP}
48     ...    inner_dst_ip=${SERVER_IP}
49     ...    next_hop_ip=${GBPSFC2}
50     ...    nsi=255
51     ...    proto=${PROTO}
52     ...    dst_port=${SERVICE_PORT}
53     ${nsp_35_3-nsp_36_4}    GET NSP Value From Flow    ${flow}
54     Set Global Variable    ${NSP}    ${nsp_35_3-nsp_36_4}
55
56 On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC3
57     [Documentation]    HTTP traffic inspection.
58     Switch Connection    GPSFC2_CONNECTION
59     Inspect Service Function Forwarder
60     ...    in_port=${VXLAN_GPE_PORT}
61     ...    out_port=${VXLAN_GPE_PORT}
62     ...    outer_src_ip=${GBPSFC1}
63     ...    outer_dst_ip=${GBPSFC2}
64     ...    eth_type=${ETHER_TYPE}
65     ...    inner_src_ip=${CLIENT_IP}
66     ...    inner_dst_ip=${SERVER_IP}
67     ...    next_hop_ip=${GBPSFC3}
68     ...    nsp=${NSP}
69     ...    nsi=255
70     ...    proto=${PROTO}
71
72 On GBPSFC3 Send HTTP req h35_3-h36_4 to GBPSFC2
73     [Documentation]    HTTP traffic inspection.
74     Switch Connection    GPSFC3_CONNECTION
75     Inspect Service Function
76     ...    in_port=${VXLAN_GPE_PORT}
77     ...    out_port=${VXLAN_GPE_PORT}
78     ...    outer_src_ip=${GBPSFC2}
79     ...    outer_dst_ip=${GBPSFC3}
80     ...    eth_type=${ETHER_TYPE}
81     ...    inner_src_ip=${CLIENT_IP}
82     ...    inner_dst_ip=${SERVER_IP}
83     ...    next_hop_ip=${GBPSFC2}
84     ...    nsp=${NSP}
85     ...    received_nsi=255
86
87 On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC4
88     [Documentation]    HTTP traffic inspection.
89     Switch Connection    GPSFC2_CONNECTION
90     Inspect Service Function Forwarder
91     ...    in_port=${VXLAN_GPE_PORT}
92     ...    out_port=${VXLAN_GPE_PORT}
93     ...    outer_src_ip=${GBPSFC3}
94     ...    outer_dst_ip=${GBPSFC2}
95     ...    eth_type=${ETHER_TYPE}
96     ...    inner_src_ip=${CLIENT_IP}
97     ...    inner_dst_ip=${SERVER_IP}
98     ...    next_hop_ip=${GBPSFC4}
99     ...    nsp=${NSP}
100     ...    nsi=254
101     ...    proto=${PROTO}
102
103 On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC5
104     [Documentation]    HTTP traffic inspection.
105     Switch Connection    GPSFC4_CONNECTION
106     Inspect Service Function Forwarder
107     ...    in_port=${VXLAN_GPE_PORT}
108     ...    out_port=${VXLAN_GPE_PORT}
109     ...    outer_src_ip=${GBPSFC2}
110     ...    outer_dst_ip=${GBPSFC4}
111     ...    eth_type=${ETHER_TYPE}
112     ...    inner_src_ip=${CLIENT_IP}
113     ...    inner_dst_ip=${SERVER_IP}
114     ...    next_hop_ip=${GBPSFC5}
115     ...    nsp=${NSP}
116     ...    nsi=254
117     ...    proto=${PROTO}
118
119 On GBPSFC5 Send HTTP req h35_3-h36_4 to GBPSFC4
120     [Documentation]    HTTP traffic inspection.
121     Switch Connection    GPSFC5_CONNECTION
122     Inspect Service Function
123     ...    in_port=${VXLAN_GPE_PORT}
124     ...    out_port=${VXLAN_GPE_PORT}
125     ...    outer_src_ip=${GBPSFC4}
126     ...    outer_dst_ip=${GBPSFC5}
127     ...    eth_type=${ETHER_TYPE}
128     ...    inner_src_ip=${CLIENT_IP}
129     ...    inner_dst_ip=${SERVER_IP}
130     ...    next_hop_ip=${GBPSFC4}
131     ...    nsp=${NSP}
132     ...    received_nsi=254
133
134 On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC6
135     [Documentation]    HTTP traffic inspection.
136     Switch Connection    GPSFC4_CONNECTION
137     Inspect Service Function Forwarder
138     ...    in_port=${VXLAN_GPE_PORT}
139     ...    out_port=${VXLAN_GPE_PORT}
140     ...    outer_src_ip=${GBPSFC5}
141     ...    outer_dst_ip=${GBPSFC4}
142     ...    eth_type=${ETHER_TYPE}
143     ...    inner_src_ip=${CLIENT_IP}
144     ...    inner_dst_ip=${SERVER_IP}
145     ...    next_hop_ip=${GBPSFC6}
146     ...    nsp=${NSP}
147     ...    nsi=253
148     ...    proto=${PROTO}
149
150 On GBPSFC6 Send HTTP req h35_3-h36_4 to h36_4
151     [Documentation]    HTTP traffic inspection.
152     Switch Connection    GPSFC6_CONNECTION
153     Inspect Classifier Inbound
154     ...    in_port=${VXLAN_GPE_PORT}
155     ...    out_port=6
156     ...    eth_type=${ETHER_TYPE}
157     ...    inner_src_ip=${CLIENT_IP}
158     ...    inner_dst_ip=${SERVER_IP}
159     ...    outer_src_ip=${GBPSFC4}
160     ...    outer_dst_ip=${GBPSFC6}
161     ...    nsp=${NSP}
162     ...    nsi=253
163     ...    proto=${PROTO}
164
165 On GBPSFC6 Send HTTP resp h36_4-h35_3 to GBPSFC1
166     [Documentation]    HTTP traffic inspection.
167     Switch Connection    GPSFC6_CONNECTION
168     ${flow}    Inspect Classifier Outbound
169     ...    in_port=6
170     ...    out_port=${VXLAN_PORT}
171     ...    eth_type=${ETHER_TYPE}
172     ...    inner_src_ip=${SERVER_IP}
173     ...    inner_dst_ip=${CLIENT_IP}
174     ...    next_hop_ip=${GBPSFC1}
175     ...    proto=${PROTO}
176     ...    src_port=${SERVICE_PORT}
177
178 On GBPSFC1 Send HTTP resp h36_4-h35_3 to h35_3
179     [Documentation]    HTTP traffic inspection.
180     Switch Connection    GPSFC1_CONNECTION
181     Inspect Classifier Inbound
182     ...    in_port=${VXLAN_PORT}
183     ...    out_port=5
184     ...    eth_type=${ETHER_TYPE}
185     ...    inner_src_ip=${SERVER_IP}
186     ...    inner_dst_ip=${CLIENT_IP}
187     ...    outer_src_ip=${GBPSFC6}
188     ...    outer_dst_ip=${GBPSFC1}
189     ...    proto=${PROTO}
190
191 Stop Endless Curl on h36_2 on port 80
192     [Documentation]    Stopping endless HTTP session after traffic inspection finishes.
193     Switch Connection    GPSFC1_CONNECTION
194     Stop Endless Curl from Docker    ${CLIENT_NAME}
195
196 Stop HTTP on h36_2 on Port 80
197     [Documentation]    Stopping HTTP service on the docker container.
198     Switch Connection    GPSFC6_CONNECTION
199     Stop HTTP Service on Docker    ${SERVER_NAME}