Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / openflowplugin / Switch_Qualification / 010_OpenFlow_Connection.robot
1 *** Settings ***
2 Documentation       TODO
3
4 Library             Collections
5 Library             OperatingSystem
6 Library             RequestsLibrary
7 Library             ../../../libraries/Common.py
8 Library             ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
9 Variables           ../../../variables/Variables.py
10 Resource            ../../../libraries/SwitchUtils.robot
11 Resource            ../../../libraries/Utils.robot
12 Resource            ../../../variables/openflowplugin/Variables.robot
13
14 Suite Setup         Switch Qualification Suite Setup
15 Suite Teardown      Switch Qualification Suite Teardown
16 Test Timeout        5m
17
18
19 *** Variables ***
20 ${SWITCH_CLASS}     Ovs
21 ${SWITCH_IP}        ${TOOLS_SYSTEM_IP}
22 ${SWITCH_PROMPT}    ${TOOLS_SYSTEM_PROMPT}
23 ${ODL_SYSTEM_IP}    null
24 ${REST_CONTEXT}     ${RFC8040_NODES_API}
25
26
27 *** Test Cases ***
28 OF1.3 Connection Between Switch and Controller
29     [Tags]    switch_qualification
30     Configure OpenFlow    ${test_switch}
31     Enable OpenFlow    ${test_switch}
32     ${datapath_id_from_switch}=    Get Switch Datapath ID    ${test_switch}
33     Verify Switch In Operational Data Store    ${test_switch}
34     Disable OpenFlow    ${test_switch}
35     Wait Until Keyword Succeeds    3s    1s    Verify Switch Not In Operational Data Store    ${test_switch}
36     ##MORE CHECKS TO ADD ON SWITCH AND OPERATIONAL DATA STORE
37     ##- proper OF version
38     ##- proper default flow rules
39     ##- ???
40
41
42 *** Keywords ***
43 Switch Qualification Suite Setup
44     ${test_switch}=    Get Switch    ${SWITCH_CLASS}
45     Set Suite Variable    ${test_switch}
46     Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
47     Call Method    ${test_switch}    set_controller_ip    ${ODL_SYSTEM_IP}
48     Call Method    ${test_switch}    set_mgmt_prompt    ${SWITCH_PROMPT}
49     Log
50     ...    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}
51     Ping    ${test_switch.mgmt_ip}
52     Initialize Switch    ${test_switch}
53     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
54
55 Switch Qualification Suite Teardown
56     Cleanup Switch    ${test_switch}
57     SSHLibrary.Close All Connections
58     Telnet.Close All Connections