log testcase starts for netvirt
[integration/test.git] / csit / suites / netvirt / Openstack_Neutron / 001__connection_manager.robot
1 *** Settings ***
2 Documentation     Test suite connecting ODL to Mininet
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Test Setup        Log Testcase Start To Controller Karaf
6 Test Teardown     Collect OVSDB Debugs
7 Library           SSHLibrary
8 Library           Collections
9 Library           OperatingSystem
10 Library           String
11 Library           DateTime
12 Library           RequestsLibrary
13 Library           ../../../libraries/Common.py
14 Variables         ../../../variables/Variables.py
15 Resource          ../../../libraries/Utils.robot
16 Resource          ../../../libraries/OVSDB.robot
17
18 *** Variables ***
19 ${OVSDB_PORT}     6640
20 ${OF_PORT}        6653
21 ${FLOWS_TABLE_20}    actions=goto_table:20
22 ${FLOW_CONTROLLER}    actions=CONTROLLER:65535
23 ${FLOWS_TABLE_30}    actions=goto_table:30
24 ${FLOWS_TABLE_40}    actions=goto_table:40
25 ${FLOWS_TABLE_50}    actions=goto_table:50
26 ${FLOWS_TABLE_60}    actions=goto_table:60
27 ${FLOWS_TABLE_70}    actions=goto_table:70
28 ${FLOWS_TABLE_80}    actions=goto_table:80
29 ${FLOWS_TABLE_90}    actions=goto_table:90
30 ${FLOWS_TABLE_100}    actions=goto_table:100
31 ${FLOWS_TABLE_110}    actions=goto_table:110
32 ${FLOW_DROP}      actions=drop
33 ${PING_NOT_CONTAIN}    Destination Host Unreachable
34 @{node_list}      ovsdb://uuid/
35
36 *** Test Cases ***
37 Make the OVS instance to listen for connection
38     [Documentation]    Connect OVS to ODL
39     [Tags]    OVSDB netvirt
40     Clean Up Ovs    ${TOOLS_SYSTEM_IP}
41     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDB_PORT}
42     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
43     ${pingresult}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    ping ${ODL_SYSTEM_IP} -c 4
44     Should Not Contain    ${pingresult}    ${PING_NOT_CONTAIN}
45     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
46
47 Get manager connection
48     [Documentation]    This will verify if the OVS manager is connected
49     [Tags]    OVSDB netvirt
50     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
51     ${lines}=    Get Lines Containing String    ${output}    is_connected
52     ${manager}=    Get Line    ${lines}    0
53     Should Contain    ${manager}    true
54
55 Get controller connection
56     [Documentation]    This will verify if the OpenFlow controller is connected on all bridges
57     [Tags]    OVSDB netvirt
58     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
59     ${lines}=    Get Lines Containing String    ${output}    is_connected
60     ${list}=    Split String    ${lines}    \n
61     Remove From List    ${list}    0
62     : FOR    ${controller}    IN    @{list}
63     \    Should Contain    ${controller}    true
64
65 Get bridge setup
66     [Documentation]    This request is verifying that the br-int bridge has been created
67     [Tags]    OVSDB netvirt
68     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
69     Should Contain    ${output}    Controller "tcp:${ODL_SYSTEM_IP}:${OF_PORT}"
70     Should Contain    ${output}    Bridge br-int
71
72 Get port setup
73     [Documentation]    This will check the port br-int has been created
74     [Tags]    OVSDB netvirt
75     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
76     Should Contain    ${output}    Port br-int
77
78 Get interface setup
79     [Documentation]    This verify the interface br-int has been created
80     [Tags]    OVSDB netvirt
81     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
82     Should Contain    ${output}    Interface br-int
83
84 Get the bridge flows
85     [Documentation]    This request fetch the OF13 flow tables to verify the flows are correctly added
86     [Tags]    OVSDB netvirt
87     ${output}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-ofctl -O Openflow13 dump-flows br-int
88     Should Contain    ${output}    ${FLOWS_TABLE_20}
89     Should Contain    ${output}    ${FLOW_CONTROLLER}
90     Should Contain    ${output}    ${FLOWS_TABLE_30}
91     Should Contain    ${output}    ${FLOWS_TABLE_40}
92     Should Contain    ${output}    ${FLOWS_TABLE_50}
93     Should Contain    ${output}    ${FLOWS_TABLE_60}
94     Should Contain    ${output}    ${FLOWS_TABLE_70}
95     Should Contain    ${output}    ${FLOWS_TABLE_80}
96     Should Contain    ${output}    ${FLOWS_TABLE_90}
97     Should Contain    ${output}    ${FLOWS_TABLE_100}
98     Should Contain    ${output}    ${FLOWS_TABLE_110}
99     Should Contain    ${output}    ${FLOW_DROP}