2 Documentation Suite for testing ODL distribution ability to report ist version via Restconf.
4 ... Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
11 ... Features needed to be installed:
12 ... odl-distribution-version (the main feature, defines the version string holder as a config module)
13 ... odl-netconf-connector (controller-config device is used to access the config subsystem)
14 ... odl-restconf (or odl-restconf-noauth, to get restconf access to the data mounted by controller-config)
16 ... Variables needed to be rovided on pybot invocation:
17 ... ${BUNDLEFOLDER} (directory name of ODL installation, as it is suffxed by the distribution version)
19 ... This suite require both Restconf and Netconf-connector to be ready,
20 ... so it is recommended to run netconfready.robot before running this suite.
22 ... TODO: Figure out a way to reliably predict Odlparent version.
23 ... Possibly, inspection of system/org/opendaylight/odlparent/ would be required.
25 Resource ${CURDIR}/../../libraries/distribution/StreamDistro.robot
26 Resource ${CURDIR}/../../libraries/TemplatedRequests.robot
27 Resource ${CURDIR}/../../libraries/SetupUtils.robot
29 Suite Setup Suite_Setup
30 Suite Teardown Suite_Teardown
31 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
32 Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
34 Default Tags critical distribution version
38 ${VERSION_VARDIR} ${CURDIR}/../../variables/distribution/version
39 ${DEVICE_NAME} controller-config
40 ${NETCONF_DEV_FOLDER} ${CURDIR}/../../variables/netconf/device/full-uri-device
41 ${NETCONF_MOUNT_FOLDER} ${CURDIR}/../../variables/netconf/device/full-uri-mount
46 [Documentation] Get version string as a part of ${BUNDLEFOLDER} and match with what RESTCONF says.
47 # ${BUNDLEFOLDER} typically looks like this: karaf-0.8.0-SNAPSHOT
48 ${filename_prefix} = StreamDistro.Compose_Zip_Filename_Prefix
49 ${version} = BuiltIn.Evaluate """${BUNDLEFOLDER}"""[len("""${filename_prefix}-"""):]
50 BuiltIn.Wait_Until_Keyword_Succeeds
53 ... TemplatedRequests.Get_As_Json_Templated
54 ... folder=${VERSION_VARDIR}
55 ... mapping={"VERSION":"${version}"}
61 SetupUtils.Setup_Utils_For_Setup_And_Teardown
62 TemplatedRequests.Create_Default_Session
63 IF """${USE_NETCONF_CONNECTOR}""" == """False"""
64 Configure_Netconf_Device
68 IF """${USE_NETCONF_CONNECTOR}""" == """False""" Remove_Netconf_Device
70 Configure_Netconf_Device
71 [Documentation] Configures netconf device if ${USE_NETCONF_CONNECTOR} is False.
72 &{mapping} = BuiltIn.Create_Dictionary
73 ... DEVICE_NAME=${DEVICE_NAME}
75 ... DEVICE_IP=${ODL_SYSTEM_IP}
77 ... DEVICE_PASSWORD=admin
78 TemplatedRequests.Put_As_Xml_Templated ${NETCONF_DEV_FOLDER} mapping=${mapping}
79 BuiltIn.Wait_Until_Keyword_Succeeds
82 ... TemplatedRequests.Get_As_Xml_Templated
83 ... ${NETCONF_MOUNT_FOLDER}
84 ... mapping=${mapping}
87 [Documentation] Removes netconf device if ${USE_NETCONF_CONNECTOR} is False.
88 &{mapping} = BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME}
89 TemplatedRequests.Delete_Templated ${NETCONF_DEV_FOLDER} mapping=${mapping}