Enhanced debugging logs in GBP CSIT 29/39829/9
authorTomas Cechvala <tcechval@cisco.com>
Fri, 3 Jun 2016 10:30:12 +0000 (12:30 +0200)
committerVratko Polák <vrpolak@cisco.com>
Wed, 8 Jun 2016 14:52:20 +0000 (14:52 +0000)
 - fixed periodic curl
 - added logging for easier debugging

Change-Id: Ib00a74cec8b4abcb2f7d872e48d2cd46707544fb
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
csit/libraries/GBP/DockerUtils.robot
csit/libraries/GBP/OpenFlowUtils.robot
csit/suites/groupbasedpolicy/GBP/3-node/gbp1/040_show_data.robot [new file with mode: 0644]
csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/040_show_data.robot [new file with mode: 0644]
csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/040_show_data.robot [new file with mode: 0644]
csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/040_show_data.robot [new file with mode: 0644]
csit/variables/Variables.py

index dc96e77d8ef5a2027ccc99b19f30ff22530de451..1b9bc0ccd852144a70093ae7b7771ef0bdb7288b 100755 (executable)
@@ -1,6 +1,5 @@
 *** Settings ***
 Library           SSHLibrary
-Resource          ../Utils.robot
 
 *** Variables ***
 
@@ -34,7 +33,7 @@ Stop HTTP Service on Docker
     ${stdout}    SSHLibrary.Execute Command    docker exec ${docker_name} kill ${stdout}    return_stdout=True    return_stderr=False    return_rc=False
 
 Curl from Docker
-    [Arguments]    ${docker_name}    ${dest_address}    ${service_port}=80    ${connect_timeout}=2    ${retry}=3x    ${retry_after}=1s
+    [Arguments]    ${docker_name}    ${dest_address}    ${service_port}=80    ${connect_timeout}=2    ${retry}=5x    ${retry_after}=1s
     [Documentation]    Sends HTTP request to remote server. Endless curl should not be running.
     ${output}    SSHLibrary.Execute Command    docker exec ${docker_name} ls | grep curl_running    return_stdout=True    return_stderr=False    return_rc=False
     Should Be Empty    ${output}
@@ -48,8 +47,7 @@ Start Endless Curl from Docker
     Should Be Empty    ${output}
     ${output}    SSHLibrary.Execute Command    docker exec ${docker_name} touch curl_running && echo success    return_stdout=True    return_stderr=False    return_rc=False
     Should Contain    ${output}    success
-    Wait Until Keyword Succeeds    ${retry}    ${retry_after}    Execute Curl    ${docker_name}    ${dest_address}    ${service_port}
-    ...    endless="TRUE"    sleep=${sleep}
+    Execute Curl    ${docker_name}    ${dest_address}    ${service_port}    endless="TRUE"
 
 Stop Endless Curl from Docker
     [Arguments]    ${docker_name}
@@ -77,7 +75,8 @@ Test Port On Docker
 Execute Curl
     [Arguments]    ${docker_name}    ${dest_address}    ${service_port}    ${endless}="FALSE"    ${sleep}=1
     [Documentation]    Executes curl or curl loop for caller methods based on given parameters.
-    ${output}    SSHLibrary.Execute Command    docker exec ${docker_name} curl ${dest_address}:${service_port} >/dev/null 2>&1 && echo success
+    Run Keyword If    ${endless} == "TRUE"    Run Keywords
+    ...    SSHLibrary.Execute Command    docker exec -d ${docker_name} /bin/sh -c "while [ -f curl_running ]; do curl ${dest_address}:${service_port} -m 1 && sleep ${sleep}; done"
+    ...    AND    Return From Keyword
+    ${output}    SSHLibrary.Execute Command    docker exec ${docker_name} curl ${dest_address}:${service_port} -m 5 >/dev/null 2>&1 && echo success
     Should Contain    ${output}    success
-    Run Keyword If    ${endless} == "TRUE"    SSHLibrary.Execute Command    docker exec -d ${docker_name} /bin/sh -c "while [ -f curl_running ]; do curl ${dest_address}:${service_port} ; sleep ${sleep}; done"
-    Log    ${output}
index 721e3b697ab649ce18aa35d64178c4fe2338292d..73bfc8bb69ccb810c247b8a4a0b1608913509655 100644 (file)
@@ -252,6 +252,14 @@ Wait For Flows On Switch
     Wait Until Keyword Succeeds    120s    20s    Count Flows On Switch    ${switch_name}
     SSHLibrary.Close Connection
 
+Show Switch Status
+    [Arguments]    ${switch_name}
+    [Documentation]    Shows status of a switch for easier debugging.
+    ${stdout}    ${stderr}    SSHLibrary.Execute Command    sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13    return_stderr=True
+    Log    ${stdout}
+    ${stdout}    ${stderr}    SSHLibrary.Execute Command    sudo ovs-vsctl show    return_stderr=True
+    Log    ${stdout}
+
 Count Flows On Switch
     [Arguments]    ${switch_name}
     ${out}    SSHLibrary.Execute Command    printf "%d" $(($(sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 | wc -l)-1))
diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/040_show_data.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/040_show_data.robot
new file mode 100644 (file)
index 0000000..a6746de
--- /dev/null
@@ -0,0 +1,59 @@
+*** Settings ***
+Documentation     Deep inspection of HTTP traffic on asymmetric chain.
+...               Nodes are located on different VMs.
+Library           SSHLibrary
+Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
+Resource          ../../../../../libraries/GBP/ConnUtils.robot
+Resource          ../Variables.robot
+Resource          ../Connections.robot
+
+*** Variables ***
+
+*** Testcases ***
+Show GBPSFC1 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Start Connections
+    Switch Connection   GPSFC1_CONNECTION
+    Show Switch Status  sw1
+
+Show GBPSFC2 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC2_CONNECTION
+    Show Switch Status  sw2
+
+Show GBPSFC3 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC3_CONNECTION
+    Show Switch Status  sw3
+    Close Connections
+
+Read Tenants Confing From ODL
+    [Documentation]    Logs ODL data store.
+    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_YANG_JSON}
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Tenants Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Nodes Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
+    Log    ${resp.content}
+
+Read Nodes Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    Log    ${resp.content}
+
+Read Topology Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
+
+Read Topology Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Log    ${resp.content}
+
+Read Endpoints From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_ENDPOINTS_API}
+    Log    ${resp.content}
+    Delete All Sessions
diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/040_show_data.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/040_show_data.robot
new file mode 100644 (file)
index 0000000..a6746de
--- /dev/null
@@ -0,0 +1,59 @@
+*** Settings ***
+Documentation     Deep inspection of HTTP traffic on asymmetric chain.
+...               Nodes are located on different VMs.
+Library           SSHLibrary
+Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
+Resource          ../../../../../libraries/GBP/ConnUtils.robot
+Resource          ../Variables.robot
+Resource          ../Connections.robot
+
+*** Variables ***
+
+*** Testcases ***
+Show GBPSFC1 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Start Connections
+    Switch Connection   GPSFC1_CONNECTION
+    Show Switch Status  sw1
+
+Show GBPSFC2 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC2_CONNECTION
+    Show Switch Status  sw2
+
+Show GBPSFC3 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC3_CONNECTION
+    Show Switch Status  sw3
+    Close Connections
+
+Read Tenants Confing From ODL
+    [Documentation]    Logs ODL data store.
+    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_YANG_JSON}
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Tenants Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Nodes Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
+    Log    ${resp.content}
+
+Read Nodes Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    Log    ${resp.content}
+
+Read Topology Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
+
+Read Topology Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Log    ${resp.content}
+
+Read Endpoints From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_ENDPOINTS_API}
+    Log    ${resp.content}
+    Delete All Sessions
diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/040_show_data.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/040_show_data.robot
new file mode 100644 (file)
index 0000000..feedcd7
--- /dev/null
@@ -0,0 +1,73 @@
+*** Settings ***
+Documentation     Deep inspection of HTTP traffic on asymmetric chain.
+...               Nodes are located on different VMs.
+Library           SSHLibrary
+Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
+Resource          ../../../../../libraries/GBP/ConnUtils.robot
+Resource          ../Variables.robot
+Resource          ../Connections.robot
+
+*** Variables ***
+
+*** Testcases ***
+Show GBPSFC1 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Start Connections
+    Switch Connection   GPSFC1_CONNECTION
+    Show Switch Status  sw1
+
+Show GBPSFC2 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC2_CONNECTION
+    Show Switch Status  sw2
+
+Show GBPSFC3 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC3_CONNECTION
+    Show Switch Status  sw3
+
+Show GBPSFC4 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC4_CONNECTION
+    Show Switch Status  sw4
+Show GBPSFC5 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC5_CONNECTION
+    Show Switch Status  sw5
+
+Show GBPSFC6 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC6_CONNECTION
+    Show Switch Status  sw6
+    Close Connections
+
+Read Tenants Confing From ODL
+    [Documentation]    Logs ODL data store.
+    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_YANG_JSON}
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Tenants Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Nodes Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
+    Log    ${resp.content}
+
+Read Nodes Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    Log    ${resp.content}
+
+Read Topology Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
+
+Read Topology Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Log    ${resp.content}
+
+Read Endpoints From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_ENDPOINTS_API}
+    Log    ${resp.content}
+    Delete All Sessions
diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/040_show_data.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/040_show_data.robot
new file mode 100644 (file)
index 0000000..feedcd7
--- /dev/null
@@ -0,0 +1,73 @@
+*** Settings ***
+Documentation     Deep inspection of HTTP traffic on asymmetric chain.
+...               Nodes are located on different VMs.
+Library           SSHLibrary
+Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
+Resource          ../../../../../libraries/GBP/ConnUtils.robot
+Resource          ../Variables.robot
+Resource          ../Connections.robot
+
+*** Variables ***
+
+*** Testcases ***
+Show GBPSFC1 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Start Connections
+    Switch Connection   GPSFC1_CONNECTION
+    Show Switch Status  sw1
+
+Show GBPSFC2 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC2_CONNECTION
+    Show Switch Status  sw2
+
+Show GBPSFC3 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC3_CONNECTION
+    Show Switch Status  sw3
+
+Show GBPSFC4 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC4_CONNECTION
+    Show Switch Status  sw4
+Show GBPSFC5 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC5_CONNECTION
+    Show Switch Status  sw5
+
+Show GBPSFC6 Status
+    [Documentation]     Shows flows and configuration of a switch for easier debugging.
+    Switch Connection   GPSFC6_CONNECTION
+    Show Switch Status  sw6
+    Close Connections
+
+Read Tenants Confing From ODL
+    [Documentation]    Logs ODL data store.
+    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_YANG_JSON}
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Tenants Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_GBP_TENANTS_API}
+    Log    ${resp.content}
+
+Read Nodes Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
+    Log    ${resp.content}
+
+Read Nodes Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    Log    ${resp.content}
+
+Read Topology Config From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
+
+Read Topology Operational From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Log    ${resp.content}
+
+Read Endpoints From ODL
+    ${resp}    RequestsLibrary.Get Request    session    ${GBP_ENDPOINTS_API}
+    Log    ${resp.content}
+    Delete All Sessions
index 1fc59edae8ebe2d93a2844e1ef7cc5c6aa6d9979..65a1479cff55df978631c9622dbca6cb514f0e66 100644 (file)
@@ -155,7 +155,10 @@ CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH = "MininetTopo/" +\
 
 GBP_REGEP_API = "/restconf/operations/endpoint:register-endpoint"
 GBP_UNREGEP_API = "/restconf/operations/endpoint:unregister-endpoint"
+GBP_ENDPOINTS_API = "/restconf/operational/endpoint:endpoints"
+GBP_BASE_ENDPOINTS_API = "/restconf/operational/base-endpoint:endpoints"
 GBP_TENANTS_API = "/restconf/config/policy:tenants"
+OPERATIONAL_GBP_TENANTS_API = "/restconf/operational/policy:tenants"
 GBP_TUNNELS_API = "/restconf/config/opendaylight-inventory:nodes"
 
 # LISP Flow Mapping variables