Cycling device and checking that the data survived. 67/29667/6
authorJozef Behran <jbehran@cisco.com>
Fri, 13 Nov 2015 09:30:30 +0000 (10:30 +0100)
committerVratko Polák <vrpolak@cisco.com>
Mon, 14 Mar 2016 11:11:07 +0000 (11:11 +0000)
After the device data modification step the test suite
deconfigures the device, configures it back and checks that
the data is still there as they were when it was last
modified. Then the suite tries to modify the data again
just to make sure the deconfigure/configure cycle did not
mysteriously make them read-only.

Change-Id: I403357d85b80f28060775e57bb6192de90a6114e
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/suites/netconf/CRUD/CRUD.robot

index 5a9b8515672b2cb4350f5f3e7b08540b2675f5ca..79503abf4c849fe0d311ef0df575be97ec2f4419 100644 (file)
@@ -83,6 +83,42 @@ Check_Device_Data_Label_Is_Modified
     [Documentation]    Get the device data label and make sure it contains the modified content.
     Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
 
+Deconfigure_Device_From_Netconf_Temporarily
+    [Documentation]    Make request to deconfigure the testtool device on Netconf connector.
+    ...    This is the first part of the "configure/deconfigure" cycle of the device
+    ...    The purpose of cycling the device like this is to see that the configuration
+    ...    data was really stored in the device.
+    [Tags]    critical
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    NetconfKeywords.Remove_Device_From_Netconf    ${device_name}
+
+Wait_For_Device_To_Be_Gone
+    [Documentation]    Wait for the device to completely disappear.
+    NetconfKeywords.Wait_Device_Fully_Removed    ${device_name}
+
+Configure_The_Device_Back
+    [Documentation]    Configure the device again.
+    ...    This is the second step of the device configuration.
+    [Tags]    critical
+    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}
+
+Wait_For_Device_To_Reconnect
+    [Documentation]    Wait until the device becomes available through Netconf.
+    NetconfKeywords.Wait_Device_Connected    ${device_name}
+
+Check_Modified_Device_Data_Is_Still_There
+    [Documentation]    Get the device data and make sure it contains the created content.
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    1s    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+
+Modify_Device_Data_Again
+    [Documentation]    Send a request to change the sample test data and check that the request went OK.
+    ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
+    NetconfViaRestconf.Put_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}datamod2    ${template_as_string}
+
+Check_Device_Data_Is_Modified_Again
+    [Documentation]    Get the device data and make sure it contains the created content.
+    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Another Modified Content</l></cont></data>
+
 Modify_Device_Data_Label_Via_Json
     [Documentation]    Send a JSON request to change the sample test data label and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}