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