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