fd168243d01a4f82c360d5bcfc32188f7ca9e4a6
[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/config:module/netopeer
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    127.0.0.1    ${MININET}     ${XML1}
25     ${body}    Replace String    mininet      ${MININET_USER}    ${XML2}
26     Log    ${body}
27     ${resp}    Putxml    session    ${REST_CONT_CONF}/${REST_NTPR_CONF}    data=${body}
28     Log    ${resp.content}
29     Should Be Equal As Strings    ${resp.status_code}    200
30
31 Get Controller Inventory
32     [Documentation]    Get Controller operational inventory
33     [Tags]    netconf
34     ${resp}   Get    session    ${REST_CONT_OPER}
35     Log    ${resp.content}
36     Should Be Equal As Strings    ${resp.status_code}    200
37     Should Contain    ${resp.content}    "id":"netopeer"
38     Should Contain    ${resp.content}    "netconf-node-inventory:connected":true
39     Should Contain    ${resp.content}    "netconf-node-inventory:initial-capability"
40
41 Pull External Device configuration
42     [Documentation]    Pull Netopeer configuration
43     [Tags]    netconf
44     Wait Until Keyword Succeeds    10s    2s    Pull Config
45
46 Verify Device Operational data
47     [Documentation]    Verify Netopeer operational data
48     [Tags]    netconf
49     ${resp}   Get    session    ${REST_CONT_OPER}/${REST_NTPR_MOUNT}
50     Log    ${resp.content}
51     Should Be Equal As Strings    ${resp.status_code}    200
52     Should Contain    ${resp.content}    schema
53     Should Contain    ${resp.content}    statistics
54     Should Contain    ${resp.content}    datastores
55
56 *** Keywords ***
57 Pull Config
58     ${resp}   Get    session    ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
59     Log    ${resp.content}
60     Should Be Equal As Strings    ${resp.status_code}    200
61     Should Contain    ${resp.content}    {}
62
63