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