Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / didm / discovery / device_discovery.robot
1 *** Settings ***
2 Documentation       Basic Tests for DIDM in Beryllium.
3 ...
4 ...                 Copyright (c) 2015 Hewlett Packard Enterprise Development LP and others. All rights reserved.
5 ...                 This program and the accompanying materials are made available under the terms of the Eclipse
6 ...                 Public License v1.0 which accompanies this distribution, and is available at
7 ...                 http://www.eclipse.org/legal/ep1-v10.html
8
9 Library             SSHLibrary
10 Library             Collections
11 Library             RequestsLibrary
12 Resource            ../../../variables/DIDM/Variables.robot
13 Variables           ../../../variables/Variables.py
14 Resource            ../../../libraries/Utils.robot
15 Resource            ../../../libraries/MininetKeywords.robot
16 Resource            ../../../libraries/DIDMKeywords.robot
17 Resource            ../../../libraries/KarafKeywords.robot
18 Resource            ../../../libraries/SetupUtils.robot
19
20 Suite Setup         Setup DIDM Environment
21 Suite Teardown      DIDM Suite Teardown
22 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
23
24
25 *** Test Cases ***
26 Identifying Unknown Device
27     [Documentation]    Verify other devices are identified as unknown
28     [Tags]    didm
29     ${unknown_device_ip}=    Set Variable    1.1.1.1
30     ${device_ip}=    Check Device IP
31     Should Not Match    ${device_ip}    ${unknown_device_ip}
32
33 Identifying Device Type
34     [Documentation]    Verify device type
35     [Tags]    didm
36     ${device_type}=    Find Device Type
37     Log    ${device_type}
38     Should Match    ${DEVICE_TYPE}    ${device_type}
39
40 Identifying Hardware Information
41     [Documentation]    Verify device hardware information
42     [Tags]    didm
43     ${device_hw}=    Find Device Hardware
44     Log    ${device_hw}
45     Should Match    ${DEVICE_HW_INFO}    ${device_hw}
46
47 Identifying Manufacturer
48     [Documentation]    Verify device manufacturer
49     [Tags]    didm
50     ${manufacture}=    Find Device Manufacturer
51     Log    ${manufacture}
52     Should Match    ${DEVICE_MANUFACTURE}    ${manufacture}
53
54 Identifying Serial Number
55     [Documentation]    Verify device serial number
56     [Tags]    didm
57     ${serial_number}=    Find Serial Number
58     Log    ${serial_number}
59     Should Match    ${DEVICE_SERIAL_NUMBER}    ${serial_number}
60
61 Identifying Software Information
62     [Documentation]    Verify device software information
63     [Tags]    didm
64     ${device_sw}=    Find Device Software
65     Log    ${device_sw}
66     Should Match    ${DEVICE_SW_INFO}    ${device_sw}
67
68 Identifying Description
69     [Documentation]    Verify device description
70     [Tags]    didm
71     ${device_description}=    Find Device Description
72     Log    ${device_description}
73     Should Match    ${DEVICE_DESCRIPTION}    ${device_description}
74
75
76 *** Keywords ***
77 DIDM Suite Teardown
78     [Documentation]    Cleanup and exit device
79     Stop Mininet And Exit    ${mininet_conn_id}
80
81 Setup DIDM Environment
82     [Documentation]    Install DIDM Karaf feature. Wait for DIDM Listener to register.
83     ...    Wait for DIDM Listener is registered. Create REST session to the controller.
84     ...    Start the device.
85     SetupUtils.Setup_Utils_For_Setup_And_Teardown
86     Install a Feature    odl-didm-all
87     Verify Feature Is Installed    odl-didm-all
88     Verify Feature Is Installed    odl-didm-identification
89     Verify Feature Is Installed    odl-didm-drivers
90     Verify Feature Is Installed    odl-didm-hp-all
91     Verify Feature Is Installed    odl-didm-hp-impl
92     Verify Feature Is Installed    odl-didm-ovs-all
93     Verify Feature Is Installed    odl-didm-ovs-impl
94     Verify Feature Is Installed    odl-openflowplugin-flow-services
95     ${message}=    Set Variable    org.opendaylight.didm.ovs - 0.2.0.SNAPSHOT | Device-type Listener registered
96     Wait For Karaf Log    ${message}
97     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
98     Log    Start device
99     ${mininet_topo_opt}=    Set Variable    --topo linear,1
100     ${mininet_conn_id}=    Start Mininet Single Controller
101     ...    ${TOOLS_SYSTEM_IP}
102     ...    ${ODL_SYSTEM_IP}
103     ...    ${mininet_topo_opt}
104     Wait Until Keyword Succeeds    11s    1s    Check DIDM Registered With Device
105     Set Suite Variable    ${mininet_conn_id}