Add test case to wait for MDSAL to become ready 42/35242/8
authorJozef Behran <jbehran@cisco.com>
Tue, 23 Feb 2016 09:07:21 +0000 (10:07 +0100)
committerJozef Behran <jbehran@cisco.com>
Thu, 25 Feb 2016 16:21:57 +0000 (17:21 +0100)
The Netconf Readiness suite got another testcase which waits
for the Netconf MD-SAL to become ready. This testcase first
checks if that feature is installed and skips with a message
if not.

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

index d3c4f7997811269339479a9e184506af0797776b..a6ee539764e728042840fd992b9df07b0e9f14f3 100644 (file)
@@ -50,6 +50,7 @@ ${netconf_is_ready}    False
 ${NETCONFREADY_WAIT}    60s
 ${USE_NETCONF_CONNECTOR}    True
 ${DEBUG_LOGGING_FOR_EVERYTHING}    False
+${NETCONFREADY_WAIT_MDSAL}    60s
 
 *** Test Cases ***
 Check_Whether_Netconf_Is_Up_And_Running
@@ -87,6 +88,15 @@ Check_Whether_Netconf_Can_Pretty_Print
     BuiltIn.Run_Keyword_Unless    ${netconf_is_ready}    Fail    Netconf is not ready so it can't pretty-print now.
     Check_Netconf_Up_And_Running    ?prettyPrint=true
 
+Wait_For_MDSAL
+    [Documentation]    Wait for the MDSAL feature to become online
+    ${status}    ${message}=    BuiltIn.Run_Keyword_And_Ignore_Error    KarafKeywords.Verify_Feature_Is_Installed    odl-netconf-mdsal
+    BuiltIn.Run_Keyword_If    '${status}' == 'FAIL'    BuiltIn.Pass_Execution    The 'odl-netconf-mdsal' feature is not installed so no need to wait for it.
+    SSHKeywords.Open_Connection_To_ODL_System
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_WAIT_MDSAL}    1s    Check_Netconf_MDSAL_Up_And_Running
+    SSHLibrary.Close_Connection
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4583
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup requests library and log into karaf.log that the netconf readiness wait starts.
@@ -114,3 +124,7 @@ Check_Netconf_Usable
     NetconfKeywords.Configure_Device_In_Netconf    test-device    device_type=configure-via-topology
     NetconfKeywords.Remove_Device_From_Netconf    test-device
     Check_Netconf_Up_And_Running
+
+Check_Netconf_MDSAL_Up_And_Running
+    ${count}=    SSHKeywords.Count_Port_Occurences    ${ODL_NETCONF_MDSAL_PORT}    LISTEN    java
+    BuiltIn.Should_Be_Equal_As_Integers    ${count}    1