Merge "removing failing tests"
[integration/test.git] / test / csit / suites / karaf-compatible / 110__NETCONF / 010__netconf_inventory.txt
1 *** Settings ***
2 Documentation     Test suite for NETCONF
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           OperatingSystem
7 Library           String
8 Library           ../../../libraries/RequestsLibrary.py
9 Library           ../../../libraries/Common.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${FILE}                 ${CURDIR}/../../../variables/xmls/netconf.xml
14 ${REST_CONT_CONF}       /restconf/config/opendaylight-inventory:nodes
15 ${REST_CONT_OPER}       /restconf/operational/opendaylight-inventory:nodes 
16 ${REST_NTPR_CONF}       node/controller-config/yang-ext:mount/config:modules
17 ${REST_NTPR_MOUNT}      node/netopeer/yang-ext:mount/
18
19 *** Test Cases ***
20 Add NetConf device
21     [Documentation]    Add NetConf device using REST
22     [Tags]     netconf
23     ${XML1}    Get File    ${FILE}
24     ${XML2}    Replace String    ${XML1}    127.0.0.1    ${MININET}
25     ${body}    Replace String    ${XML2}    mininet      ${MININET_USER}
26     Log    ${body}
27     ${resp}    Post    session    ${REST_CONT_CONF}/${REST_NTPR_CONF}    data=${body}
28     Log    ${resp.content}
29     Should Be Equal As Strings    ${resp.status_code}    204
30
31 Get Controller Inventory
32     [Documentation]    Get Controller operational inventory
33     [Tags]    netconf
34     Wait Until Keyword Succeeds    10s    2s    Get Inventory 
35
36 Pull External Device configuration
37     [Documentation]    Pull Netopeer configuration
38     [Tags]    netconf
39     ${resp}   Get    session    ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
40     Log    ${resp.content}
41     Should Be Equal As Strings    ${resp.status_code}    200
42     Should Contain    ${resp.content}    {}
43
44 Verify Device Operational data
45     [Documentation]    Verify Netopeer operational data
46     [Tags]    netconf
47     ${resp}   Get    session    ${REST_CONT_OPER}/${REST_NTPR_MOUNT}
48     Log    ${resp.content}
49     Should Be Equal As Strings    ${resp.status_code}    200
50     Should Contain    ${resp.content}    schema
51     Should Contain    ${resp.content}    statistics
52     Should Contain    ${resp.content}    datastores
53
54 *** Keywords ***
55 Get Inventory
56     ${resp}   Get    session    ${REST_CONT_OPER}
57     Log    ${resp.content}
58     Should Be Equal As Strings    ${resp.status_code}    200
59     Should Contain    ${resp.content}    "id":"netopeer"
60     Should Contain    ${resp.content}    "netconf-node-inventory:connected":true
61     Should Contain    ${resp.content}    "netconf-node-inventory:initial-capability"
62