bfae4ed86956f9a82c188794f7100ddbfacab561
[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 Library           SSHLibrary
5 Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
6 Resource          ../../../../../libraries/GBP/ConnUtils.robot
7 Resource          ../Variables.robot
8 Resource          ../Connections.robot
9 Suite Setup       Start Connections
10 Suite Teardown    Close Connections
11
12 *** Variables ***
13
14 *** Testcases ***
15
16 Start HTTP on h36_4 on Port 80
17     [Documentation]    Starting HTTP service on docker container.
18     Set Test Variables    client_name=h35_3   client_ip=10.0.35.3    server_name=h36_4    server_ip=10.0.36.4
19     ...   service_port=80    ether_type=0x0800    proto=6    vxlan_gpe_port=2    vxlan_port=3
20     Switch Connection    GPSFC6_CONNECTION
21     Start HTTP Service on Docker    ${SERVER_NAME}    ${SERVICE_PORT}
22
23 Curl h36_2 from h35_3
24     [Documentation]     Test HTTP request from a docker container to serving docker container.
25     Switch Connection    GPSFC1_CONNECTION
26     Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    service_port=${SERVICE_PORT}
27
28 Start Endless Curl on h35_3 on port 80
29     [Documentation]    Starting endless HTTP session for traffic inspection.
30     Start Endless Curl from Docker    ${CLIENT_NAME}    ${SERVER_IP}    ${SERVICE_PORT}    sleep=1
31
32 On GBPSFC1 Send HTTP req h35_3-h36_4 to GBPSFC2
33     [Documentation]    HTTP traffic inspection.
34     Switch Connection    GPSFC1_CONNECTION
35     ${flow}    Inspect Classifier Outbound    in_port=5    out_port=${VXLAN_GPE_PORT}    eth_type=${ETHER_TYPE}    inner_src_ip=${CLIENT_IP}
36     ...    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC2}    nsi=255    proto=${PROTO}   dst_port=${SERVICE_PORT}
37     ${nsp_35_3-nsp_36_4}    GET NSP Value From Flow    ${flow}
38     Set Global Variable    ${NSP}    ${nsp_35_3-nsp_36_4}
39
40 On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC3
41     [Documentation]    HTTP traffic inspection.
42     Switch Connection    GPSFC2_CONNECTION
43      Inspect Service Function Forwarder    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC1}    outer_dst_ip=${GBPSFC2}    eth_type=${ETHER_TYPE}
44     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC3}    nsp=${NSP}    nsi=255    proto=${PROTO}
45
46 On GBPSFC3 Send HTTP req h35_3-h36_4 to GBPSFC2
47     [Documentation]    HTTP traffic inspection.
48     Switch Connection    GPSFC3_CONNECTION
49     Inspect Service Function    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC2}    outer_dst_ip=${GBPSFC3}    eth_type=${ETHER_TYPE}
50     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC2}    nsp=${NSP}    received_nsi=255
51
52 On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC4
53     [Documentation]    HTTP traffic inspection.
54     Switch Connection    GPSFC2_CONNECTION
55      Inspect Service Function Forwarder    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC3}    outer_dst_ip=${GBPSFC2}    eth_type=${ETHER_TYPE}
56     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC4}    nsp=${NSP}    nsi=254    proto=${PROTO}
57
58 On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC5
59     [Documentation]    HTTP traffic inspection.
60     Switch Connection    GPSFC4_CONNECTION
61      Inspect Service Function Forwarder    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC2}    outer_dst_ip=${GBPSFC4}    eth_type=${ETHER_TYPE}
62     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC5}    nsp=${NSP}    nsi=254    proto=${PROTO}
63
64 On GBPSFC5 Send HTTP req h35_3-h36_4 to GBPSFC4
65     [Documentation]    HTTP traffic inspection.
66     Switch Connection    GPSFC5_CONNECTION
67     Inspect Service Function    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC4}    outer_dst_ip=${GBPSFC5}    eth_type=${ETHER_TYPE}
68     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC4}    nsp=${NSP}    received_nsi=254
69
70 On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC6
71     [Documentation]    HTTP traffic inspection.
72     Switch Connection    GPSFC4_CONNECTION
73      Inspect Service Function Forwarder    in_port=${VXLAN_GPE_PORT}    out_port=${VXLAN_GPE_PORT}    outer_src_ip=${GBPSFC5}    outer_dst_ip=${GBPSFC4}    eth_type=${ETHER_TYPE}
74     ...    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}    next_hop_ip=${GBPSFC6}    nsp=${NSP}    nsi=253    proto=${PROTO}
75
76 On GBPSFC6 Send HTTP req h35_3-h36_4 to h36_4
77     [Documentation]    HTTP traffic inspection.
78     Switch Connection    GPSFC6_CONNECTION
79     Inspect Classifier Inbound    in_port=${VXLAN_GPE_PORT}    out_port=6    eth_type=${ETHER_TYPE}    inner_src_ip=${CLIENT_IP}    inner_dst_ip=${SERVER_IP}
80     ...    outer_src_ip=${GBPSFC4}    outer_dst_ip=${GBPSFC6}    nsp=${NSP}    nsi=253    proto=${PROTO}
81
82 On GBPSFC6 Send HTTP resp h36_4-h35_3 to GBPSFC1
83     [Documentation]    HTTP traffic inspection.
84     Switch Connection    GPSFC6_CONNECTION
85     ${flow}    Inspect Classifier Outbound    in_port=6    out_port=${VXLAN_PORT}    eth_type=${ETHER_TYPE}    inner_src_ip=${SERVER_IP}
86     ...    inner_dst_ip=${CLIENT_IP}    next_hop_ip=${GBPSFC1}    proto=${PROTO}   src_port=${SERVICE_PORT}
87
88 On GBPSFC1 Send HTTP resp h36_4-h35_3 to h35_3
89     [Documentation]    HTTP traffic inspection.
90     Switch Connection    GPSFC1_CONNECTION
91     Inspect Classifier Inbound    in_port=${VXLAN_PORT}    out_port=5    eth_type=${ETHER_TYPE}    inner_src_ip=${SERVER_IP}    inner_dst_ip=${CLIENT_IP}
92     ...    outer_src_ip=${GBPSFC6}    outer_dst_ip=${GBPSFC1}    proto=${PROTO}
93
94 Stop Endless Curl on h36_2 on port 80
95     [Documentation]    Stopping endless HTTP session after traffic inspection finishes.
96     Switch Connection    GPSFC1_CONNECTION
97     Stop Endless Curl from Docker    ${CLIENT_NAME}
98
99 Stop HTTP on h36_2 on Port 80
100     [Documentation]    Stopping HTTP service on the docker container.
101     Switch Connection    GPSFC6_CONNECTION
102     Stop HTTP Service on Docker    ${SERVER_NAME}
103