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
6 Library OperatingSystem
8 Library ../../../libraries/RequestsLibrary.py
9 Library ../../../libraries/Common.py
10 Variables ../../../variables/Variables.py
13 ${FILE} ${CURDIR}/../../../variables/xmls/netconf.xml
14 ${REST_CONT_CONF} /restconf/config/network-topology:network-topology/topology/topology-netconf
15 ${REST_CONT_OPER} /restconf/operational/network-topology:network-topology/topology/topology-netconf
16 ${REST_NTPR_CONF} node/controller-config/yang-ext:mount/config:modules
17 ${REST_NTPR_MOUNT} node/netopeer/yang-ext:mount/
21 [Documentation] Add NetConf device using REST
23 ${XML1} Get File ${FILE}
24 ${XML2} Replace String ${XML1} 127.0.0.1 ${MININET}
25 ${body} Replace String ${XML2} mininet ${MININET_USER}
27 ${resp} Post session ${REST_CONT_CONF}/${REST_NTPR_CONF} data=${body}
29 Should Be Equal As Strings ${resp.status_code} 204
31 Get Controller Inventory
32 [Documentation] Get Controller operational inventory
34 Wait Until Keyword Succeeds 10s 2s Get Inventory
36 Pull External Device configuration
37 [Documentation] Pull Netopeer configuration
39 ${resp} Get session ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
41 Should Be Equal As Strings ${resp.status_code} 200
42 Should Contain ${resp.content} {}
44 Verify Device Operational data
45 [Documentation] Verify Netopeer operational data
47 ${resp} Get session ${REST_CONT_OPER}/${REST_NTPR_MOUNT}
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
56 ${resp} Get session ${REST_CONT_OPER}/node/netopeer
58 Should Be Equal As Strings ${resp.status_code} 200
59 Should Contain ${resp.content} "node-id":"netopeer"
60 Should Contain ${resp.content} "netconf-node-topology:connection-status":"connected"
61 Should Contain ${resp.content} "netconf-node-topology:available-capabilities"