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