Fix "prettyPrint" crashing the Netconf readiness suite 24/32124/8
authorJozef Behran <jbehran@cisco.com>
Tue, 5 Jan 2016 07:35:57 +0000 (08:35 +0100)
committerJozef Behran <jbehran@cisco.com>
Thu, 14 Jan 2016 08:53:15 +0000 (09:53 +0100)
There really is no need for prettyprinting in the Netconf
readiness suite as the only thing the suite is doing with the
data is checking that it is there (the request returned OK).

The "prettyPrint" argument of the URL started to make
problems recently:

  Keyword 'Check_Netconf_Connector' failed after retrying
  for minute. The last error was: TypeError: get() got an
  unexpected keyword argument 'restconf/config/network-\
  topology:network-topology/topology/topology-netconf/node/\
  controller-config/yang-ext:mount/config:modules/module/\
  odl-sal-netconf-connector-cfg:sal-netconf-connector/\
  controller-config/?prettyPrint'

Note the "?prettyPrint" at the end.

To counter this the "?prettyPrint=true" suffix was removed
from the URL used to check whether Netconf is working or not.
However to make sure it won't just slip away another test
case was added to try to run the prettyprinting when we are
sure Netconf is working so that we have something that
detects when the "?prettyPrint=true" argument breaks.

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

index 4803053627d3dc8ed3f1071eecd7af5b6f9ed097..6d7d02354ef6338a6a91164ea5400441fc037976 100644 (file)
@@ -48,6 +48,11 @@ Wait_For_Netconf_Connector
     BuiltIn.Run_Keyword_Unless    ${first_case_ok}    BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_WAIT}    1s    Check_Netconf_Connector
     [Teardown]    Utils.Report_Failure_Due_To_Bug    4583
 
+Check_Whether_Netconf_Connector_Can_Pretty_Print
+    [Documentation]    Make one request to netconf-connector and see if it works.
+    [Tags]    critical
+    Check_Netconf_Connector    ?prettyPrint=true
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup requests library and log into karaf.log that the netconf readiness wait starts.
@@ -65,7 +70,8 @@ Teardown_Everything
     RequestsLibrary.Delete_All_Sessions
 
 Check_Netconf_Connector
+    [Arguments]    ${pretty_print}=${EMPTY}
     [Documentation]    Make a request to netconf connector's list of mounted devices and check that the request was successful.
-    ${response}=    RequestsLibrary.Get    ses    restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/controller-config/?prettyPrint=true
+    ${response}=    RequestsLibrary.Get    ses    restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/controller-config${pretty_print}
     BuiltIn.Log    ${response.text}
     BuiltIn.Should_Be_Equal_As_Strings    ${response.status_code}    200