Fixed oversensitive MDSAL test 81/29381/8
authorJozef Behran <jbehran@cisco.com>
Fri, 6 Nov 2015 12:50:47 +0000 (13:50 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 10 Nov 2015 12:50:46 +0000 (12:50 +0000)
The Beryllium added some features that impacted the netconf
point, leading to failures of the MDSAL tests. Analysis
revealed that these failures were spurious and caused by the
suite checking things which don't really relate to what it
is supposed to test. Fixed by removing the suite's
oversensitiveness.

Change-Id: I1da95822ccf25400c1305b08a9b71d43e809a3bc
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/suites/netconf/MDSAL/northbound.robot
csit/variables/netconf/MDSAL/get-config-candidate-discard-reply.msg [deleted file]
csit/variables/netconf/MDSAL/get-config-candidate-discard-request.msg
csit/variables/netconf/MDSAL/get-config-delete-after-commit-reply.msg [deleted file]
csit/variables/netconf/MDSAL/get-config-delete-after-commit-request.msg
csit/variables/netconf/MDSAL/get-config-no-edit-before-commit-reply.msg [deleted file]
csit/variables/netconf/MDSAL/get-config-no-edit-before-commit-request.msg
csit/variables/netconf/MDSAL/get-config-reply.msg [deleted file]
csit/variables/netconf/MDSAL/get-config-request.msg

index 23b83675f19f2088ea3c70fa38b42f2b6905e86d..b3df4cde05963d0cbbe360047ea39595904e6709 100644 (file)
@@ -6,6 +6,21 @@ Documentation     Metconf MDSAL Northbound test suite.
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+...
+...               The request produced by test cases "Get Config Running", "Get Config Running
+...               To Confirm No_Edit Before Commit", "Get Config Running To Confirm Delete
+...               After Commit" and "Get Config Candidate To Confirm Discard" all use the same
+...               message id ("empty") for their requests. This is possible because the
+...               requests produced by this suite are strictly serialized. The RFC 6241 does
+...               not state that these IDs are unique, it only requires that each ID used is
+...               "XML attribute normalized" if the client wants it to be returned unmodified.
+...               The RFC specifically says that "the content of this attribute is not
+...               interpreted in any way, it only is stored to be returned with the reply to
+...               the request. The reuse of the "empty" string for the 4 test cases was chosen
+...               for simplicity.
+...
+...               TODO: Change the 4 testcases to use unique message IDs.
 Suite Setup       Setup_Everything
 Suite Teardown    Teardown_Everything
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
@@ -30,7 +45,13 @@ Connect_To_ODL_Netconf
 
 Get_Config_Running
     [Documentation]    Make sure the configuration has only the default elements in it.
-    Perform_Test    get-config
+    ${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}
 
 Missing_Message_ID_Attribute
     [Documentation]    Check that messages with missing "message-ID" attribute are rejected with the correct error (RFC 6241, section 4.1).
@@ -51,7 +72,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.
-    Perform_Test    get-config-no-edit-before-commit
+    Send_And_Check    get-config-no-edit-before-commit    ${empty_config}
 
 Commit_Edit
     [Documentation]    Commit the change and check the reply.
@@ -86,7 +107,7 @@ Commit_Delete
 
 Get_Config_Running_To_Confirm_Delete_After_Commit
     [Documentation]    Check that the element is gone.
-    Perform_Test    get-config-delete-after-commit
+    Send_And_Check    get-config-delete-after-commit    ${empty_config}
 
 Restconf_Get_Modules_Shall_Return_404
     [Documentation]    Check that "Not Found" is returned when Restconf is asked for the deleted element.
@@ -113,7 +134,7 @@ Discard_Changes
 
 Get_Config_Candidate_To_Confirm_Discard
     [Documentation]    Check that the element was really discarded.
-    Perform_Test    get-config-candidate-discard
+    Send_And_Check    get-config-candidate-discard    ${empty_config}
 
 Edit_Config_Modules_Multiple_Modules_Merge_1
     [Documentation]    Create the element with "name2" subelement again and check the reply.
@@ -308,6 +329,11 @@ Perform_Test
     BuiltIn.Should_Be_Equal    ${actual}    ${newline}${expected}${ODL_NETCONF_PROMPT}
     [Return]    ${actual}
 
+Send_And_Check
+    [Arguments]    ${name}    ${expected}
+    ${actual}=    Load_And_Send_Message    ${name}
+    BuiltIn.Should_Be_Equal    ${actual}    ${expected}
+
 Test_Commit_With_No_Transactions
     [Documentation]    Issue a "commit" RPC request and check that it fails with "No current transactions" error.
     ${reply}=    Load_And_Send_Message    commit-no-transaction
diff --git a/csit/variables/netconf/MDSAL/get-config-candidate-discard-reply.msg b/csit/variables/netconf/MDSAL/get-config-candidate-discard-reply.msg
deleted file mode 100644 (file)
index dc79b7c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="23">
-<data>
-<network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
-<topology>
-<topology-id>topology-netconf</topology-id>
-<node>
-<node-id>controller-config</node-id>
-</node>
-</topology>
-</network-topology>
-<nodes xmlns="urn:opendaylight:inventory">
-<node>
-<id>controller-config</id>
-</node>
-</nodes>
-</data>
-</rpc-reply>
index 49c377fa638ef3a0538f60d24b4b2fd159db3cea..89f7b4530318779800a05e2a608e65469cacb688 100644 (file)
@@ -1,4 +1,4 @@
-<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="23">
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="empty">
     <get-config>
         <source>
             <candidate/>
diff --git a/csit/variables/netconf/MDSAL/get-config-delete-after-commit-reply.msg b/csit/variables/netconf/MDSAL/get-config-delete-after-commit-reply.msg
deleted file mode 100644 (file)
index 78513c3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9">
-<data>
-<network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
-<topology>
-<topology-id>topology-netconf</topology-id>
-<node>
-<node-id>controller-config</node-id>
-</node>
-</topology>
-</network-topology>
-<nodes xmlns="urn:opendaylight:inventory">
-<node>
-<id>controller-config</id>
-</node>
-</nodes>
-</data>
-</rpc-reply>
index ec6f28c440ec2ad9262cad30937dc28e4ff2442b..844e2053ad3ccf23d6ccb8374d0c71f51557d9a8 100644 (file)
@@ -1,4 +1,4 @@
-<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9">
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="empty">
     <get-config>
         <source>
             <running/>
diff --git a/csit/variables/netconf/MDSAL/get-config-no-edit-before-commit-reply.msg b/csit/variables/netconf/MDSAL/get-config-no-edit-before-commit-reply.msg
deleted file mode 100644 (file)
index b7810ac..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
-<data>
-<network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
-<topology>
-<topology-id>topology-netconf</topology-id>
-<node>
-<node-id>controller-config</node-id>
-</node>
-</topology>
-</network-topology>
-<nodes xmlns="urn:opendaylight:inventory">
-<node>
-<id>controller-config</id>
-</node>
-</nodes>
-</data>
-</rpc-reply>
index 7cfdec23b7a381d766693b1a40e7d47ed86628a2..844e2053ad3ccf23d6ccb8374d0c71f51557d9a8 100644 (file)
@@ -1,4 +1,4 @@
-<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="empty">
     <get-config>
         <source>
             <running/>
diff --git a/csit/variables/netconf/MDSAL/get-config-reply.msg b/csit/variables/netconf/MDSAL/get-config-reply.msg
deleted file mode 100644 (file)
index afe154c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
-<data>
-<network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
-<topology>
-<topology-id>topology-netconf</topology-id>
-<node>
-<node-id>controller-config</node-id>
-</node>
-</topology>
-</network-topology>
-<nodes xmlns="urn:opendaylight:inventory">
-<node>
-<id>controller-config</id>
-</node>
-</nodes>
-</data>
-</rpc-reply>
index 7f44358eb313437eb531aca5a54c5b72038debff..844e2053ad3ccf23d6ccb8374d0c71f51557d9a8 100644 (file)
@@ -1,4 +1,4 @@
-<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="empty">
     <get-config>
         <source>
             <running/>