Add more commands to completely cleanup the OVS instance.
[integration/test.git] / test / 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.txt
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     Run Command On Remote System    ${MININET}    sudo ovs-vsctl --if-exists del-port br-int
38     Run Command On Remote System    ${MININET}    sudo ovs-vsctl --if-exists del-br br-int
39     Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
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 controller connection
47     [Documentation]    This will make sure the controller is correctly set up/connected
48     [Tags]    OVSDB netvirt
49     ${output}    Run Command On Remote System    ${MININET}    sudo ovs-vsctl show
50     Should Contain    ${output}    Manager "tcp:${CONTROLLER}:${OVSDB_PORT}"
51     Should Contain    ${output}    is_connected: true
52
53 Get bridge setup
54     [Documentation]    This request is verifying that the br-int bridge has been created
55     [Tags]    OVSDB netvirt
56     ${output}    Run Command On Remote System    ${MININET}    sudo ovs-vsctl show
57     Should Contain    ${output}    Controller "tcp:${CONTROLLER}:${OF_PORT}"
58     Should Contain    ${output}    Bridge br-int
59
60 Get port setup
61     [Documentation]    This will check the port br-int has been created
62     [Tags]    OVSDB netvirt
63     ${output}    Run Command On Remote System    ${MININET}    sudo ovs-vsctl show
64     Should Contain    ${output}    Port br-int
65
66 Get interface setup
67     [Documentation]    This verify the interface br-int has been created
68     [Tags]    OVSDB netvirt
69     ${output}    Run Command On Remote System    ${MININET}    sudo ovs-vsctl show
70     Should Contain    ${output}    Interface br-int
71
72 Get the bridge flows
73     [Documentation]    This request fetch the OF13 flow tables to verify the flows are correctly added
74     [Tags]    OVSDB netvirt
75     ${output}    Run Command On Remote System    ${MININET}    sudo ovs-ofctl -O Openflow13 dump-flows br-int
76     Should Contain    ${output}    ${FLOWS_TABLE_20}
77     Should Contain    ${output}    ${FLOW_CONTROLLER}
78     Should Contain    ${output}    ${FLOWS_TABLE_30}
79     Should Contain    ${output}    ${FLOWS_TABLE_40}
80     Should Contain    ${output}    ${FLOWS_TABLE_50}
81     Should Contain    ${output}    ${FLOWS_TABLE_60}
82     Should Contain    ${output}    ${FLOWS_TABLE_70}
83     Should Contain    ${output}    ${FLOWS_TABLE_80}
84     Should Contain    ${output}    ${FLOWS_TABLE_90}
85     Should Contain    ${output}    ${FLOWS_TABLE_100}
86     Should Contain    ${output}    ${FLOWS_TABLE_110}
87     Should Contain    ${output}    ${FLOW_DROP}