Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / openflowplugin / Switch_Qualification / 010_OpenFlow_Connection.robot
1 *** Settings ***
2 Documentation     TODO
3 Suite Setup       Switch Qualification Suite Setup
4 Suite Teardown    Switch Qualification Suite Teardown
5 Test Timeout      5m
6 Library           Collections
7 Library           OperatingSystem
8 Resource          ../../../libraries/SwitchUtils.robot
9 Resource          ../../../libraries/Utils.robot
10 Library           RequestsLibrary
11 Library           ../../../libraries/Common.py
12 Library           ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
13 Variables         ../../../variables/Variables.py
14
15 *** Variables ***
16 ${SWITCH_CLASS}    Ovs
17 ${SWITCH_IP}      ${MININET}
18 ${SWITCH_PROMPT}    ${DEFAULT_LINUX_PROMPT}
19 ${CONTROLLER}     null
20 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
21
22 *** Test Cases ***
23 OF1.3 Connection Between Switch and Controller
24     [Tags]    switch_qualification
25     Configure OpenFlow    ${test_switch}
26     Enable OpenFlow    ${test_switch}
27     ${datapath_id_from_switch}=    Get Switch Datapath ID    ${test_switch}
28     Verify Switch In Operational Data Store    ${test_switch}
29     Disable OpenFlow    ${test_switch}
30     Wait Until Keyword Succeeds    3s    1s    Verify Switch Not In Operational Data Store    ${test_switch}
31     ##MORE CHECKS TO ADD ON SWITCH AND OPERATIONAL DATA STORE
32     ##- proper OF version
33     ##- proper default flow rules
34     ##- ???
35
36 *** Keywords ***
37 Switch Qualification Suite Setup
38     ${test_switch}=    Get Switch    ${SWITCH_CLASS}
39     Set Suite Variable    ${test_switch}
40     Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
41     Call Method    ${test_switch}    set_controller_ip    ${CONTROLLER}
42     Call Method    ${test_switch}    set_mgmt_prompt    ${SWITCH_PROMPT}
43     Log    MAKE: ${test_switch.make}\n MODEL: ${test_switch.model}\n IP: ${test_switch.mgmt_ip}\n PROMPT: ${test_switch.mgmt_prompt}\n CONTROLLER_IP: ${test_switch.of_controller_ip}\n MGMT_PROTOCOL: ${test_switch.mgmt_protocol}
44     Ping    ${test_switch.mgmt_ip}
45     Initialize Switch    ${test_switch}
46     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
47
48 Switch Qualification Suite Teardown
49     Cleanup Switch    ${test_switch}
50     SSHLibrary.Close All Connections
51     Telnet.Close All Connections