Replace Bierman02 with RFC8040 for OpenFlow Plugin
[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 Library           RequestsLibrary
9 Library           ../../../libraries/Common.py
10 Library           ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
11 Variables         ../../../variables/Variables.py
12 Resource          ../../../libraries/SwitchUtils.robot
13 Resource          ../../../libraries/Utils.robot
14 Resource          ../../../variables/openflowplugin/Variables.robot
15
16 *** Variables ***
17 ${SWITCH_CLASS}    Ovs
18 ${SWITCH_IP}      ${TOOLS_SYSTEM_IP}
19 ${SWITCH_PROMPT}    ${TOOLS_SYSTEM_PROMPT}
20 ${ODL_SYSTEM_IP}    null
21 ${REST_CONTEXT}    ${RFC8040_NODES_API}
22
23 *** Test Cases ***
24 OF1.3 Connection Between Switch and Controller
25     [Tags]    switch_qualification
26     Configure OpenFlow    ${test_switch}
27     Enable OpenFlow    ${test_switch}
28     ${datapath_id_from_switch}=    Get Switch Datapath ID    ${test_switch}
29     Verify Switch In Operational Data Store    ${test_switch}
30     Disable OpenFlow    ${test_switch}
31     Wait Until Keyword Succeeds    3s    1s    Verify Switch Not In Operational Data Store    ${test_switch}
32     ##MORE CHECKS TO ADD ON SWITCH AND OPERATIONAL DATA STORE
33     ##- proper OF version
34     ##- proper default flow rules
35     ##- ???
36
37 *** Keywords ***
38 Switch Qualification Suite Setup
39     ${test_switch}=    Get Switch    ${SWITCH_CLASS}
40     Set Suite Variable    ${test_switch}
41     Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
42     Call Method    ${test_switch}    set_controller_ip    ${ODL_SYSTEM_IP}
43     Call Method    ${test_switch}    set_mgmt_prompt    ${SWITCH_PROMPT}
44     Log    MAKE: ${test_switch.make}\nMODEL: ${test_switch.model}\nIP: ${test_switch.mgmt_ip}\nPROMPT: ${test_switch.mgmt_prompt}\nCONTROLLER_IP: ${test_switch.of_controller_ip}\nMGMT_PROTOCOL: ${test_switch.mgmt_protocol}
45     Ping    ${test_switch.mgmt_ip}
46     Initialize Switch    ${test_switch}
47     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
48
49 Switch Qualification Suite Teardown
50     Cleanup Switch    ${test_switch}
51     SSHLibrary.Close All Connections
52     Telnet.Close All Connections