Update Robot Framework format - step 7
[integration/test.git] / csit / suites / groupbasedpolicy / GBPSFC / 6-node / demo-asymmetric-chain / 035_track_curl_h35_2_h36_2.robot
1 *** Settings ***
2 Documentation       Deep inspection of HTTP traffic on asymmetric chain.
3 ...                 Nodes are located on the same VM.
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_2 on Port 80
17     [Documentation]    Starting HTTP service on docker container.
18     Set Test Variables
19     ...    client_name=h35_2
20     ...    client_ip=10.0.35.2
21     ...    server_name=h36_2
22     ...    server_ip=10.0.36.2
23     ...    service_port=80
24     ...    ether_type=0x0800
25     ...    proto=6
26     ...    vxlan_gpe_port=2
27     Switch Connection    GPSFC1_CONNECTION
28     Start HTTP Service on Docker    ${SERVER_NAME}    ${SERVICE_PORT}
29
30 Curl h36_2 from h35_2
31     [Documentation]    Test HTTP request from a docker container to serving docker container.
32     Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    ${SERVICE_PORT}
33
34 Start Endless Curl on h35_2 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_2-h36_2 to GBPSFC2
39     [Documentation]    HTTP traffic inspection.
40     Switch Connection    GPSFC1_CONNECTION
41     ${flow}    Inspect Classifier Outbound
42     ...    in_port=4
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_2-nsp_36_2}    GET NSP Value From Flow    ${flow}
52     Set Global Variable    ${NSP}    ${nsp_35_2-nsp_36_2}
53
54 On GBPSFC2 Send HTTP req h35_2-h36_2 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}
67     ...    nsi=255
68     ...    proto=${PROTO}
69
70 On GBPSFC3 Send HTTP req h35_2-h36_2 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}
83     ...    received_nsi=255
84
85 On GBPSFC2 Send HTTP req h35_2-h36_2 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}
98     ...    nsi=254
99     ...    proto=${PROTO}
100
101 On GBPSFC4 Send HTTP req h35_2-h36_2 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}
114     ...    nsi=254
115     ...    proto=${PROTO}
116
117 On GBPSFC5 Send HTTP req h35_2-h36_2 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}
130     ...    received_nsi=254
131
132 On GBPSFC4 Send HTTP req h35_2-h36_2 to GBPSFC1
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=${GBPSFC1}
144     ...    nsp=${NSP}
145     ...    nsi=253
146     ...    proto=${PROTO}
147
148 On GBPSFC1 Send HTTP req h35_2-h36_2 to h36_2
149     [Documentation]    HTTP traffic inspection.
150     Switch Connection    GPSFC1_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=${GBPSFC1}
159     ...    nsp=${NSP}
160     ...    nsi=253
161     ...    proto=${PROTO}
162
163 On GBPSFC1 Send HTTP resp h36_2-h35_2 to h35_2
164     [Documentation]    HTTP traffic inspection.
165     Switch Connection    GPSFC1_CONNECTION
166     ${flow}    Inspect Classifier Outbound
167     ...    in_port=6
168     ...    out_port=4
169     ...    eth_type=${ETHER_TYPE}
170     ...    inner_src_ip=${SERVER_IP}
171     ...    inner_dst_ip=${CLIENT_IP}
172     ...    proto=${PROTO}
173     ...    src_port=${SERVICE_PORT}
174
175 Stop Endless Curl on h36_2 on port 80
176     [Documentation]    Stopping endless HTTP session after traffic inspection finishes.
177     Stop Endless Curl from Docker    ${CLIENT_NAME}
178
179 Stop HTTP on h36_2 on Port 80
180     [Documentation]    Stopping HTTP service on the docker container.
181     Stop HTTP Service on Docker    ${SERVER_NAME}