Less sensitive "empty config test" 25/29925/2
authorJozef Behran <jbehran@cisco.com>
Thu, 19 Nov 2015 14:38:44 +0000 (15:38 +0100)
committerJozef Behran <jbehran@cisco.com>
Thu, 19 Nov 2015 14:54:31 +0000 (15:54 +0100)
Do not store the content of "empty config" but only check
that none of "our elements" are not there when they
shouldn't. The "check empty config" approach is not valid
because the "empty config" stored at the beginning may change
when another feature gets installed while the test is still
running.

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

index 0017bf9634d5afed14846cc841dea9f8d0114bda..df92fb9d33d2cc8ea39c8f67d7ef7b75e0594362 100644 (file)
@@ -47,13 +47,7 @@ Connect_To_ODL_Netconf
 
 Get_Config_Running
     [Documentation]    Make sure the configuration has only the default elements in it.
-    ${reply}=    Load_And_Send_Message    get-config
-    BuiltIn.Should_Not_Contain    ${reply}    <name>name0</name>
-    BuiltIn.Should_Not_Contain    ${reply}    <name>name1</name>
-    BuiltIn.Should_Not_Contain    ${reply}    <name>name2</name>
-    BuiltIn.Should_Not_Contain    ${reply}    <name>name3</name>
-    BuiltIn.Should_Not_Contain    ${reply}    <name>name4</name>
-    BuiltIn.Set_Suite_Variable    ${empty_config}    ${reply}
+    Check_Test_Objects_Not_Present_In_Config    get-config
 
 Missing_Message_ID_Attribute
     [Documentation]    Check that messages with missing "message-ID" attribute are rejected with the correct error (RFC 6241, section 4.1).
@@ -74,7 +68,7 @@ Edit_Config_Modules_Merge
 
 Get_Config_Running_To_Confirm_No_Edit_Before_Commit
     [Documentation]    Make sure the running configuration is still unchanged as the change was not commited yet.
-    Send_And_Check    get-config-no-edit-before-commit    ${empty_config}
+    Check_Test_Objects_Not_Present_In_Config    get-config-no-edit-before-commit
 
 Commit_Edit
     [Documentation]    Commit the change and check the reply.
@@ -109,7 +103,7 @@ Commit_Delete
 
 Get_Config_Running_To_Confirm_Delete_After_Commit
     [Documentation]    Check that the element is gone.
-    Send_And_Check    get-config-delete-after-commit    ${empty_config}
+    Check_Test_Objects_Not_Present_In_Config    get-config-delete-after-commit
 
 Restconf_Get_Modules_Shall_Return_404
     [Documentation]    Check that "Not Found" is returned when Restconf is asked for the deleted element.
@@ -136,7 +130,7 @@ Discard_Changes
 
 Get_Config_Candidate_To_Confirm_Discard
     [Documentation]    Check that the element was really discarded.
-    Send_And_Check    get-config-candidate-discard    ${empty_config}
+    Check_Test_Objects_Not_Present_In_Config    get-config-candidate-discard
 
 Edit_Config_Modules_Multiple_Modules_Merge_1
     [Documentation]    Create the element with "name2" subelement again and check the reply.
@@ -336,6 +330,16 @@ Teardown_Everything
     Close_ODL_Netconf_Connection
     RequestsLibrary.Delete_All_Sessions
 
+Check_Test_Objects_Not_Present_In_Config
+    [Arguments]    ${name}
+    [Documentation]    Use dataset with the specified name to get the configuration and check that none of our test objects are there.
+    ${reply}=    Load_And_Send_Message    ${name}
+    BuiltIn.Should_Not_Contain    ${reply}    <name>name0</name>
+    BuiltIn.Should_Not_Contain    ${reply}    <name>name1</name>
+    BuiltIn.Should_Not_Contain    ${reply}    <name>name2</name>
+    BuiltIn.Should_Not_Contain    ${reply}    <name>name3</name>
+    BuiltIn.Should_Not_Contain    ${reply}    <name>name4</name>
+
 Perform_Test
     [Arguments]    ${name}
     [Documentation]    Load and send the request from the dataset and compare the returned reply to the one stored in the dataset.