Detect bug 5125 85/33685/2
authorJozef Behran <jbehran@cisco.com>
Thu, 28 Jan 2016 09:31:11 +0000 (10:31 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 28 Jan 2016 10:43:51 +0000 (10:43 +0000)
Attempt to send element from a nonexistent namespace into the
configuration will cause NullPointerException. This was
reported as bug 5125. Make sure this bug does not return back
by adding a test against it.

Change-Id: I7754c2a30c5d8940a9c4f554d64111ead1d1a96b
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/suites/netconf/MDSAL/northbound.robot
csit/variables/netconf/MDSAL/merge-nonexistent-namespace-request.msg [new file with mode: 0644]

index cc912f5539156378c15c4638b9a5f6507089256c..33087f7594ab7a9742f0db08069cdb5ed09303da 100644 (file)
@@ -66,6 +66,16 @@ Additional_Attributes_In_Message
     BuiltIn.Should_Contain    ${reply}    additional="otherthing"
     BuiltIn.Should_Contain    ${reply}    xmlns:prefix="http://www.example.com/my-schema-example.html"
 
+Send_Stuff_In_Undefined_Namespace
+    [Documentation]    Try to send something within an undefined namespace and check the reply complains about the nonexistent namespace and element.
+    ${reply}=    Load_And_Send_Message    merge-nonexistent-namespace
+    BuiltIn.Set_Test_Variable    ${bugno}    5125
+    BuiltIn.Should_Not_Contain    ${reply}    java.lang.NullPointerException
+    BuiltIn.Set_Test_Variable    ${bugno}    ${EMPTY}
+    BuiltIn.Should_Contain    ${reply}    urn:this:is:in:a:nonexistent:namespace
+    BuiltIn.Should_Contain    ${reply}    does-not-exist
+    [Teardown]    BuiltIn.Run_Keyword_If    '${bugno}' != '${EMPTY}'    Utils.Report_Failure_Due_To_Bug    5125
+
 Edit_Config_First_Batch_Merge
     [Documentation]    Request a "merge" operation adding an element in candidate configuration and check the reply.
     Perform_Test    merge-1
diff --git a/csit/variables/netconf/MDSAL/merge-nonexistent-namespace-request.msg b/csit/variables/netconf/MDSAL/merge-nonexistent-namespace-request.msg
new file mode 100644 (file)
index 0000000..c9ccbc0
--- /dev/null
@@ -0,0 +1,18 @@
+<rpc message-id="2" a="64" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <edit-config>
+    <target>
+      <candidate/>
+    </target>
+    <default-operation>merge</default-operation>
+    <config>
+      <does-not-exist xmlns="urn:this:is:in:a:nonexistent:namespace">
+        <entry>
+          <id>TOY001</id>
+          <name>Some Toy</name>
+          <year>2016</year>
+          <category>toys</category>
+        </entry>
+      </does-not-exist>
+    </config>
+  </edit-config>
+</rpc>