db7f3bd019cca838786343748c9c3d597c99f1c8
[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 Suite Setup       Setup DIDM Environment
9 Suite Teardown    DIDM Suite Teardown
10 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
11 Library           SSHLibrary
12 Library           Collections
13 Library           RequestsLibrary
14 Resource          ../../../variables/DIDM/Variables.robot
15 Variables         ../../../variables/Variables.py
16 Resource          ../../../libraries/Utils.robot
17 Resource          ../../../libraries/MininetKeywords.robot
18 Resource          ../../../libraries/DIDMKeywords.robot
19 Resource          ../../../libraries/KarafKeywords.robot
20 Resource          ../../../libraries/SetupUtils.robot
21
22 *** Test Cases ***
23 Identifying Unknown Device
24     [Documentation]    Verify other devices are identified as unknown
25     [Tags]    DIDM
26     ${unknown_device_ip}=    Set Variable    1.1.1.1
27     ${device_ip}=    Check Device IP
28     Should Not Match    ${device_ip}    ${unknown_device_ip}
29
30 Identifying Device Type
31     [Documentation]    Verify device type
32     [Tags]    DIDM
33     ${device_type}=    Find Device Type
34     Log    ${device_type}
35     Should Match    ${DEVICE_TYPE}    ${device_type}
36
37 Identifying Hardware Information
38     [Documentation]    Verify device hardware information
39     [Tags]    DIDM
40     ${device_hw}=    Find Device Hardware
41     Log    ${device_hw}
42     Should Match    ${DEVICE_HW_INFO}    ${device_hw}
43
44 Identifying Manufacturer
45     [Documentation]    Verify device manufacturer
46     [Tags]    DIDM
47     ${manufacture}=    Find Device Manufacturer
48     Log    ${manufacture}
49     Should Match    ${DEVICE_MANUFACTURE}    ${manufacture}
50
51 Identifying Serial Number
52     [Documentation]    Verify device serial number
53     [Tags]    DIDM
54     ${serial_number}=    Find Serial Number
55     Log    ${serial_number}
56     Should Match    ${DEVICE_SERIAL_NUMBER}    ${serial_number}
57
58 Identifying Software Information
59     [Documentation]    Verify device software information
60     [Tags]    DIDM
61     ${device_sw}=    Find Device Software
62     Log    ${device_sw}
63     Should Match    ${DEVICE_SW_INFO}    ${device_sw}
64
65 Identifying Description
66     [Documentation]    Verify device description
67     [Tags]    DIDM
68     ${device_description}=    Find Device Description
69     Log    ${device_description}
70     Should Match    ${DEVICE_DESCRIPTION}    ${device_description}
71
72 *** Keywords ***
73 DIDM Suite Teardown
74     [Documentation]    Cleanup and exit device
75     Stop Mininet And Exit    ${mininet_conn_id}
76
77 Setup DIDM Environment
78     [Documentation]    Install DIDM Karaf feature. Wait for DIDM Listener to register.
79     ...    Wait for DIDM Listener is registered. Create REST session to the controller.
80     ...    Start the device.
81     SetupUtils.Setup_Utils_For_Setup_And_Teardown
82     Install a Feature    odl-didm-all
83     Verify Feature Is Installed    odl-didm-all
84     Verify Feature Is Installed    odl-didm-identification
85     Verify Feature Is Installed    odl-didm-drivers
86     Verify Feature Is Installed    odl-didm-hp-all
87     Verify Feature Is Installed    odl-didm-hp-impl
88     Verify Feature Is Installed    odl-didm-ovs-all
89     Verify Feature Is Installed    odl-didm-ovs-impl
90     Verify Feature Is Installed    odl-openflowplugin-flow-services
91     ${message}=    Set Variable    org.opendaylight.didm.ovs - 0.2.0.SNAPSHOT | Device-type Listener registered
92     Wait For Karaf Log    ${message}
93     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
94     Log    Start device
95     ${mininet_topo_opt}=    Set Variable    --topo linear,1
96     ${mininet_conn_id}=    Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_IP}    ${mininet_topo_opt}
97     Wait Until Keyword Succeeds    11s    1s    Check DIDM Registered With Device
98     Set Suite Variable    ${mininet_conn_id}