Update version.robot to reflect netconf connector usage 95/50195/1
authorPeter Gubka <pgubka@cisco.com>
Tue, 10 Jan 2017 14:47:24 +0000 (15:47 +0100)
committerPeter Gubka <pgubka@cisco.com>
Tue, 10 Jan 2017 14:47:24 +0000 (15:47 +0100)
Change-Id: I1b206601879b067026052fa0625e23d9723f39fb
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/distribution/version.robot

index 62875547bcf72d12201cf2e69df6c0db140ebb30..11b0b124c8f2259c60097150d170890117e38baf 100644 (file)
@@ -22,6 +22,7 @@ Documentation     Suite for testing ODL distribution ability to report ist versi
 ...               TODO: Figure out a way to reliably predict Odlparent version.
 ...               Possibly, inspection of system/org/opendaylight/odlparent/ would be required.
 Suite Setup       Suite_Setup
+Suite Teardown    Suite_Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 Default Tags      critical    distribution    version
@@ -30,6 +31,9 @@ Resource          ${CURDIR}/../../libraries/SetupUtils.robot
 
 *** Variables ***
 ${VERSION_VARDIR}    ${CURDIR}/../../variables/distribution/version
+${DEVICE_NAME}    controller-config
+${NETCONF_DEV_FOLDER}    ${CURDIR}/../../variables/netconf/device/full-uri-device
+${NETCONF_MOUNT_FOLDER}    ${CURDIR}/../../variables/netconf/device/full-uri-mount
 
 *** Test Cases ***
 Distribution_Version
@@ -42,3 +46,18 @@ Distribution_Version
 Suite_Setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     TemplatedRequests.Create_Default_Session
+    BuiltIn.Run_Keyword_If    """${USE_NETCONF_CONNECTOR}""" == """False"""    Configure_Netconf_Device
+
+Suite_Teardown
+    BuiltIn.Run_Keyword_If    """${USE_NETCONF_CONNECTOR}""" == """False"""    Remove_Netconf_Device
+
+Configure_Netconf_Device
+    [Documentation]    Configures netconf device if ${USE_NETCONF_CONNECTOR} is False.
+    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    DEVICE_PORT=1830    DEVICE_IP=${ODL_SYSTEM_IP}    DEVICE_USER=admin    DEVICE_PASSWORD=admin
+    TemplatedRequests.Put_As_Xml_Templated    ${NETCONF_DEV_FOLDER}    mapping=${mapping}
+    BuiltIn.Wait_Until_Keyword_Succeeds    10x    3s    TemplatedRequests.Get_As_Xml_Templated    ${NETCONF_MOUNT_FOLDER}    mapping=${mapping}
+
+Remove_Netconf_Device
+    [Documentation]    Removes netconf device if ${USE_NETCONF_CONNECTOR} is False.
+    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}
+    TemplatedRequests.Delete_Templated    ${NETCONF_DEV_FOLDER}    mapping=${mapping}