Update Robot Framework format - step 10 40/102340/8
authorSangwook Ha <sangwook.ha@verizon.com>
Sat, 24 Sep 2022 03:04:09 +0000 (20:04 -0700)
committerSangwook Ha <sangwook.ha@verizon.com>
Fri, 7 Oct 2022 02:12:07 +0000 (19:12 -0700)
Robotidy has stricter formatting rules for line width, alignment,
section ordering & spacing, etc.

Update the format of Robot Framework files in the following directory
with Robotidy:

- csit/suites/netconf

JIRA: INTTEST-132
Change-Id: Id6fc77ae951956e740382e9f74be998536fefeab
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
22 files changed:
csit/suites/netconf/CRUD-ACTION/CRUD-ACTION.robot
csit/suites/netconf/CRUD/CRUD-RPC.robot
csit/suites/netconf/CRUD/CRUD.robot
csit/suites/netconf/KeyAuth/keyauth.robot
csit/suites/netconf/MDSAL/northbound.robot
csit/suites/netconf/apidocs/apidocs.robot
csit/suites/netconf/callhome/callhome.robot
csit/suites/netconf/clustering/CRUD.robot
csit/suites/netconf/clustering/bug8086.robot
csit/suites/netconf/clustering/entity-isolation-rejoin.robot
csit/suites/netconf/clustering/entity.robot
csit/suites/netconf/clustering/outages.robot
csit/suites/netconf/clusteringscale/performance.robot
csit/suites/netconf/clusteringscale/topology_leader_ha.robot
csit/suites/netconf/clusteringscale/topology_owner_ha.robot
csit/suites/netconf/notifications/notifications_basic.robot
csit/suites/netconf/ready/netconfready.robot
csit/suites/netconf/restperfclient/mdsal.robot
csit/suites/netconf/restperfclient/performance.robot
csit/suites/netconf/scale/getmulti.robot
csit/suites/netconf/scale/getsingle.robot
csit/suites/netconf/scale/max_devices.robot

index 9f644ac9643532a2019df4678aaecd9983f5df1b..38ba576e53b95f86d2cb418b8249b810f0286279 100644 (file)
@@ -1,40 +1,44 @@
 *** Settings ***
-Documentation     netconf-connector CRUD-Action test suite.
+Documentation       netconf-connector CRUD-Action test suite.
 ...
-...               Copyright (c) 2019 Ericsson Software Technology AB. All rights reserved.
+...                 Copyright (c) 2019 Ericsson Software Technology AB. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector using RPC for node supporting Yang 1.1
-...               addition and see if invoking Action Operation work.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector using RPC for node supporting Yang 1.1
+...                 addition and see if invoking Action Operation work.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DIRECTORY_WITH_TEMPLATE_FOLDERS}    ${CURDIR}/../../../variables/netconf/CRUD
-${DEVICE_NAME}    netconf-test-device
-${DEVICE_TYPE_RPC}    rpc-device
-${DEVICE_TYPE_RPC_CREATE}    rpc-create-device
-${DEVICE_TYPE_RPC_DELETE}    rpc-delete-device
-${USE_NETCONF_CONNECTOR}    ${False}
-${DELETE_LOCATION}    delete_location
-${RPC_FILE}       ${CURDIR}/../../../variables/netconf/CRUD/customaction/customaction.xml
+${DIRECTORY_WITH_TEMPLATE_FOLDERS}      ${CURDIR}/../../../variables/netconf/CRUD
+${DEVICE_NAME}                          netconf-test-device
+${DEVICE_TYPE_RPC}                      rpc-device
+${DEVICE_TYPE_RPC_CREATE}               rpc-create-device
+${DEVICE_TYPE_RPC_DELETE}               rpc-delete-device
+${USE_NETCONF_CONNECTOR}                ${False}
+${DELETE_LOCATION}                      delete_location
+${RPC_FILE}                             ${CURDIR}/../../../variables/netconf/CRUD/customaction/customaction.xml
+
 
 *** Test Cases ***
 Check_Device_Is_Not_Configured_At_Beginning
@@ -45,7 +49,11 @@ Check_Device_Is_Not_Configured_At_Beginning
 Configure_Device_On_Netconf
     [Documentation]    Make request to configure a testtool device on Netconf connector.
     [Tags]    critical
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=${DEVICE_TYPE}    http_timeout=2    http_method=post
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=${DEVICE_TYPE}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Check_ODL_Has_Netconf_Connector_For_Device
     [Documentation]    Get the list of configured devices and search for our device there. Fail if not found.
@@ -64,30 +72,44 @@ Check_Device_Data_Is_Empty
 
 Invoke_Yang1.1_Action_Via_Xml_Post
     [Documentation]    Send a sample test data label into the device and check that the request went OK.
-    ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}dataorigaction    ${template_as_string}
+    ${template_as_string} =    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}dataorigaction
+    ...    ${template_as_string}
 
 Invoke_Yang1.1_Action_Via_Json_Post
     [Documentation]    Send a sample test data label into the device and check that the request went OK.
-    ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Json_RFC8040_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}dataorigaction    ${template_as_string}
+    ${template_as_string} =    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
+    TemplatedRequests.Post_As_Json_RFC8040_Templated
+    ...    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}dataorigaction
+    ...    ${template_as_string}
 
 Invoke_Yang1.1_Augmentation_Via_Xml_Post
     [Documentation]    Send a sample test data label into the device and check that the request went OK.
-    ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
+    ${template_as_string} =    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
     TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}augment    ${template_as_string}
 
 Invoke_Yang1.1_Augmentation_Via_Json_Post
     [Documentation]    Send a sample test data label into the device and check that the request went OK.
-    ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Json_RFC8040_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}augment    ${template_as_string}
+    ${template_as_string} =    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
+    TemplatedRequests.Post_As_Json_RFC8040_Templated
+    ...    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}augment
+    ...    ${template_as_string}
 
 Deconfigure_Device_From_Netconf
     [Documentation]    Make request to deconfigure the testtool device on Netconf connector.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    CompareStream.Run_Keyword_If_At_Most_Nitrogen    NetconfKeywords.Remove_Device_From_Netconf    ${DEVICE_NAME}    location=${DELETE_LOCATION}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=${DEVICE_TYPE_RPC_DELETE}    http_timeout=2    http_method=post
+    CompareStream.Run_Keyword_If_At_Most_Nitrogen
+    ...    NetconfKeywords.Remove_Device_From_Netconf
+    ...    ${DEVICE_NAME}
+    ...    location=${DELETE_LOCATION}
+    CompareStream.Run_Keyword_If_At_Least_Oxygen
+    ...    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=${DEVICE_TYPE_RPC_DELETE}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Documentation]    Check that the device is really going to be gone. Fail
@@ -101,17 +123,27 @@ Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils. Setup everything needed for the test cases.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${REST_API}    auth=${AUTH}
     NetconfKeywords.Setup_Netconf_Keywords
-    ${DEVICE_TYPE_RPC} =    BuiltIn.Set_Variable_If    """${USE_NETCONF_CONNECTOR}""" == """True"""    default    ${DEVICE_TYPE_RPC}
-    ${DEVICE_TYPE} =    CompareStream.Set_Variable_If_At_Most_Nitrogen    ${DEVICE_TYPE_RPC}    ${DEVICE_TYPE_RPC_CREATE}
+    ${DEVICE_TYPE_RPC} =    BuiltIn.Set_Variable_If
+    ...    """${USE_NETCONF_CONNECTOR}""" == """True"""
+    ...    default
+    ...    ${DEVICE_TYPE_RPC}
+    ${DEVICE_TYPE} =    CompareStream.Set_Variable_If_At_Most_Nitrogen
+    ...    ${DEVICE_TYPE_RPC}
+    ...    ${DEVICE_TYPE_RPC_CREATE}
     BuiltIn.Set_Suite_Variable    ${DEVICE_TYPE}
     OperatingSystem.File Should Exist    ${RPC_FILE}
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas    rpc_config=${RPC_FILE}    mdsal=true
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    ...    rpc_config=${RPC_FILE}
+    ...    mdsal=true
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
@@ -120,12 +152,15 @@ Teardown_Everything
 
 Get_Config_Data
     [Documentation]    Get and return the config data from the device.
-    ${url} =    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    ${url} =    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data} =    TemplatedRequests.Get_As_Xml_From_Uri    ${url}
-    [Return]    ${data}
+    RETURN    ${data}
 
 Check_Config_Data
     [Arguments]    ${expected}    ${contains}=False
     ${data} =    Get_Config_Data
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
index 4fc2d8c140a21b4575bc32f7f3d3cef98d660010..996c90c9fca894a8559358344c052ba71cb5fc3d 100644 (file)
@@ -1,51 +1,58 @@
 *** Settings ***
-Documentation     netconf-connector CRUD test suite.
+Documentation       netconf-connector CRUD test suite.
 ...
-...               Copyright (c) 2017 Lumina Networks, Inc. and others. All rights reserved.
+...                 Copyright (c) 2017 Lumina Networks, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector using RPC for node addition and see if
-...               they work.
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector using RPC for node addition and see if
+...                 they work.
 ...
-...               FIXME: Replace the BuiltIn.Should_[Not_]Contain instances in the test cases
-...               that check the car list related data with calls to keywords of a Resource
-...               aimed at getting interesting pieces of data from the XML files and checking
-...               them against expected data sets. See MDSAL/northbound.robot suite for
-...               additional information.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+...                 FIXME: Replace the BuiltIn.Should_[Not_]Contain instances in the test cases
+...                 that check the car list related data with calls to keywords of a Resource
+...                 aimed at getting interesting pieces of data from the XML files and checking
+...                 them against expected data sets. See MDSAL/northbound.robot suite for
+...                 additional information.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
-${device_name}    netconf-test-device
-${device_type_rpc}    rpc-device
-${device_type_rpc_create}    rpc-create-device
-${device_type_rpc_delete}    rpc-delete-device
-${USE_NETCONF_CONNECTOR}    ${False}
-${delete_location}    delete_location
+${directory_with_template_folders}      ${CURDIR}/../../../variables/netconf/CRUD
+${device_name}                          netconf-test-device
+${device_type_rpc}                      rpc-device
+${device_type_rpc_create}               rpc-create-device
+${device_type_rpc_delete}               rpc-delete-device
+${USE_NETCONF_CONNECTOR}                ${False}
+${delete_location}                      delete_location
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    [Tags]    ODLMICRO_IGN
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas    mdsal=true
+    [Tags]    odlmicro_ign
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    ...    mdsal=true
 
 Check_Device_Is_Not_Configured_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -55,12 +62,16 @@ Check_Device_Is_Not_Configured_At_Beginning
 Configure_Device_On_Netconf
     [Documentation]    Make request to configure a testtool device on Netconf connector.
     [Tags]    critical
-    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}    device_type=${device_type}    http_timeout=2    http_method=post
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${device_name}
+    ...    device_type=${device_type}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Check_ODL_Has_Netconf_Connector_For_Device
     [Documentation]    Get the list of configured devices and search for our device there. Fail if not found.
     [Tags]    critical
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${device_name}
+    ${count}=    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${device_name}
     Builtin.Should_Be_Equal_As_Strings    ${count}    1
 
 Wait_For_Device_To_Become_Connected
@@ -79,7 +90,8 @@ Create_Device_Data_Label_Via_Xml
 
 Check_Device_Data_Label_Is_Created
     [Documentation]    Get the device data label and make sure it contains the created content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
 
 Modify_Device_Data_Label_Via_Xml
     [Documentation]    Send a request to change the sample test data label and check that the request went OK.
@@ -88,7 +100,8 @@ Modify_Device_Data_Label_Via_Xml
 
 Check_Device_Data_Label_Is_Modified
     [Documentation]    Get the device data label and make sure it contains the modified content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
 
 Deconfigure_Device_From_Netconf_Temporarily
     [Documentation]    Make request to deconfigure the testtool device on Netconf connector.
@@ -97,8 +110,16 @@ Deconfigure_Device_From_Netconf_Temporarily
     ...    data was really stored in the device.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    CompareStream.Run_Keyword_If_At_Most_Nitrogen    NetconfKeywords.Remove_Device_From_Netconf    ${device_name}    location=${delete_location}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}    device_type=${device_type_rpc_delete}    http_timeout=2    http_method=post
+    CompareStream.Run_Keyword_If_At_Most_Nitrogen
+    ...    NetconfKeywords.Remove_Device_From_Netconf
+    ...    ${device_name}
+    ...    location=${delete_location}
+    CompareStream.Run_Keyword_If_At_Least_Oxygen
+    ...    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${device_name}
+    ...    device_type=${device_type_rpc_delete}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Wait_For_Device_To_Be_Gone
     [Documentation]    Wait for the device to completely disappear.
@@ -108,7 +129,11 @@ Configure_The_Device_Back
     [Documentation]    Configure the device again.
     ...    This is the second step of the device configuration.
     [Tags]    critical
-    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}    device_type=${device_type}    http_timeout=2    http_method=post
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${device_name}
+    ...    device_type=${device_type}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Wait_For_Device_To_Reconnect
     [Documentation]    Wait until the device becomes available through Netconf.
@@ -116,7 +141,11 @@ Wait_For_Device_To_Reconnect
 
 Check_Modified_Device_Data_Is_Still_There
     [Documentation]    Get the device data and make sure it contains the created content.
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    1s    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    60s
+    ...    1s
+    ...    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
 
 Modify_Device_Data_Again
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
@@ -125,16 +154,20 @@ Modify_Device_Data_Again
 
 Check_Device_Data_Is_Modified_Again
     [Documentation]    Get the device data and make sure it contains the created content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Another Modified Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Another Modified Content</l></cont></data>
 
 Modify_Device_Data_Label_Via_Json
     [Documentation]    Send a JSON request to change the sample test data label and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Json_Templated    ${directory_with_template_folders}${/}datamodjson    ${template_as_string}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${directory_with_template_folders}${/}datamodjson
+    ...    ${template_as_string}
 
 Check_Device_Data_Label_Is_Modified_Via_Json
     [Documentation]    Get the device data label as XML and make sure it matches the content posted as JSON in the previous case.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content Modified via JSON</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content Modified via JSON</l></cont></data>
 
 Create_Car_List
     [Documentation]    Send a request to create a list of cars in the sample test data label and check that the request went OK.
@@ -209,8 +242,16 @@ Deconfigure_Device_From_Netconf
     [Documentation]    Make request to deconfigure the testtool device on Netconf connector.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    CompareStream.Run_Keyword_If_At_Most_Nitrogen    NetconfKeywords.Remove_Device_From_Netconf    ${device_name}    location=${delete_location}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}    device_type=${device_type_rpc_delete}    http_timeout=2    http_method=post
+    CompareStream.Run_Keyword_If_At_Most_Nitrogen
+    ...    NetconfKeywords.Remove_Device_From_Netconf
+    ...    ${device_name}
+    ...    location=${delete_location}
+    CompareStream.Run_Keyword_If_At_Least_Oxygen
+    ...    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${device_name}
+    ...    device_type=${device_type_rpc_delete}
+    ...    http_timeout=2
+    ...    http_method=post
 
 Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Documentation]    Check that the device is really going to be gone. Fail
@@ -224,6 +265,7 @@ Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${device_name}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils. Setup everything needed for the test cases.
@@ -231,8 +273,13 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${REST_API}    auth=${AUTH}
     NetconfKeywords.Setup_Netconf_Keywords
-    ${device_type_rpc}=    BuiltIn.Set_Variable_If    """${USE_NETCONF_CONNECTOR}""" == """True"""    default    ${device_type_rpc}
-    ${device_type}    CompareStream.Set_Variable_If_At_Most_Nitrogen    ${device_type_rpc}    ${device_type_rpc_create}
+    ${device_type_rpc}=    BuiltIn.Set_Variable_If
+    ...    """${USE_NETCONF_CONNECTOR}""" == """True"""
+    ...    default
+    ...    ${device_type_rpc}
+    ${device_type}=    CompareStream.Set_Variable_If_At_Most_Nitrogen
+    ...    ${device_type_rpc}
+    ...    ${device_type_rpc_create}
     BuiltIn.Set_Suite_Variable    ${device_type}
 
 Teardown_Everything
@@ -242,12 +289,15 @@ Teardown_Everything
 
 Get_Config_Data
     [Documentation]    Get and return the config data from the device.
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${device_name}/yang-ext:mount?content=config
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${device_name}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}
-    [Return]    ${data}
+    RETURN    ${data}
 
 Check_Config_Data
     [Arguments]    ${expected}    ${contains}=False
     ${data}=    Get_Config_Data
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
index d8f81d0f06023bb8128b0bb7195d5e2a699cc6fb..1bb2dfe96288cb660804e61315c7771b170648a6 100644 (file)
@@ -1,47 +1,54 @@
 *** Settings ***
-Documentation     netconf-connector CRUD test suite.
+Documentation       netconf-connector CRUD test suite.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector and see if they work.
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector and see if they work.
 ...
-...               FIXME: Replace the BuiltIn.Should_[Not_]Contain instances in the test cases
-...               that check the car list related data with calls to keywords of a Resource
-...               aimed at getting interesting pieces of data from the XML files and checking
-...               them against expected data sets. See MDSAL/northbound.robot suite for
-...               additional information.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 FIXME: Replace the BuiltIn.Should_[Not_]Contain instances in the test cases
+...                 that check the car list related data with calls to keywords of a Resource
+...                 aimed at getting interesting pieces of data from the XML files and checking
+...                 them against expected data sets. See MDSAL/northbound.robot suite for
+...                 additional information.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
-${device_name}    netconf-test-device
-${device_type}    full-uri-device
-${USE_NETCONF_CONNECTOR}    ${False}
+${directory_with_template_folders}      ${CURDIR}/../../../variables/netconf/CRUD
+${device_name}                          netconf-test-device
+${device_type}                          full-uri-device
+${USE_NETCONF_CONNECTOR}                ${False}
+
 
 *** Test Cases ***
 Start_Testtool
-    [Tags]    ODLMICRO_IGN
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas    mdsal=true
+    [Tags]    odlmicro_ign
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    ...    mdsal=true
 
 Check_Device_Is_Not_Configured_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -74,7 +81,8 @@ Create_Device_Data_Label_Via_Xml
 
 Check_Device_Data_Label_Is_Created
     [Documentation]    Get the device data label and make sure it contains the created content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
 
 Modify_Device_Data_Label_Via_Xml
     [Documentation]    Send a request to change the sample test data label and check that the request went OK.
@@ -83,7 +91,8 @@ Modify_Device_Data_Label_Via_Xml
 
 Check_Device_Data_Label_Is_Modified
     [Documentation]    Get the device data label and make sure it contains the modified content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
 
 Deconfigure_Device_From_Netconf_Temporarily
     [Documentation]    Make request to deconfigure the testtool device on Netconf connector.
@@ -110,7 +119,11 @@ Wait_For_Device_To_Reconnect
 
 Check_Modified_Device_Data_Is_Still_There
     [Documentation]    Get the device data and make sure it contains the created content.
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    1s    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    60s
+    ...    1s
+    ...    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
 
 Modify_Device_Data_Again
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
@@ -119,16 +132,20 @@ Modify_Device_Data_Again
 
 Check_Device_Data_Is_Modified_Again
     [Documentation]    Get the device data and make sure it contains the created content.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Another Modified Content</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Another Modified Content</l></cont></data>
 
 Modify_Device_Data_Label_Via_Json
     [Documentation]    Send a JSON request to change the sample test data label and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Json_Templated    ${directory_with_template_folders}${/}datamodjson    ${template_as_string}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${directory_with_template_folders}${/}datamodjson
+    ...    ${template_as_string}
 
 Check_Device_Data_Label_Is_Modified_Via_Json
     [Documentation]    Get the device data label as XML and make sure it matches the content posted as JSON in the previous case.
-    Check_Config_Data    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content Modified via JSON</l></cont></data>
+    Check_Config_Data
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content Modified via JSON</l></cont></data>
 
 Create_Car_List
     [Documentation]    Send a request to create a list of cars in the sample test data label and check that the request went OK.
@@ -217,6 +234,7 @@ Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${device_name}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils. Setup everything needed for the test cases.
@@ -224,7 +242,10 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${REST_API}    auth=${AUTH}
     NetconfKeywords.Setup_Netconf_Keywords
-    ${device_type}=    BuiltIn.Set_Variable_If    """${USE_NETCONF_CONNECTOR}""" == """True"""    default    ${device_type}
+    ${device_type}=    BuiltIn.Set_Variable_If
+    ...    """${USE_NETCONF_CONNECTOR}""" == """True"""
+    ...    default
+    ...    ${device_type}
     BuiltIn.Set_Suite_Variable    ${device_type}
 
 Teardown_Everything
@@ -234,16 +255,19 @@ Teardown_Everything
 
 Get_Config_Data
     [Documentation]    Get and return the config data from the device.
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${device_name}/yang-ext:mount?content=config
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${device_name}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}
-    [Return]    ${data}
+    RETURN    ${data}
 
 Check_Config_Data
     [Arguments]    ${expected}    ${contains}=False
     ${data}=    Get_Config_Data
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
 
 Count_Netconf_Connectors
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${device_name}
+    ${count}=    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${device_name}
     Builtin.Should_Be_Equal_As_Strings    ${count}    1
index b13b627e7e8db7dc5b11365bcf62729bcb1a1f96..e24c8bca1260d3513c3e75b19568cc90cd4e8c99 100644 (file)
@@ -1,30 +1,34 @@
 *** Settings ***
-Documentation     Test suite to verify the device mount using public key based auth.
-Suite Setup       Suite Setup
-Suite Teardown    Suite Teardown
-Library           SSHLibrary
-Library           RequestsLibrary
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+Documentation       Test suite to verify the device mount using public key based auth.
+
+Library             SSHLibrary
+Library             RequestsLibrary
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Suite Setup
+Suite Teardown      Suite Teardown
+
 
 *** Variables ***
-${directory_with_keyauth_template}    ${CURDIR}/../../../variables/netconf/KeyAuth
-${pkPassphrase}    topsecret
-${device_name}    netconf-test-device
-${device_type_passw}    full-uri-device
-${device_type_key}    full-uri-device-key
-${netopeer_port}    830
-${netopeer_username}    netconf
-${netopeer_password}    wrong
-${netopeer_key}    device-key
-${netopeer_image}    sysrepo/sysrepo-netopeer2:latest
-${USE_NETCONF_CONNECTOR}    ${False}
+${directory_with_keyauth_template}      ${CURDIR}/../../../variables/netconf/KeyAuth
+${pkPassphrase}                         topsecret
+${device_name}                          netconf-test-device
+${device_type_passw}                    full-uri-device
+${device_type_key}                      full-uri-device-key
+${netopeer_port}                        830
+${netopeer_username}                    netconf
+${netopeer_password}                    wrong
+${netopeer_key}                         device-key
+${netopeer_image}                       sysrepo/sysrepo-netopeer2:latest
+${USE_NETCONF_CONNECTOR}                ${False}
+
 
 *** Test Cases ***
 Check_Device_Is_Not_Configured_At_Beginning
@@ -59,15 +63,18 @@ Check_Device_Going_To_Be_Gone_After_Deconfiguring
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${device_name}
 
+
 *** Keywords ***
 Run Netopeer Docker Container
     [Documentation]    Start a new docker container for netopeer server.
-    ${netopeer_conn_id} =    SSHKeywords.Open_Connection_To_Tools_System
+    ${netopeer_conn_id}=    SSHKeywords.Open_Connection_To_Tools_System
     SSHLibrary.Put File    ${CURDIR}/../../../variables/netconf/KeyAuth/sb-rsa-key.pub    .
     Builtin.Set Suite Variable    ${netopeer_conn_id}
     ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
     ...    docker run -dt -p ${netopeer_port}:830 -v /home/${TOOLS_SYSTEM_USER}/sb-rsa-key.pub:/home/${netopeer_username}/.ssh/authorized_keys ${netopeer_image} netopeer2-server -d -v 2
-    ...    return_stdout=True    return_stderr=True    return_rc=True
+    ...    return_stdout=True
+    ...    return_stderr=True
+    ...    return_rc=True
     ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker ps -a
     ...    return_stdout=True    return_stderr=True    return_rc=True
     Log    ${stdout}
@@ -76,8 +83,13 @@ Configure ODL with Key config
     [Documentation]    Configure the ODL with the Southbound key configuration file containing details about private key path and passphrase
     SSHKeywords.Open_Connection_To_ODL_System
     Log    Bundle folder ${WORKSPACE}/${BUNDLEFOLDER}/etc
-    SSHLibrary.Put File    ${CURDIR}/../../../variables/netconf/KeyAuth/org.opendaylight.netconf.topology.sb.keypair.cfg    ${WORKSPACE}/${BUNDLEFOLDER}/etc/
-    SSHLibrary.Put File    ${CURDIR}/../../../variables/netconf/KeyAuth/sb-rsa-key    ${WORKSPACE}/${BUNDLEFOLDER}/etc/    400
+    SSHLibrary.Put File
+    ...    ${CURDIR}/../../../variables/netconf/KeyAuth/org.opendaylight.netconf.topology.sb.keypair.cfg
+    ...    ${WORKSPACE}/${BUNDLEFOLDER}/etc/
+    SSHLibrary.Put File
+    ...    ${CURDIR}/../../../variables/netconf/KeyAuth/sb-rsa-key
+    ...    ${WORKSPACE}/${BUNDLEFOLDER}/etc/
+    ...    400
     ${stdout}=    SSHLibrary.Execute Command    ls -l ${WORKSPACE}/${BUNDLEFOLDER}/etc/    return_stdout=True
     Log    ${stdout}
     Restart Controller
@@ -96,7 +108,7 @@ Restart Controller
 
 Get Controller Modules
     [Documentation]    Get the restconf modules, check 200 status and ietf-restconf presence
-    ${resp} =    RequestsLibrary.Get_Request    default    ${MODULES_API}
+    ${resp}=    RequestsLibrary.Get_Request    default    ${MODULES_API}
     BuiltIn.Log    ${resp.content}
     BuiltIn.Should_Be_Equal    ${resp.status_code}    ${200}
     BuiltIn.Should_Contain    ${resp.content}    ietf-restconf
@@ -110,8 +122,11 @@ Suite Setup
     [Documentation]    Get the suite ready for callhome test cases.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords
-    ${device_type_passw}=    BuiltIn.Set_Variable_If    """${USE_NETCONF_CONNECTOR}""" == """True"""    default    ${device_type_passw}
-    ${device_type}    CompareStream.Set_Variable_If_At_Most_Nitrogen    ${device_type_passw}    ${device_type_key}
+    ${device_type_passw}=    BuiltIn.Set_Variable_If
+    ...    """${USE_NETCONF_CONNECTOR}""" == """True"""
+    ...    default
+    ...    ${device_type_passw}
+    ${device_type}=    CompareStream.Set_Variable_If_At_Most_Nitrogen    ${device_type_passw}    ${device_type_key}
     BuiltIn.Set_Suite_Variable    ${device_type}
     Run Netopeer Docker Container
     CompareStream.Run_Keyword_If_At_Most_Nitrogen    Configure ODL with Key config
index ec7343616dec480927e8a45b6142f36a02a32f61..c21403c062c07808ae0acc4a34e89551d8d76fce 100644 (file)
@@ -1,53 +1,57 @@
 *** Settings ***
-Documentation     Metconf MDSAL Northbound test suite.
+Documentation       Metconf MDSAL Northbound test suite.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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.
+...                 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.
+...                 TODO: Change the 4 testcases to use unique message IDs.
 ...
-...               TODO: There are many sections with too many "Should_[Not_]Contain" keyword
-...               invocations (see Check_Multiple_Modules_Merge_Replace for a particularly bad
-...               example). Create a resource that will be able to extract the data from the
-...               requests and search for them in the response, then convert to usage of this
-...               resource (think "Thou shall not repeat yourself"). The following resource was
-...               found when doing research on this:
-...               http://robotframework.org/robotframework/latest/libraries/XML.html
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           XML
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 TODO: There are many sections with too many "Should_[Not_]Contain" keyword
+...                 invocations (see Check_Multiple_Modules_Merge_Replace for a particularly bad
+...                 example). Create a resource that will be able to extract the data from the
+...                 requests and search for them in the response, then convert to usage of this
+...                 resource (think "Thou shall not repeat yourself"). The following resource was
+...                 found when doing research on this:
+...                 http://robotframework.org/robotframework/latest/libraries/XML.html
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             XML
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${datadir}        ${CURDIR}/../../../variables/netconf/MDSAL
-${dataext}        msg
-${ssh_netconf_pid}    -1
+${datadir}              ${CURDIR}/../../../variables/netconf/MDSAL
+${dataext}              msg
+${ssh_netconf_pid}      -1
+
 
 *** Test Cases ***
 Connect_To_ODL_Netconf
@@ -318,16 +322,17 @@ Close_Session
     [Documentation]    Close the session and check that it was closed properly.
     Perform_Test    close-session
 
+
 *** Keywords ***
 Get_Data
-    [Arguments]    ${name}
     [Documentation]    Load the specified data from the data directory and return it.
+    [Arguments]    ${name}
     ${data}=    OperatingSystem.Get_File    ${datadir}${/}${name}.${dataext}
-    [Return]    ${data}
+    RETURN    ${data}
 
 Create_ODL_Netconf_Connection
-    [Arguments]    ${host}=${ODL_SYSTEM_IP}    ${port}=${ODL_NETCONF_MDSAL_PORT}    ${user}=${ODL_NETCONF_USER}    ${password}=${ODL_NETCONF_PASSWORD}
     [Documentation]    Open a netconf connecion to the given machine.
+    [Arguments]    ${host}=${ODL_SYSTEM_IP}    ${port}=${ODL_NETCONF_MDSAL_PORT}    ${user}=${ODL_NETCONF_USER}    ${password}=${ODL_NETCONF_PASSWORD}
     # The "-s netconf" flag (see the "SSHLibrary.Write" line below)    is not
     # supported by SSHLibrary, therefore we need to use this elaborate and
     # pretty tricky way to connect to the ODL Netconf port.
@@ -353,61 +358,62 @@ Create_ODL_Netconf_Connection
 
 Reopen_ODL_Netconf_Connection
     [Documentation]    Reopen a closed netconf connection.
-    SSHLibrary.Write    sshpass -p ${ssh_password} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ssh_user}\@127.0.0.1 -p ${ssh_port} -s netconf
+    SSHLibrary.Write
+    ...    sshpass -p ${ssh_password} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ssh_user}\@127.0.0.1 -p ${ssh_port} -s netconf
     ${hello}=    SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
     SSHLibrary.Switch_Connection    ${ssh_control}
     ${pid}=    SSHLibrary.Execute_Command    ps -A | grep sshpass | awk '{print $1}'
     BuiltIn.Set_Suite_Variable    ${ssh_netconf_pid}    ${pid}
     SSHLibrary.Switch_Connection    ${ssh_netconf}
-    [Return]    ${hello}
+    RETURN    ${hello}
 
 Open_ODL_Netconf_Connection
     [Documentation]    Open a prepared netconf connecion.
     ${hello}=    Reopen_ODL_Netconf_Connection
     ${hello_message}=    Get_Data    hello
     Transmit_Message    ${hello_message}
-    [Return]    ${hello}
+    RETURN    ${hello}
 
 Transmit_Message
-    [Arguments]    ${message}
     [Documentation]    Transmit message to Netconf connection and discard the echo of the message.
+    [Arguments]    ${message}
     SSHLibrary.Write    ${message}
     SSHLibrary.Write    ${ODL_NETCONF_PROMPT}
     SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
 
 Send_Message
-    [Arguments]    ${message}
     [Documentation]    Send message to Netconf connection and get the reply.
+    [Arguments]    ${message}
     Transmit_Message    ${message}
     ${reply}=    SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
-    [Return]    ${reply}
+    RETURN    ${reply}
 
 Prepare_For_Search
-    [Arguments]    ${searched_string}
     [Documentation]    Prepare the specified string for searching in Netconf connection replies.
     ...    The string passed to this keyword is coming from a data
     ...    file which has different end of line conventions than
     ...    the actual Netconf reply. This keyword patches the string
     ...    to match what Netconf actually returns.
+    [Arguments]    ${searched_string}
     ${result}=    BuiltIn.Evaluate    "\\r\\n".join("""${searched_string}""".split("\\n"))
-    [Return]    ${result}
+    RETURN    ${result}
 
 Load_And_Send_Message
-    [Arguments]    ${name}
     [Documentation]    Load a message from the data file set, send it to Netconf and return the reply.
+    [Arguments]    ${name}
     ${request}=    Get_Data    ${name}-request
     ${reply}=    Send_Message    ${request}
-    [Return]    ${reply}
+    RETURN    ${reply}
 
 Load_Expected_Reply
-    [Arguments]    ${name}
     [Documentation]    Load the expected reply from the data file set and return it.
+    [Arguments]    ${name}
     ${expected_reply}=    Get_Data    ${name}-reply
-    [Return]    ${expected_reply}
+    RETURN    ${expected_reply}
 
 Abort_ODL_Netconf_Connection
     [Documentation]    Correctly close the Netconf connection and make sure it is really dead.
-    BuiltIn.Return_From_Keyword_If    ${ssh_netconf_pid} == -1
+    IF    ${ssh_netconf_pid} == -1    RETURN
     ${kill_command}=    BuiltIn.Set_Variable    kill ${ssh_netconf_pid}
     BuiltIn.Set_Suite_Variable    ${ssh_netconf_pid}    -1
     SSHLibrary.Switch_Connection    ${ssh_control}
@@ -497,22 +503,22 @@ Check_Test_Objects_Absent
     BuiltIn.Should_not_Contain    ${reply}    <id>test</id>
 
 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.
+    [Arguments]    ${name}
     ${reply}=    Load_And_Send_Message    ${name}
     Check_Test_Objects_Absent    ${reply}
     BuiltIn.Should_not_Contain    ${reply}    <id>REPLACE</id>
-    [Return]    ${reply}
+    RETURN    ${reply}
 
 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.
+    [Arguments]    ${name}
     ${actual}=    Load_And_Send_Message    ${name}
     ${expected}=    Load_Expected_Reply    ${name}
     ${actual}=    String.Remove String    ${actual}    ]]>]]>
     ${actual}=    String.Strip String    ${actual}    mode=both
     XML.Elements Should Be Equal    ${actual}    ${expected}    normalize_whitespace=True
-    [Return]    ${actual}
+    RETURN    ${actual}
 
 Send_And_Check
     [Arguments]    ${name}    ${expected}
index 9b93a73f3073cb65dcd4c69bcb0ef422a2e35052..f3a699f8eef0e75f0a4188221f05ab173b25cf66 100644 (file)
@@ -1,13 +1,17 @@
 *** Settings ***
-Documentation     Test suite to verify Apidocs is OK.
-Suite Setup       TemplatedRequests.Create_Default_Session    timeout=30
-Suite Teardown    RequestsLibrary.Delete_All_Sessions
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+Documentation       Test suite to verify Apidocs is OK.
+
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         TemplatedRequests.Create_Default_Session    timeout=30
+Suite Teardown      RequestsLibrary.Delete_All_Sessions
+
 
 *** Variables ***
-${VAR_DIR}        ${CURDIR}/../../../variables/apidoc
+${VAR_DIR}      ${CURDIR}/../../../variables/apidoc
+
 
 *** Test Cases ***
 Get Apidoc Apis
index 4778ca17c293ec3ddf0015a82692b6ecfa13670c..bc9ac48ffbbcb81cd1131c6471a23721c6ed409d 100644 (file)
@@ -1,14 +1,17 @@
 *** Settings ***
-Documentation     Test suite to verify callhome functionality over SSH transport protocol. Registration in OpenDaylight
-...               Controller happens via restconf interface. Netopeer2-server docker container plays a role of the
-...               netconf device with call-home feature. Docker-compose file is used to configure netopeer2 docker
-...               container(netconf configuration templates, host-key).
-Suite Setup       Suite Setup
-Suite Teardown    Suite Teardown
-Test Setup        Test Setup
-Test Teardown     Test Teardown
-Resource          ../../../libraries/NetconfCallHome.robot
-Resource          ../../../libraries/CompareStream.robot
+Documentation       Test suite to verify callhome functionality over SSH transport protocol. Registration in OpenDaylight
+...                 Controller happens via restconf interface. Netopeer2-server docker container plays a role of the
+...                 netconf device with call-home feature. Docker-compose file is used to configure netopeer2 docker
+...                 container(netconf configuration templates, host-key).
+
+Resource            ../../../libraries/NetconfCallHome.robot
+Resource            ../../../libraries/CompareStream.robot
+
+Suite Setup         Suite Setup
+Suite Teardown      Suite Teardown
+Test Setup          Test Setup
+Test Teardown       Test Teardown
+
 
 *** Test Cases ***
 CallHome with Incorrect global Credentials
@@ -16,20 +19,38 @@ CallHome with Incorrect global Credentials
     Apply SSH-based Call-Home configuration
     Register global credentials for SSH call-home devices (APIv1)    incorrect    root
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    ${NETOPEER_PUB_KEY}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    FAILED_AUTH_FAILURE
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 CallHome with Incorrect per-device Credentials
     [Documentation]    Incorrect per-device credentials should result to mount failure. FAILED_AUTH_FAILURE should be the device status.
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    ${NETOPEER_PUB_KEY}    root    incorrect
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    FAILED_AUTH_FAILURE
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 CallHome with Incorrect Node-id
@@ -37,10 +58,19 @@ CallHome with Incorrect Node-id
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv1)    incorrect_hostname    ${EMPTY}    root    root
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    ${NETOPEER_PUB_KEY}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    DISCONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 CallHome with Rogue Devices
@@ -48,11 +78,20 @@ CallHome with Rogue Devices
     ...    FAILED_NOT_ALLOWED should be the device status.
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    incorrect-key-value    root    root
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     # Next line is commented due to https://jira.opendaylight.org/browse/NETCONF-574
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    FAILED_NOT_ALLOWED
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 Successful CallHome with correct global credentials
@@ -61,72 +100,140 @@ Successful CallHome with correct global credentials
     Apply SSH-based Call-Home configuration
     Register global credentials for SSH call-home devices (APIv1)    root    root
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    ${NETOPEER_PUB_KEY}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    CONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${mount_point_url}    ${netconf_mount_expected_values}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
+    ...    ${netconf_mount_expected_values}
 
 Successful CallHome with correct per-device credentials
     [Documentation]    Device being in whitelist of the Call Home server along with correct per-device credentials will result to successful mount.
     ...    CONNECTED should be the device status.
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv1)    netopeer2    ${NETOPEER_PUB_KEY}    root    root
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    CONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${mount_point_url}    ${netconf_mount_expected_values}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
+    ...    ${netconf_mount_expected_values}
 
 CallHome over SSH with correct device credentials (APIv2)
     [Documentation]    Correct credentials should result to successful mount. CONNECTED should be the device status.
-    CompareStream.Run_Keyword_If_Less_Than_Silicon    BuiltIn.Pass_Execution    Test case valid only for versions silicon and above.
+    CompareStream.Run_Keyword_If_Less_Than_Silicon
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions silicon and above.
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv2)    netopeer2    ${NETOPEER_PUB_KEY}    root    root
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    CONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${mount_point_url}    ${netconf_mount_expected_values}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
+    ...    ${netconf_mount_expected_values}
 
 CallHome over SSH with incorrect device credentials (APIv2)
     [Documentation]    Correct credentials should result to successful mount. CONNECTED should be the device status.
-    CompareStream.Run_Keyword_If_Less_Than_Silicon    BuiltIn.Pass_Execution    Test case valid only for versions silicon and above.
+    CompareStream.Run_Keyword_If_Less_Than_Silicon
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions silicon and above.
     Apply SSH-based Call-Home configuration
     Register SSH call-home device in ODL controller (APIv2)    netopeer2    ${NETOPEER_PUB_KEY}    root    incorrect
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    FAILED_AUTH_FAILURE
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 CallHome over SSH with correct global credentials (APIv2)
     [Documentation]    CallHome SSH device registered via APIv2 with global credentials from APIv1 should result to successful mount.
-    CompareStream.Run_Keyword_If_Less_Than_Silicon    BuiltIn.Pass_Execution    Test case valid only for versions silicon and above.
+    CompareStream.Run_Keyword_If_Less_Than_Silicon
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions silicon and above.
     Apply SSH-based Call-Home configuration
     Register global credentials for SSH call-home devices (APIv1)    root    root
     Register SSH call-home device in ODL controller (APIv2)    netopeer2    ${NETOPEER_PUB_KEY}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    CONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${mount_point_url}    ${netconf_mount_expected_values}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
+    ...    ${netconf_mount_expected_values}
 
 CallHome over SSH with incorrect global credentials (APIv2)
     [Documentation]    CallHome SSH device registered via APIv2 with wrong global credentials from APIv1 should fail.
-    CompareStream.Run_Keyword_If_Less_Than_Silicon    BuiltIn.Pass_Execution    Test case valid only for versions silicon and above.
+    CompareStream.Run_Keyword_If_Less_Than_Silicon
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions silicon and above.
     Apply SSH-based Call-Home configuration
     Register global credentials for SSH call-home devices (APIv1)    root    incorrect
     Register SSH call-home device in ODL controller (APIv2)    netopeer2    ${NETOPEER_PUB_KEY}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    FAILED_AUTH_FAILURE
-    Wait Until Keyword Succeeds    30s    2s    Run Keyword And Expect Error    *    Utils.Check For Elements At URI    ${mount_point_url}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Run Keyword And Expect Error
+    ...    *
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
     ...    ${netconf_mount_expected_values}
 
 CallHome over TLS with correct certificate and key (APIv2)
     [Documentation]    Using correct certificate and key pair should result to successful mount. CONNECTED should be the device status.
-    CompareStream.Run_Keyword_If_Less_Than_Silicon    BuiltIn.Pass_Execution    Test case valid only for versions silicon and above.
+    CompareStream.Run_Keyword_If_Less_Than_Silicon
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions silicon and above.
     Apply TLS-based Call-Home configuration
     Register keys and certificates in ODL controller
     Register TLS call-home device in ODL controller (APIv2)    netopeer2    tls-device-key    tls-device-certificate
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    docker-compose up -d    return_stdout=True    return_stderr=True
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    docker-compose up -d
+    ...    return_stdout=True
+    ...    return_stderr=True
     ...    return_rc=True
     Wait Until Keyword Succeeds    90s    2s    NetconfCallHome.Check Device Status    CONNECTED
-    Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${mount_point_url}    ${netconf_mount_expected_values}
+    Wait Until Keyword Succeeds
+    ...    30s
+    ...    2s
+    ...    Utils.Check For Elements At URI
+    ...    ${mount_point_url}
+    ...    ${netconf_mount_expected_values}
index 3ba359058aaeffef932d7948b84e5f5454e3c6b1..06c0ff2f25dc59a1b73938dcf17047b84fbf4252 100644 (file)
@@ -1,67 +1,75 @@
 *** Settings ***
-Documentation     netconf clustered CRUD test suite.
+Documentation       netconf clustered CRUD test suite.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector and see if they work.
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector and see if they work.
 ...
-...               The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
-...               device at the beginning and then deconfigures it at the end), "SETTER" (the
-...               node that manipulates the data on the device) and "CHECKER" (the node that
-...               checks the data on the device). The configured device and the results of each
-...               data operation on it is expected to be visible on all nodes so after each
-...               operation three test cases make sure they can see the result on their
-...               respective nodes.
+...                 The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
+...                 device at the beginning and then deconfigures it at the end), "SETTER" (the
+...                 node that manipulates the data on the device) and "CHECKER" (the node that
+...                 checks the data on the device). The configured device and the results of each
+...                 data operation on it is expected to be visible on all nodes so after each
+...                 operation three test cases make sure they can see the result on their
+...                 respective nodes.
 ...
-...               The 3 nodes are configured by placing "node1", "node2" or "node3" into the
-...               ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
-...               a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
-...               to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
-...               variable where the "X" is 1, 2 or 3.
+...                 The 3 nodes are configured by placing "node1", "node2" or "node3" into the
+...                 ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
+...                 a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
+...                 to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
+...                 variable where the "X" is 1, 2 or 3.
 ...
-...               The suite checks the integrity of the presence of the device and the data
-...               seen on the device only for nodes that have at least one of the roles
-...               ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
-...               a "checker list" of sorts and have only one checking test case that runs
-...               through the check list and performs the test on each node listed. However
-...               this currently has fairly low priority due to Beryllium delivery date so
-...               it was left out.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 The suite checks the integrity of the presence of the device and the data
+...                 seen on the device only for nodes that have at least one of the roles
+...                 ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
+...                 a "checker list" of sorts and have only one checking test case that runs
+...                 through the check list and performs the test on each node listed. However
+...                 this currently has fairly low priority due to Beryllium delivery date so
+...                 it was left out.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${NODE_CONFIGURER}    node1
-${NODE_SETTER}    node2
-${NODE_CHECKER}    node3
-${DEVICE_CHECK_TIMEOUT}    10s
-${DEVICE_NAME}    netconf-test-device
-${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
-${empty_data}     <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
-${original_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
-${modified_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+${NODE_CONFIGURER}                      node1
+${NODE_SETTER}                          node2
+${NODE_CHECKER}                         node3
+${DEVICE_CHECK_TIMEOUT}                 10s
+${DEVICE_NAME}                          netconf-test-device
+${directory_with_template_folders}      ${CURDIR}/../../../variables/netconf/CRUD
+${empty_data}                           <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
+${original_data}
+...                                     <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
+${modified_data}
+...                                     <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -71,13 +79,21 @@ Check_Device_Is_Not_Mounted_At_Beginning
 Configure_Device_On_Netconf
     [Documentation]    Make request to configure a testtool device on Netconf connector
     [Tags]    critical
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology    session=${NODE_CONFIGURER}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=configure-via-topology
+    ...    session=${NODE_CONFIGURER}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5089
 
 Check_Configurer_Has_Netconf_Connector_For_Device
     [Documentation]    Get the list of mounts and search for our device there. Fail if not found.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Device_Instance_Count    1    session=${NODE_CONFIGURER}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Device_Instance_Count
+    ...    1
+    ...    session=${NODE_CONFIGURER}
 
 Wait_For_Device_To_Become_Visible_For_Configurer
     [Documentation]    Wait until the device becomes visible on configurer node.
@@ -93,37 +109,73 @@ Wait_For_Device_To_Become_Visible_For_Setter
 
 Check_Device_Data_Is_Seen_As_Empty_On_Configurer
     [Documentation]    Get the device data as seen by configurer and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CONFIGURER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CONFIGURER}
+    ...    ${empty_data}
 
 Check_Device_Data_Is_Seen_As_Empty_On_Checker
     [Documentation]    Get the device data as seen by checker and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CHECKER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CHECKER}
+    ...    ${empty_data}
 
 Check_Device_Data_Is_Seen_As_Empty_On_Setter
     [Documentation]    Get the device data as seen by setter and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_SETTER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_SETTER}
+    ...    ${empty_data}
 
 Create_Device_Data
     [Documentation]    Send some sample test data into the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}dataorig
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
 
 Check_New_Device_Data_Is_Visible_On_Setter
     [Documentation]    Get the device data and make sure it contains the created content.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_SETTER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_SETTER}
+    ...    ${original_data}
 
 Check_New_Device_Data_Is_Visible_On_Checker
     [Documentation]    Check that the created device data make their way into the checker node.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CHECKER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CHECKER}
+    ...    ${original_data}
 
 Check_New_Device_Data_Is_Visible_On_Configurer
     [Documentation]    Check that the created device data make their way into the configurer node.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CONFIGURER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CONFIGURER}
+    ...    ${original_data}
 
 Modify_Device_Data
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    4968
 
 Check_Device_Data_Is_Modified
@@ -144,7 +196,10 @@ Check_Modified_Device_Data_Is_Visible_On_Configurer
 Delete_Device_Data
     [Documentation]    Send a request to delete the sample test data on the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Delete_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Delete_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    4968
 
 Check_Device_Data_Is_Deleted
@@ -187,15 +242,28 @@ Check_Device_Deconfigured_On_Setter
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${NODE_SETTER}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils, setup everything needed for the test cases.
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords    create_session_for_templated_requests=False
-    RequestsLibrary.Create_Session    node1    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node2    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node3    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node1
+    ...    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node2
+    ...    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node3
+    ...    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
@@ -204,12 +272,15 @@ Teardown_Everything
 
 Check_Device_Instance_Count
     [Arguments]    ${expected}    ${session}
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
+    ${count}=    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
     Builtin.Should_Be_Equal_As_Strings    ${count}    ${expected}
 
 Check_Config_Data
     [Arguments]    ${node}    ${expected}    ${contains}=False
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${node}
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
index 50285e84d8b230383253bea082c3ae094131289a..6e8a72fed8ac2687fadca678b30f4cc8d3f9f4c6 100644 (file)
@@ -1,63 +1,71 @@
 *** Settings ***
-Documentation     Simplified netconf clustered CRUD test suite in Bug 8086 setup.
+Documentation       Simplified netconf clustered CRUD test suite in Bug 8086 setup.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector and see if they work.
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector and see if they work.
 ...
-...               The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
-...               device at the beginning and then deconfigures it at the end), "SETTER" (the
-...               node that manipulates the data on the device) and "CHECKER" (the node that
-...               checks the data on the device). The configured device and the results of each
-...               data operation on it is expected to be visible on all nodes so after each
-...               operation three test cases make sure they can see the result on their
-...               respective nodes.
+...                 The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
+...                 device at the beginning and then deconfigures it at the end), "SETTER" (the
+...                 node that manipulates the data on the device) and "CHECKER" (the node that
+...                 checks the data on the device). The configured device and the results of each
+...                 data operation on it is expected to be visible on all nodes so after each
+...                 operation three test cases make sure they can see the result on their
+...                 respective nodes.
 ...
-...               The 3 nodes are configured by placing "node1", "node2" or "node3" into the
-...               ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
-...               a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
-...               to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
-...               variable where the "X" is 1, 2 or 3.
+...                 The 3 nodes are configured by placing "node1", "node2" or "node3" into the
+...                 ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
+...                 a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
+...                 to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
+...                 variable where the "X" is 1, 2 or 3.
 ...
-...               The suite checks the integrity of the presence of the device and the data
-...               seen on the device only for nodes that have at least one of the roles
-...               ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
-...               a "checker list" of sorts and have only one checking test case that runs
-...               through the check list and performs the test on each node listed. However
-...               this currently has fairly low priority due to Beryllium delivery date so
-...               it was left out.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+...                 The suite checks the integrity of the presence of the device and the data
+...                 seen on the device only for nodes that have at least one of the roles
+...                 ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
+...                 a "checker list" of sorts and have only one checking test case that runs
+...                 through the check list and performs the test on each node listed. However
+...                 this currently has fairly low priority due to Beryllium delivery date so
+...                 it was left out.
+
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${NODE_CONFIGURER}    node1
-${NODE_SETTER}    node2
-${NODE_CHECKER}    node3
-${DEVICE_CHECK_TIMEOUT}    10s
-${DEVICE_NAME}    netconf-test-device
-${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
-${empty_data}     <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
-${original_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
-${modified_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
-${SCHEMA_DIRECTORY}    /tmp/schema
+${NODE_CONFIGURER}                      node1
+${NODE_SETTER}                          node2
+${NODE_CHECKER}                         node3
+${DEVICE_CHECK_TIMEOUT}                 10s
+${DEVICE_NAME}                          netconf-test-device
+${directory_with_template_folders}      ${CURDIR}/../../../variables/netconf/CRUD
+${empty_data}                           <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
+${original_data}
+...                                     <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
+${modified_data}
+...                                     <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+${SCHEMA_DIRECTORY}                     /tmp/schema
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -67,12 +75,21 @@ Check_Device_Is_Not_Mounted_At_Beginning
 Configure_Device_On_Netconf
     [Documentation]    Make request to configure a testtool device on Netconf connector
     [Tags]    critical
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=bug8086    session=${NODE_CONFIGURER}    schema_directory=${SCHEMA_DIRECTORY}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=bug8086
+    ...    session=${NODE_CONFIGURER}
+    ...    schema_directory=${SCHEMA_DIRECTORY}
 
 Check_Configurer_Has_Netconf_Connector_For_Device
     [Documentation]    Get the list of mounts and search for our device there. Fail if not found.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Device_Instance_Count    1    session=${NODE_CONFIGURER}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Device_Instance_Count
+    ...    1
+    ...    session=${NODE_CONFIGURER}
 
 Wait_For_Device_To_Become_Visible_For_Configurer
     [Documentation]    Wait until the device becomes visible on configurer node.
@@ -88,37 +105,73 @@ Wait_For_Device_To_Become_Visible_For_Setter
 
 Check_Device_Data_Is_Seen_As_Empty_On_Configurer
     [Documentation]    Get the device data as seen by configurer and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CONFIGURER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CONFIGURER}
+    ...    ${empty_data}
 
 Check_Device_Data_Is_Seen_As_Empty_On_Checker
     [Documentation]    Get the device data as seen by checker and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CHECKER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CHECKER}
+    ...    ${empty_data}
 
 Check_Device_Data_Is_Seen_As_Empty_On_Setter
     [Documentation]    Get the device data as seen by setter and make sure it is empty.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_SETTER}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_SETTER}
+    ...    ${empty_data}
 
 Create_Device_Data
     [Documentation]    Send some sample test data into the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}dataorig
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
 
 Check_New_Device_Data_Is_Visible_On_Setter
     [Documentation]    Get the device data and make sure it contains the created content.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_SETTER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_SETTER}
+    ...    ${original_data}
 
 Check_New_Device_Data_Is_Visible_On_Checker
     [Documentation]    Check that the created device data make their way into the checker node.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CHECKER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CHECKER}
+    ...    ${original_data}
 
 Check_New_Device_Data_Is_Visible_On_Configurer
     [Documentation]    Check that the created device data make their way into the configurer node.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${NODE_CONFIGURER}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${NODE_CONFIGURER}
+    ...    ${original_data}
 
 Modify_Device_Data
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
 
 Check_Device_Data_Is_Modified
     [Documentation]    Get the device data and make sure it contains the modified content.
@@ -135,7 +188,10 @@ Check_Modified_Device_Data_Is_Visible_On_Configurer
 Delete_Device_Data
     [Documentation]    Send a request to delete the sample test data on the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Delete_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${NODE_SETTER}
+    TemplatedRequests.Delete_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${NODE_SETTER}
 
 Check_Device_Data_Is_Deleted
     [Documentation]    Get the device data and make sure it is empty again.
@@ -174,17 +230,32 @@ Check_Device_Deconfigured_On_Setter
     [Tags]    critical
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${NODE_SETTER}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize resources, sreate sessions, on each ODL machine create a directory and copy the car model there.
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords    create_session_for_templated_requests=False
-    RequestsLibrary.Create_Session    node1    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node2    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node3    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    ${index_list} =    ClusterManagement.List_All_Indices
-    ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword    ${index_list}    Populate_Schema_Directory_Over_Active_Connection
+    RequestsLibrary.Create_Session
+    ...    node1
+    ...    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node2
+    ...    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node3
+    ...    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    ${index_list}=    ClusterManagement.List_All_Indices
+    ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword
+    ...    ${index_list}
+    ...    Populate_Schema_Directory_Over_Active_Connection
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
@@ -192,22 +263,29 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Check_Device_Instance_Count
-    [Arguments]    ${expected}    ${session}
     [Documentation]    Count device instances over ${session} and check the count is ${expected}.
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
+    [Arguments]    ${expected}    ${session}
+    ${count}=    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
     Builtin.Should_Be_Equal_As_Strings    ${count}    ${expected}
 
 Check_Config_Data
-    [Arguments]    ${node}    ${expected}    ${contains}=False
     [Documentation]    Get device data from ${node}. Match against ${expected}, strictness given by ${contains}.
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    [Arguments]    ${node}    ${expected}    ${contains}=False
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${node}
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
 
 Populate_Schema_Directory_Over_Active_Connection
     [Documentation]    Create ${SCHEMA_DIRECTORY}, unpack car.yang there from temporarily downloaded sources jar.
     ...    TODO: Make this configurable and move to NexusKeywords.
-    ${filename} =    NexusKeywords.Deploy_Artifact    component=carpeople    artifact=clustering-it-model    name_suffix=-sources.jar
-    ${dir} =    BuiltIn.Set_Variable    '${SCHEMA_DIRECTORY}'
-    SSHKeywords.Execute_Command_Should_Pass    mkdir -p '${SCHEMA_DIRECTORY}' && unzip -j '${filename}' META-INF/yang/car@2014-08-18.yang -d '${SCHEMA_DIRECTORY}/' && rm '${filename}'
+    ${filename}=    NexusKeywords.Deploy_Artifact
+    ...    component=carpeople
+    ...    artifact=clustering-it-model
+    ...    name_suffix=-sources.jar
+    ${dir}=    BuiltIn.Set_Variable    '${SCHEMA_DIRECTORY}'
+    SSHKeywords.Execute_Command_Should_Pass
+    ...    mkdir -p '${SCHEMA_DIRECTORY}' && unzip -j '${filename}' META-INF/yang/car@2014-08-18.yang -d '${SCHEMA_DIRECTORY}/' && rm '${filename}'
index db4265aeb54a88138e17c84a0e70c9074de5e226..9bd31b141f533551e03d1ec9a3cf7e9cc15d1768 100644 (file)
@@ -1,64 +1,70 @@
 *** Settings ***
-Documentation     Test suite for netconf device entity ownership handling during isolation.
+Documentation       Test suite for netconf device entity ownership handling during isolation.
 ...
-...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Performs basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector and verifies cluster recovery after
-...               network isolation and rejoin of the Entity_Owner node.
+...                 Performs basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector and verifies cluster recovery after
+...                 network isolation and rejoin of the Entity_Owner node.
 ...
-...               The suite recognizes 3 nodes,
-...               - "CONFIGURER" (the node that configures the device at the beginning and then
-...               deconfigures it at the end).
-...               - "SETTER" (the node that manipulates the data on the device)
-...               - "CHECKER" (the node that checks the data on the device). The configured
-...               device and the results of each data operation on it is expected to be visible
-...               on all nodes. After each operation three test cases verify they can see the
-...               result on their respective CONFIGURER,SETTER,CHECKER nodes.
+...                 The suite recognizes 3 nodes,
+...                 - "CONFIGURER" (the node that configures the device at the beginning and then
+...                 deconfigures it at the end).
+...                 - "SETTER" (the node that manipulates the data on the device)
+...                 - "CHECKER" (the node that checks the data on the device). The configured
+...                 device and the results of each data operation on it is expected to be visible
+...                 on all nodes. After each operation three test cases verify they can see the
+...                 result on their respective CONFIGURER,SETTER,CHECKER nodes.
 ...
-...               The 3 nodes are configured by placing "node1", "node2" or "node3" into the
-...               ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} variables. This makes
-...               a node "CONFIGURER", "SETTER" and "CHECKER" respectively.
-...               The "nodeX" name refers to the node with its IP address configured with the
-...               ${ODL_SYSTEM_X_IP} variable where the "X" is 1, 2 or 3.
+...                 The 3 nodes are configured by placing "node1", "node2" or "node3" into the
+...                 ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} variables. This makes
+...                 a node "CONFIGURER", "SETTER" and "CHECKER" respectively.
+...                 The "nodeX" name refers to the node with its IP address configured with the
+...                 ${ODL_SYSTEM_X_IP} variable where the "X" is 1, 2 or 3.
 ...
-...               The suite verifies the presence of the device and the integrity
-...               of device data for nodes that have at least one of the roles
-...               ("CONFIGURER", "SETTER" and "CHECKER") assigned.
+...                 The suite verifies the presence of the device and the integrity
+...                 of device data for nodes that have at least one of the roles
+...                 ("CONFIGURER", "SETTER" and "CHECKER") assigned.
 ...
-...               TODO: Multiple improvements are possible, but apply them to entity.robot at the same time please.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+...                 TODO: Multiple improvements are possible, but apply them to entity.robot at the same time please.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DEVICE_CHECK_TIMEOUT}    60s
-${DEVICE_BOOT_TIMEOUT}    100s
-${CLUSTER_RECOVERY_TIMEOUT}    300s
-${DEVICE_NAME}    netconf-test-device
+${DEVICE_CHECK_TIMEOUT}         60s
+${DEVICE_BOOT_TIMEOUT}          100s
+${CLUSTER_RECOVERY_TIMEOUT}     300s
+${DEVICE_NAME}                  netconf-test-device
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -68,7 +74,10 @@ Check_Device_Is_Not_Mounted_At_Beginning
 
 Configure_Device_On_Netconf
     [Documentation]    Use node 1 to configure a testtool device on Netconf connector.
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology    session=${node1_session}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=configure-via-topology
+    ...    session=${node1_session}
 
 Wait_For_Device_To_Become_Visible_For_All_Nodes
     [Documentation]    Wait for the whole cluster to see the device.
@@ -78,32 +87,69 @@ Wait_For_Device_To_Become_Visible_For_All_Nodes
 
 Check_Config_Data_Before_Data_Creation
     [Documentation]    Check if there really is no data present on none of the nodes
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${empty_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${empty_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${empty_data}
 
 Create_Device_Data
     [Documentation]    Create some data on the device and propagate it throughout the cluster.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}    session=${node2_session}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}dataorig
+    ...    ${template_as_string}
+    ...    session=${node2_session}
 
 Check_Config_Data_After_Data_Creation
     [Documentation]    Check if the data we just added into the cluster is really there
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${original_data}
 
 Find_And_Isolate_Device_Entity_Owner
     [Documentation]    Simulate a failure of the owner of the entity that represents the device.
-    ${owner}    ${followers}=    ClusterManagement.Get_Owner_And_Successors_For_device    ${DEVICE NAME}    netconf    1
+    ${owner}    ${followers}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    ${DEVICE NAME}
+    ...    netconf
+    ...    1
     Log    ${followers}
     Length Should Be    ${followers}    2    Wrong count of followers returned
     BuiltIn.Set_Suite_Variable    ${original_device_owner}    ${owner}
     BuiltIn.Set_Suite_Variable    ${follower1}    ${followers}[0]
     BuiltIn.Set_Suite_Variable    ${follower2}    ${followers}[1]
-    ${original_device_owner_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${original_device_owner}
-    ${follower1_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower1}
-    ${follower2_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower2}
+    ${original_device_owner_session}=    ClusterManagement.Resolve_Http_Session_For_Member
+    ...    member_index=${original_device_owner}
+    ${follower1_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower1}
+    ${follower2_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower2}
     BuiltIn.Set_Suite_Variable    ${original_device_owner_session}
     BuiltIn.Set_Suite_Variable    ${follower1_session}
     BuiltIn.Set_Suite_Variable    ${follower2_session}
@@ -117,18 +163,41 @@ Wait_For_New_Owner_To_Appear
 
 Check_Config_Data_Before_Modification_With_Original_Owner_Down
     [Documentation]    Check if data is present and retrievable from follower nodes
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower1_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower2_session}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower1_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower2_session}
+    ...    ${original_data}
 
 Modify_Device_Data_When_Original_Owner_Is_Down
     [Documentation]    Attempt to modify the data on the device after recovery and see if it still works.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${follower1_session}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${follower1_session}
 
 Check_Config_Data_After_Modification_With_Original_Owner_Down
     [Documentation]    Check if data is written correctly when original owner is shut down
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower1_session}    ${modified_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower2_session}    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower1_session}
+    ...    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower2_session}
+    ...    ${modified_data}
 
 Rejoin_Original_Entity_Owner
     [Documentation]    Restart the original entity owner and see if it can still see the device and the new data on it.
@@ -136,19 +205,42 @@ Rejoin_Original_Entity_Owner
 
 Check_Config_Data_After_Original_Owner_Restart
     [Documentation]    Sanity check if we still can retrieve our data from the original device owner.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${original_device_owner_session}    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${original_device_owner_session}
+    ...    ${modified_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    8999
 
 Modify_Device_Data_With_Original_Owner
     [Documentation]    Check that the original owner of the entity is still able to modify the data on the device
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod2    ${template_as_string}    session=${original_device_owner_session}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod2
+    ...    ${template_as_string}
+    ...    session=${original_device_owner_session}
 
 Check_Config_Data_After_Modification_With_Original_Owner_Up
     [Documentation]    Check if data has really been written as we expect. Fails if Modify_Device_Data_With_Original_Owner fails.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${modified_data_2}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${modified_data_2}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${modified_data_2}
 
 Deconfigure_Device_In_Netconf
     [Documentation]    Make request to deconfigure the device on Netconf connector and see if it works.
@@ -159,6 +251,7 @@ Deconfigure_Device_In_Netconf
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${node2_session}
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${node3_session}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -166,16 +259,17 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=2
     ClusterManagement.ClusterManagement_Setup
     NetconfKeywords.Setup_Netconf_Keywords    create_session_for_templated_requests=False
-    ${node1_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=1
-    ${node2_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=2
-    ${node3_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=3
+    ${node1_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=1
+    ${node2_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=2
+    ${node3_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=3
     BuiltIn.Set_Suite_Variable    ${node1_session}
     BuiltIn.Set_Suite_Variable    ${node2_session}
     BuiltIn.Set_Suite_Variable    ${node3_session}
     # Constants that are not meant to be overriden by the users
     BuiltIn.Set_Suite_Variable    ${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
     BuiltIn.Set_Suite_Variable    ${empty_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
-    ${cont}=    BuiltIn.Set_Variable    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>
+    ${cont}=    BuiltIn.Set_Variable
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>
     ${contend}=    BuiltIn.Set_Variable    </l></cont></data>
     BuiltIn.Set_Suite_Variable    ${original_data}    ${cont}Content${contend}
     BuiltIn.Set_Suite_Variable    ${modified_data}    ${cont}Modified Content${contend}
@@ -187,20 +281,26 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Check_Config_Data
-    [Arguments]    ${session}    ${expected}    ${contains}=False
     [Documentation]    Check that the data on the device matches the specified expectations.
     ...    TODO: Needs to be extracted into a suitable Resource as there is
     ...    the same code in at least two other suites (CRUD and clustered
     ...    CRUD).
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    [Arguments]    ${session}    ${expected}    ${contains}=False
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${session}
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
 
 Check_Owner_Reconfigured
     [Documentation]    Check whether the entity owner changed. Fail if not or no owner found.
     Log    Original Owner Index: ${original_device_owner}
     Log    Follower 1: node${follower1}
     Log    Follower 2: node${follower2}
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Candidates_For_Device    ${DEVICE_NAME}    netconf    ${follower1}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Candidates_For_Device
+    ...    ${DEVICE_NAME}
+    ...    netconf
+    ...    ${follower1}
     BuiltIn.Should_Not_Be_Equal_As_Integers    ${owner}    ${original_device_owner}
index 71fdb0b4a79d54670ea2bbbbf37811c5b8271eb0..772c2c0191f18543e90c5875303a2d0538b81514 100644 (file)
@@ -1,64 +1,70 @@
 *** Settings ***
-Documentation     Test suite for netconf device entity ownership handling during outages.
+Documentation       Test suite for netconf device entity ownership handling during outages.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform basic operations (Create, Read, Update and Delete or CRUD) on device
-...               data mounted onto a netconf connector and see if they work.
+...                 Perform basic operations (Create, Read, Update and Delete or CRUD) on device
+...                 data mounted onto a netconf connector and see if they work.
 ...
-...               The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
-...               device at the beginning and then deconfigures it at the end), "SETTER" (the
-...               node that manipulates the data on the device) and "CHECKER" (the node that
-...               checks the data on the device). The configured device and the results of each
-...               data operation on it is expected to be visible on all nodes so after each
-...               operation three test cases make sure they can see the result on their
-...               respective nodes.
+...                 The suite recognizes 3 nodes, "CONFIGURER" (the node that configures the
+...                 device at the beginning and then deconfigures it at the end), "SETTER" (the
+...                 node that manipulates the data on the device) and "CHECKER" (the node that
+...                 checks the data on the device). The configured device and the results of each
+...                 data operation on it is expected to be visible on all nodes so after each
+...                 operation three test cases make sure they can see the result on their
+...                 respective nodes.
 ...
-...               The 3 nodes are configured by placing "node1", "node2" or "node3" into the
-...               ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
-...               a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
-...               to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
-...               variable where the "X" is 1, 2 or 3.
+...                 The 3 nodes are configured by placing "node1", "node2" or "node3" into the
+...                 ${NODE_CONFIGURER}, ${NODE_SETTER} and ${NODE_CHECKER} to make the node
+...                 a "CONFIGURER", "SETTER" and "CHECKER" respectively. The "nodeX" name refers
+...                 to the node with its IP address configured with the ${ODL_SYSTEM_X_IP}
+...                 variable where the "X" is 1, 2 or 3.
 ...
-...               The suite checks the integrity of the presence of the device and the data
-...               seen on the device only for nodes that have at least one of the roles
-...               ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
-...               a "checker list" of sorts and have only one checking test case that runs
-...               through the check list and performs the test on each node listed. However
-...               this currently has fairly low priority due to Beryllium delivery date so
-...               it was left out.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 The suite checks the integrity of the presence of the device and the data
+...                 seen on the device only for nodes that have at least one of the roles
+...                 ("CONFIGURER", "SETTER" and "CHECKER") assigned. A better design would have
+...                 a "checker list" of sorts and have only one checking test case that runs
+...                 through the check list and performs the test on each node listed. However
+...                 this currently has fairly low priority due to Beryllium delivery date so
+...                 it was left out.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DEVICE_CHECK_TIMEOUT}    60s
-${DEVICE_BOOT_TIMEOUT}    100s
-${CLUSTER_RECOVERY_TIMEOUT}    120s
-${DEVICE_NAME}    netconf-test-device
+${DEVICE_CHECK_TIMEOUT}         60s
+${DEVICE_BOOT_TIMEOUT}          100s
+${CLUSTER_RECOVERY_TIMEOUT}     120s
+${DEVICE_NAME}                  netconf-test-device
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -68,7 +74,10 @@ Check_Device_Is_Not_Mounted_At_Beginning
 
 Configure_Device_On_Netconf
     [Documentation]    Use node 1 to configure a testtool device on Netconf connector.
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology    session=${node1_session}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=configure-via-topology
+    ...    session=${node1_session}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5089
 
 Wait_For_Device_To_Become_Visible_For_All_Nodes
@@ -79,32 +88,69 @@ Wait_For_Device_To_Become_Visible_For_All_Nodes
 
 Check_Config_Data_Before_Data_Creation
     [Documentation]    Check if there really is no data present on none of the nodes
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${empty_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${empty_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${empty_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${empty_data}
 
 Create_Device_Data
     [Documentation]    Create some data on the device and propagate it throughout the cluster.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}    session=${node2_session}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}dataorig
+    ...    ${template_as_string}
+    ...    session=${node2_session}
 
 Check_Config_Data_After_Data_Creation
     [Documentation]    Check if the data we just added into the cluster is really there
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${original_data}
 
 Find_And_Shutdown_Device_Entity_Owner
     [Documentation]    Simulate a failure of the owner of the entity that represents the device.
-    ${owner}    ${followers}=    ClusterManagement.Get_Owner_And_Successors_For_device    ${DEVICE NAME}    netconf    1
+    ${owner}    ${followers}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    ${DEVICE NAME}
+    ...    netconf
+    ...    1
     Log    ${followers}
     Length Should Be    ${followers}    2    Wrong count of followers returned
     BuiltIn.Set_Suite_Variable    ${original_device_owner}    ${owner}
     BuiltIn.Set_Suite_Variable    ${follower1}    ${followers}[0]
     BuiltIn.Set_Suite_Variable    ${follower2}    ${followers}[1]
-    ${original_device_owner_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${original_device_owner}
-    ${follower1_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower1}
-    ${follower2_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower2}
+    ${original_device_owner_session}=    ClusterManagement.Resolve_Http_Session_For_Member
+    ...    member_index=${original_device_owner}
+    ${follower1_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower1}
+    ${follower2_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${follower2}
     BuiltIn.Set_Suite_Variable    ${original_device_owner_session}
     BuiltIn.Set_Suite_Variable    ${follower1_session}
     BuiltIn.Set_Suite_Variable    ${follower2_session}
@@ -117,20 +163,43 @@ Wait_For_New_Owner_To_Appear
 
 Check_Config_Data_Before_Modification_With_Original_Owner_Down
     [Documentation]    Check if data is present and retrievable from follower nodes
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower1_session}    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower2_session}    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower1_session}
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower2_session}
+    ...    ${original_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    6067
 
 Modify_Device_Data_When_Original_Owner_Is_Down
     [Documentation]    Attempt to modify the data on the device after recovery and see if it still works.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}    session=${follower1_session}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    ${template_as_string}
+    ...    session=${follower1_session}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    4968
 
 Check_Config_Data_After_Modification_With_Original_Owner_Down
     [Documentation]    Check if data is written correctly when original owner is shut down
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower1_session}    ${modified_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${follower2_session}    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower1_session}
+    ...    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${follower2_session}
+    ...    ${modified_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    6067
 
 Restart_Original_Entity_Owner
@@ -139,20 +208,43 @@ Restart_Original_Entity_Owner
 
 Check_Config_Data_After_Original_Owner_Restart
     [Documentation]    Sanity check if we still can retrieve our data from the original device owner.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${original_device_owner_session}    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${original_device_owner_session}
+    ...    ${modified_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5761
 
 Modify_Device_Data_With_Original_Owner
     [Documentation]    Check that the original owner of the entity is still able to modify the data on the device
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod2    ${template_as_string}    session=${original_device_owner_session}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod2
+    ...    ${template_as_string}
+    ...    session=${original_device_owner_session}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5761
 
 Check_Config_Data_After_Modification_With_Original_Owner_Up
     [Documentation]    Check if data has really been written as we expect. Fails if Modify_Device_Data_With_Original_Owner fails.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node1_session}    ${modified_data_2}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node2_session}    ${modified_data_2}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    ${node3_session}    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node1_session}
+    ...    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node2_session}
+    ...    ${modified_data_2}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    ${node3_session}
+    ...    ${modified_data_2}
 
 Deconfigure_Device_In_Netconf
     [Documentation]    Make request to deconfigure the device on Netconf connector and see if it works.
@@ -163,6 +255,7 @@ Deconfigure_Device_In_Netconf
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${node2_session}
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${node3_session}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -170,16 +263,17 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=2
     ClusterManagement.ClusterManagement_Setup
     NetconfKeywords.Setup_Netconf_Keywords    create_session_for_templated_requests=False
-    ${node1_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=1
-    ${node2_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=2
-    ${node3_session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=3
+    ${node1_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=1
+    ${node2_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=2
+    ${node3_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=3
     BuiltIn.Set_Suite_Variable    ${node1_session}
     BuiltIn.Set_Suite_Variable    ${node2_session}
     BuiltIn.Set_Suite_Variable    ${node3_session}
     # Constants that are not meant to be overriden by the users
     BuiltIn.Set_Suite_Variable    ${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
     BuiltIn.Set_Suite_Variable    ${empty_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
-    ${cont}=    BuiltIn.Set_Variable    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>
+    ${cont}=    BuiltIn.Set_Variable
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>
     ${contend}=    BuiltIn.Set_Variable    </l></cont></data>
     BuiltIn.Set_Suite_Variable    ${original_data}    ${cont}Content${contend}
     BuiltIn.Set_Suite_Variable    ${modified_data}    ${cont}Modified Content${contend}
@@ -191,20 +285,26 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Check_Config_Data
-    [Arguments]    ${session}    ${expected}    ${contains}=False
     [Documentation]    Check that the data on the device matches the specified expectations.
     ...    TODO: Needs to be extracted into a suitable Resource as there is
     ...    the same code in at least two other suites (CRUD and clustered
     ...    CRUD).
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    [Arguments]    ${session}    ${expected}    ${contains}=False
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${session}
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
 
 Check_Owner_Reconfigured
     [Documentation]    Check whether the entity owner changed. Fail if not or no owner found.
     Log    Original Owner Index: ${original_device_owner}
     Log    Follower 1: node${follower1}
     Log    Follower 2: node${follower2}
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Candidates_For_Device    ${DEVICE_NAME}    netconf    ${follower1}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Candidates_For_Device
+    ...    ${DEVICE_NAME}
+    ...    netconf
+    ...    ${follower1}
     BuiltIn.Should_Not_Be_Equal_As_Integers    ${owner}    ${original_device_owner}
index 21315dbd8ef867ae52cbefa38c97382c805b517e..5353ee307e0d522a2c7562789bef7ccf2e2037bc 100644 (file)
@@ -1,53 +1,59 @@
 *** Settings ***
-Documentation     netconf cluster node outage test suite (CRUD operations).
+Documentation       netconf cluster node outage test suite (CRUD operations).
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform one of the basic operations (Create, Read, Update and Delete or CRUD)
-...               on device data mounted onto a netconf connector while one of the nodes is
-...               down and see if they work. Then bring the dead node up and check that it sees
-...               the operations that were made while it was down are visible on it as well.
+...                 Perform one of the basic operations (Create, Read, Update and Delete or CRUD)
+...                 on device data mounted onto a netconf connector while one of the nodes is
+...                 down and see if they work. Then bring the dead node up and check that it sees
+...                 the operations that were made while it was down are visible on it as well.
 ...
-...               The node is brought down before each of the "Create", "Update" and "Delete"
-...               operations and brought and back up after these operations. Before the dead
-...               node is brought up, a test case makes sure the operation is properly
-...               propagated within the cluster.
+...                 The node is brought down before each of the "Create", "Update" and "Delete"
+...                 operations and brought and back up after these operations. Before the dead
+...                 node is brought up, a test case makes sure the operation is properly
+...                 propagated within the cluster.
 ...
-...               Currently each of the 3 operations is done once. "Create" is done while
-...               node 1 is down, "Update" while node 2 is down and "Delete" while node 3
-...               is down.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 Currently each of the 3 operations is done once. "Create" is done while
+...                 node 1 is down, "Update" while node 2 is down and "Delete" while node 3
+...                 is down.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DEVICE_CHECK_TIMEOUT}    60s
-${DEVICE_BOOT_TIMEOUT}    100s
-${DEVICE_NAME}    netconf-test-device
-${MASTER_CONNECT_TIMEOUT}    15s
+${DEVICE_CHECK_TIMEOUT}         60s
+${DEVICE_BOOT_TIMEOUT}          100s
+${DEVICE_NAME}                  netconf-test-device
+${MASTER_CONNECT_TIMEOUT}       15s
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
@@ -57,7 +63,10 @@ Check_Device_Is_Not_Mounted_At_Beginning
 
 Configure_Device_On_Netconf
     [Documentation]    Use node 1 to configure a testtool device on Netconf connector
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology    session=node1
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=configure-via-topology
+    ...    session=node1
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5089
 
 Wait_For_Device_To_Become_Visible_For_All_Nodes
@@ -86,13 +95,29 @@ Create_Device_Data_With_node1_Down
     ...    TODO: Check exact status before retry. Carbon reports 404 instead of the correct 503.
     [Tags]    critical
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${MASTER_CONNECT_TIMEOUT}    1s    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}    session=node2
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${MASTER_CONNECT_TIMEOUT}
+    ...    1s
+    ...    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}dataorig
+    ...    ${template_as_string}
+    ...    session=node2
 
 Check_New_Device_Data_Is_Visible_On_Nodes_Without_node1
     [Documentation]    Check that the new device data is propagated in the cluster even when node 1 is down.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    node2    ${original_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    node3    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node2
+    ...    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node3
+    ...    ${original_data}
 
 Restart_node1_After_Create_And_Dump_Its_Topology_Data
     [Documentation]    Simulate node 1 restarted by admin just after device data is created and the change propagated in the cluster, fail if node 1 fails to boot.
@@ -102,7 +127,12 @@ Restart_node1_After_Create_And_Dump_Its_Topology_Data
 Check_New_Device_Data_Is_Visible_On_node1
     [Documentation]    Check that the created device data is propagated to node 1 as well.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_BOOT_TIMEOUT}    1s    Check_Config_Data    node1    ${original_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_BOOT_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node1
+    ...    ${original_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5761
 
 Kill_node2_Before_Modify
@@ -115,14 +145,30 @@ Modify_Device_Data_With_node2_Down
     ...    the action is retried few times.
     ...    TODO: Check exact status before retry. Carbon reports 404 instead of the correct 503.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${MASTER_CONNECT_TIMEOUT}    1s    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    {'DEVICE_NAME': '${DEVICE_NAME}'}    session=node3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${MASTER_CONNECT_TIMEOUT}
+    ...    1s
+    ...    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    {'DEVICE_NAME': '${DEVICE_NAME}'}
+    ...    session=node3
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5762
 
 Check_Modified_Device_Data_Is_Visible_On_Nodes_Without_node2
     [Documentation]    Check that the device data modification is propagated in the cluster even when node 2 is down.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    node1    ${modified_data}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Config_Data    node3    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node1
+    ...    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_CHECK_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node3
+    ...    ${modified_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5762
 
 Restart_node2_After_Modify_And_Dump_Its_Topology_Data
@@ -133,7 +179,12 @@ Restart_node2_After_Modify_And_Dump_Its_Topology_Data
 Check_Modified_Device_Data_Is_Visible_On_node2
     [Documentation]    Check that the device data modification is propagated to node 2 as well.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_BOOT_TIMEOUT}    1s    Check_Config_Data    node2    ${modified_data}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_BOOT_TIMEOUT}
+    ...    1s
+    ...    Check_Config_Data
+    ...    node2
+    ...    ${modified_data}
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5761
 
 Kill_node3_Before_Delete
@@ -146,7 +197,13 @@ Delete_Device_Data_With_node3_Down
     ...    the action is retried few times.
     ...    TODO: Check exact status before retry. Carbon reports 404 instead of the correct 503.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${MASTER_CONNECT_TIMEOUT}    1s    TemplatedRequests.Delete_Templated    ${directory_with_template_folders}${/}datamod1    {'DEVICE_NAME': '${DEVICE_NAME}'}    session=node1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${MASTER_CONNECT_TIMEOUT}
+    ...    1s
+    ...    TemplatedRequests.Delete_Templated
+    ...    ${directory_with_template_folders}${/}datamod1
+    ...    {'DEVICE_NAME': '${DEVICE_NAME}'}
+    ...    session=node1
     [Teardown]    Utils.Report_Failure_Due_To_Bug    5762
 
 Check_Device_Data_Removal_Is_Visible_On_Nodes_Without_node3
@@ -178,6 +235,7 @@ Check_Device_Deconfigured
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=node2
     NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=node3
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -186,31 +244,53 @@ Setup_Everything
     ClusterManagement.ClusterManagement_Setup
     NetconfKeywords.Setup_Netconf_Keywords    create_session_for_templated_requests=False
     # TODO: Refactor the suite to use ClusterManagement.Resolve_Http_Session_For_Member instead of these 3 "hardcoded" sessions.
-    RequestsLibrary.Create_Session    node1    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node2    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node3    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node1
+    ...    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node2
+    ...    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node3
+    ...    http://${ODL_SYSTEM_3_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
     BuiltIn.Set_Suite_Variable    ${directory_with_template_folders}    ${CURDIR}/../../../variables/netconf/CRUD
     BuiltIn.Set_Suite_Variable    ${empty_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
-    BuiltIn.Set_Suite_Variable    ${original_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
-    BuiltIn.Set_Suite_Variable    ${modified_data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
+    BuiltIn.Set_Suite_Variable
+    ...    ${original_data}
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Content</l></cont></data>
+    BuiltIn.Set_Suite_Variable
+    ...    ${modified_data}
+    ...    <data xmlns="${ODL_NETCONF_NAMESPACE}"><cont xmlns="urn:opendaylight:test:netconf:crud"><l>Modified Content</l></cont></data>
     ${url}=    Builtin.Set_Variable    /network-topology:network-topology/topology=topology-netconf
     BuiltIn.Set_Suite_Variable    ${config_topology_url}    ${REST_API}${url}
     BuiltIn.Set_Suite_Variable    ${operational_topology_url}    ${REST_API}${url}
 
 Get_Topology_Core
-    [Arguments]    ${session}
     [Documentation]    Get both versions of topology (config and operational), log them and return them for further processing.
+    [Arguments]    ${session}
     ${config_topology}=    TemplatedRequests.Get_As_Json_From_Uri    ${config_topology_url}    session=${session}
     BuiltIn.Log    ${config_topology}
-    ${operational_topology}=    TemplatedRequests.Get_As_Json_From_Uri    ${operational_topology_url}    session=${session}
+    ${operational_topology}=    TemplatedRequests.Get_As_Json_From_Uri
+    ...    ${operational_topology_url}
+    ...    session=${session}
     BuiltIn.Log    ${operational_topology}
-    [Return]    ${config_topology}    ${operational_topology}
+    RETURN    ${config_topology}    ${operational_topology}
 
 Get_Topology
-    [Arguments]    ${session}
     [Documentation]    Repeatedly try to get the topologies using Get_Topology_Core until either the request succeeds or boot timeout period expires.
-    ${result}=    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_BOOT_TIMEOUT}    1s    Get_Topology_Core    ${session}
-    [Return]    ${result}
+    [Arguments]    ${session}
+    ${result}=    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEVICE_BOOT_TIMEOUT}
+    ...    1s
+    ...    Get_Topology_Core
+    ...    ${session}
+    RETURN    ${result}
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
@@ -218,15 +298,18 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Check_Device_Instance_Count
-    [Arguments]    ${expected}    ${session}
     [Documentation]    Check that the specified session sees the specified count of instances of the test tool device.
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
+    [Arguments]    ${expected}    ${session}
+    ${count}=    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}    session=${session}
     Builtin.Should_Be_Equal_As_Strings    ${count}    ${expected}
 
 Check_Config_Data
-    [Arguments]    ${node}    ${expected}    ${contains}=False
     [Documentation]    Check that the specified session sees the specified data in the test tool device.
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    [Arguments]    ${node}    ${expected}    ${contains}=False
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${node}
-    BuiltIn.Run_Keyword_If    not ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
-    BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
+    IF    not ${contains}
+        BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    END
+    IF    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
index 38f67170bfc9bedb0ffb038e0c09352cfa3d84f0..c95644deefbf3fcfab6041ad56f7b126e512faac 100644 (file)
@@ -1,60 +1,71 @@
 *** Settings ***
-Documentation     netconf-restperfclient update performance test suite (clustered setup).
+Documentation       netconf-restperfclient update performance test suite (clustered setup).
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform given count of update operations on device data mounted onto a
-...               netconf connector (using the netconf-testtool-restperfclient tool) and
-...               see how much time it took. More exactly, it sends the data to a restconf
-...               mountpoint of the netconf connector belonging to the device, which turns
-...               out to turn the first request sent to a "create" request and the
-...               remaining requests to "update" requests (due to how the testtool device
-...               behavior is implemented).
+...                 Perform given count of update operations on device data mounted onto a
+...                 netconf connector (using the netconf-testtool-restperfclient tool) and
+...                 see how much time it took. More exactly, it sends the data to a restconf
+...                 mountpoint of the netconf connector belonging to the device, which turns
+...                 out to turn the first request sent to a "create" request and the
+...                 remaining requests to "update" requests (due to how the testtool device
+...                 behavior is implemented).
 ...
-...               The difference from the "single node" test suite (see
-...               ../scale/performance.robot) is that the device is configured and the data
-...               on it created using one node in the cluster and the update operations are
-...               issued on a different node. This forces the cluster nodes to communicate
-...               with each other about the data to be sent to the device.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Default Tags      1node    netconf    critical
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RestPerfClient.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 The difference from the "single node" test suite (see
+...                 ../scale/performance.robot) is that the device is configured and the data
+...                 on it created using one node in the cluster and the update operations are
+...                 issued on a different node. This forces the cluster nodes to communicate
+...                 with each other about the data to be sent to the device.
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RestPerfClient.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
+Default Tags        1node    netconf    critical
+
 
 *** Variables ***
-${DEVICE_NAME}    ${FIRST_TESTTOOL_PORT}-sim-device
-${REQUEST_COUNT}    16384
+${DEVICE_NAME}                      ${FIRST_TESTTOOL_PORT}-sim-device
+${REQUEST_COUNT}                    16384
 ${directory_with_crud_templates}    ${CURDIR}/../../../variables/netconf/CRUD
-${DEVICE_DATA_CONNECT_TIMEOUT}    60s
+${DEVICE_DATA_CONNECT_TIMEOUT}      60s
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
     # Start test tool
     SSHLibrary.Switch_Connection    ${testtool}
-    NetconfKeywords.Install_And_Start_Testtool    device-count=1    debug=false    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=1
+    ...    debug=false
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
 
 Configure_Device_On_Netconf
     [Documentation]    Configure the testtool device on Netconf connector, using node 1.
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology    session=node1
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${DEVICE_NAME}
+    ...    device_type=configure-via-topology
+    ...    session=node1
 
 Wait_For_Device_To_Become_Connected
     [Documentation]    Wait until the device becomes available through Netconf on node 1.
@@ -67,12 +78,16 @@ Wait_For_Device_Data_To_Be_Seen
 Create_Device_Data
     [Documentation]    Send some sample test data into the device through node 2 and check that the request went OK.
     ${template_as_string}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${device_name}
-    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_crud_templates}${/}cars    ${template_as_string}    session=node2
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${directory_with_crud_templates}${/}cars
+    ...    ${template_as_string}
+    ...    session=node2
 
 Run_Restperfclient
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the netconf connector of the device through node 3.
     ...    The duration of this test case is the main performance metric.
-    ${url}=    BuiltIn.Set_Variable    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${DEVICE_NAME}/yang-ext:mount/car:cars
+    ${url}=    BuiltIn.Set_Variable
+    ...    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${DEVICE_NAME}/yang-ext:mount/car:cars
     RestPerfClient.Invoke_Restperfclient    ${TESTTOOL_DEVICE_TIMEOUT}    ${url}    ip=${ODL_SYSTEM_3_IP}
 
 Check_For_Failed_Requests
@@ -95,6 +110,7 @@ Cleanup_And_Collect
     RestPerfClient.Collect_From_Restperfclient
     NetconfKeywords.Remove_Device_From_Netconf    ${DEVICE_NAME}    session=node1
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -109,11 +125,20 @@ Setup_Everything
     ${testtool}=    SSHKeywords.Open_Connection_To_Tools_System
     BuiltIn.Set_Suite_Variable    ${testtool}    ${testtool}
     # Create sessions
-    RequestsLibrary.Create_Session    node1    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    node2    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}    headers=${HEADERS_XML}    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node1
+    ...    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
+    RequestsLibrary.Create_Session
+    ...    node2
+    ...    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}
+    ...    headers=${HEADERS_XML}
+    ...    auth=${AUTH}
 
 Check_Data_Present
-    ${url}=    Builtin.Set_Variable    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
+    ${url}=    Builtin.Set_Variable
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf/node=${DEVICE_NAME}/yang-ext:mount?content=config
     ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=node2
     BuiltIn.Should_Be_Equal_As_Strings    ${data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
 
index 6506918d90219baa5db01069a9dea88da3b07b67..f60809d83f52f0605ad88abef4be414f3e1cd6b8 100644 (file)
@@ -1,63 +1,74 @@
 *** Settings ***
-Documentation     Suite for High Availability testing config topology shard leader under stress.
+Documentation       Suite for High Availability testing config topology shard leader under stress.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               This is close analogue of topology_owner_ha.robot, see Documentation there.
-...               The difference is that here the requests are sent towards entity-ownership shard leader,
-...               and the topology shard leader node is rebooted.
+...                 This is close analogue of topology_owner_ha.robot, see Documentation there.
+...                 The difference is that here the requests are sent towards entity-ownership shard leader,
+...                 and the topology shard leader node is rebooted.
 ...
-...               No real clustering Bugs are expected to be discovered by this suite,
-...               except maybe some Restconf ones.
-...               But as this suite was easy to create, it may as well be run.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     ${DEFAULT_TEARDOWN_KEYWORD}
-Default Tags      @{TAGS_CRITICAL}
-Library           OperatingSystem
-Library           SSHLibrary    timeout=10s
-Library           String    # for Get_Regexp_Matches
-Resource          ${CURDIR}/../../../libraries/ClusterAdmin.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 No real clustering Bugs are expected to be discovered by this suite,
+...                 except maybe some Restconf ones.
+...                 But as this suite was easy to create, it may as well be run.
+
+Library             OperatingSystem
+Library             SSHLibrary    timeout=10s
+Library             String    # for Get_Regexp_Matches
+Resource            ${CURDIR}/../../../libraries/ClusterAdmin.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RemoteBash.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       ${DEFAULT_TEARDOWN_KEYWORD}
+
+Default Tags        @{tags_critical}
+
 
 *** Variables ***
-${CONFIGURED_DEVICES_LIMIT}    20
-${CONNECTION_SLEEP}    1.2
-${DEFAULT_TEARDOWN_KEYWORD}    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-${DEVICE_BASE_NAME}    netconf-test-device
-${DEVICE_SET_SIZE}    30
-@{TAGS_CRITICAL}    critical    @{TAGS_NONCRITICAL}
-@{TAGS_NONCRITICAL}    clustering    netconf
+${CONFIGURED_DEVICES_LIMIT}     20
+${CONNECTION_SLEEP}             1.2
+${DEFAULT_TEARDOWN_KEYWORD}     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+${DEVICE_BASE_NAME}             netconf-test-device
+${DEVICE_SET_SIZE}              30
+@{TAGS_CRITICAL}                critical    @{TAGS_NONCRITICAL}
+@{TAGS_NONCRITICAL}             clustering    netconf
+
 
 *** Test Cases ***
 Locate_Managers
     [Documentation]    Detect location of topology(config) and entity-ownership(operational) leaders and store related data into suite variables.
     ...    This cannot be part of Suite Setup, as Utils.Get_Index_From_List_Of_Dictionaries calls BuiltIn.Set_Test_Variable.
     ...    WUKS are used, as location failures are probably due to booting process, not bugs.
-    ${topology_config_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology
+    ${topology_config_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=topology
     ...    shard_type=config
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_index}
-    ${topology_config_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member    ${topology_config_leader_index}
+    ${topology_config_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member
+    ...    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_ip}
     ${topology_config_leader_http_session} =    Resolve_Http_Session_For_Member    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_http_session}
-    ${entity_ownership_leader_index}    Change_Entity_Ownership_Leader_If_Needed    ${topology_config_leader_index}
+    ${entity_ownership_leader_index}    Change_Entity_Ownership_Leader_If_Needed    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_index}
-    ${entity_ownership_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member    ${entity_ownership_leader_index}
+    ${entity_ownership_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member
+    ...    ${entity_ownership_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_ip}
     ${entity_ownership_leader_http_session} =    Resolve_Http_Session_For_Member    ${entity_ownership_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_http_session}
@@ -65,7 +76,9 @@ Locate_Managers
 Start_Testtool
     [Documentation]    Deploy and start test tool on its separate SSH session.
     SSHLibrary.Switch_Connection    ${testtool_connection_index}
-    NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_SET_SIZE}    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=${DEVICE_SET_SIZE}
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
     # TODO: Introduce NetconfKeywords.Safe_Install_And_Start_Testtool to avoid teardown maniputation.
     [Teardown]    BuiltIn.Run_Keywords    SSHLibrary.Switch_Connection    ${configurer_connection_index}
     ...    AND    ${DEFAULT_TEARDOWN_KEYWORD}
@@ -75,11 +88,12 @@ Start_Configurer
     ${log_filename} =    Utils.Get_Log_File_Name    configurer
     BuiltIn.Set_Suite_Variable    \${log_filename}
     # TODO: Should things like restconf port/user/password be set from Variables?
-    ${command} =    BuiltIn.Set_Variable    python configurer.py --odladdress ${entity_ownership_leader_ip} --deviceaddress ${TOOLS_SYSTEM_IP} --devices ${DEVICE_SET_SIZE} --disconndelay ${CONFIGURED_DEVICES_LIMIT} --basename ${DEVICE_BASE_NAME} --connsleep ${CONNECTION_SLEEP} &> "${log_filename}"
+    ${command} =    BuiltIn.Set_Variable
+    ...    python configurer.py --odladdress ${entity_ownership_leader_ip} --deviceaddress ${TOOLS_SYSTEM_IP} --devices ${DEVICE_SET_SIZE} --disconndelay ${CONFIGURED_DEVICES_LIMIT} --basename ${DEVICE_BASE_NAME} --connsleep ${CONNECTION_SLEEP} &> "${log_filename}"
     SSHLibrary.Write    ${command}
     ${status}    ${text} =    BuiltIn.Run_Keyword_And_Ignore_Error    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${text}
-    BuiltIn.Run_Keyword_If    "${status}" != "FAIL"    BuiltIn.Fail    Prompt happened, see Log.
+    IF    "${status}" != "FAIL"    BuiltIn.Fail    Prompt happened, see Log.
     # Session is kept active.
 
 Wait_For_Config_Items
@@ -90,7 +104,7 @@ Wait_For_Config_Items
 Reboot_Topology_Leader
     [Documentation]    Kill and restart member where topology shard leader was, including removal of persisted data.
     ...    After cluster sync, sleep additional time to ensure manager processes requests with the rebooted member fully rejoined.
-    [Tags]    @{TAGS_NONCRITICAL}    # To avoid long WUKS list expanded in log.html
+    [Tags]    @{tags_noncritical}    # To avoid long WUKS list expanded in log.html
     ClusterManagement.Kill_Single_Member    ${topology_config_leader_index}
     ${owner_list} =    BuiltIn.Create_List    ${topology_config_leader_index}
     ClusterManagement.Start_Single_Member    ${topology_config_leader_index}
@@ -117,6 +131,7 @@ Check_For_Connector_Leak
     # FIXME: Are separate keywords necessary?
     Check_Operational_Items_Upper_Bound
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize libraries and set suite variables..
@@ -139,45 +154,74 @@ Teardown_Everything
     RequestsLibrary.Delete_All_Sessions
 
 Count_Substring_Occurence
-    [Arguments]    ${substring}    ${main_string}
     [Documentation]    Apply the length_of_split method for counting how many times ${substring} occures within ${main_string}.
     ...    The method is reliable only if triple-double quotes are not present in either argument.
+    [Arguments]    ${substring}    ${main_string}
     BuiltIn.Comment    TODO: Migrate this keyword into an appropriate Resource.
     BuiltIn.Run_Keyword_And_Return    Builtin.Evaluate    len("""${main_string}""".split("""${substring}""")) - 1
 
 Get_Config_Device_Count
     [Documentation]    Count number of items in config netconf topology matching ${DEVICE_BASE_NAME}
-    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri    ${REST_API}/network-topology:network-topology/topology=topology-netconf    session=${entity_ownership_leader_http_session}
-    BuiltIn.Run_Keyword_And_Return    Count_Substring_Occurence    substring=${DEVICE_BASE_NAME}    main_string=${item_data}
+    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf
+    ...    session=${entity_ownership_leader_http_session}
+    BuiltIn.Run_Keyword_And_Return
+    ...    Count_Substring_Occurence
+    ...    substring=${DEVICE_BASE_NAME}
+    ...    main_string=${item_data}
 
 Get_Operational_Device_Count
     [Documentation]    Count number of items in operational netconf topology matching ${DEVICE_BASE_NAME}
-    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri    ${REST_API}/network-topology:network-topology/topology=topology-netconf?content=nonconfig    session=${entity_ownership_leader_http_session}
-    BuiltIn.Run_Keyword_And_Return    Count_Substring_Occurence    substring=${DEVICE_BASE_NAME}    main_string=${item_data}
+    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf?content=nonconfig
+    ...    session=${entity_ownership_leader_http_session}
+    BuiltIn.Run_Keyword_And_Return
+    ...    Count_Substring_Occurence
+    ...    substring=${DEVICE_BASE_NAME}
+    ...    main_string=${item_data}
 
 Check_Config_Items_Lower_Bound
     [Documentation]    Count items matching ${DEVICE_BASE_NAME}, fail if less than ${CONFIGURED_DEVICES_LIMIT}
     ${device_count} =    Get_Config_Device_Count
-    BuiltIn.Run_Keyword_If    ${device_count} < ${CONFIGURED_DEVICES_LIMIT}    BuiltIn.Fail    Found ${device_count} config items, should be at least ${CONFIGURED_DEVICES_LIMIT}
+    IF    ${device_count} < ${CONFIGURED_DEVICES_LIMIT}
+        BuiltIn.Fail    Found ${device_count} config items, should be at least ${CONFIGURED_DEVICES_LIMIT}
+    END
 
 Check_Operational_Items_Upper_Bound
     [Documentation]    Count items matching ${DEVICE_BASE_NAME}, fail if more than 1 + ${CONFIGURED_DEVICES_LIMIT}
     ${device_count} =    Get_Operational_Device_Count
-    BuiltIn.Run_Keyword_If    ${device_count} > 1 + ${CONFIGURED_DEVICES_LIMIT}    BuiltIn.Fail    Found ${device_count} config items, should be at most 1 + ${CONFIGURED_DEVICES_LIMIT}
+    IF    ${device_count} > 1 + ${CONFIGURED_DEVICES_LIMIT}
+        BuiltIn.Fail    Found ${device_count} config items, should be at most 1 + ${CONFIGURED_DEVICES_LIMIT}
+    END
 
 Get_Typical_Time
-    [Arguments]    ${coefficient}=1.0
     [Documentation]    Return number of seconds typical for given scale variables.
-    BuiltIn.Run_Keyword_And_Return    BuiltIn.Evaluate    ${coefficient} * ${CONNECTION_SLEEP} * ${CONFIGURED_DEVICES_LIMIT}
+    [Arguments]    ${coefficient}=1.0
+    BuiltIn.Run_Keyword_And_Return
+    ...    BuiltIn.Evaluate
+    ...    ${coefficient} * ${CONNECTION_SLEEP} * ${CONFIGURED_DEVICES_LIMIT}
 
 Change_Entity_Ownership_Leader_If_Needed
-    [Arguments]    ${topology_config_leader_idx}
     [Documentation]    Move entity-ownership (operational) shard leader if it is on the same node as topology (config) shard leader.
-    ${entity_ownership_leader_index_old}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=entity-ownership
+    [Arguments]    ${topology_config_leader_idx}
+    ${entity_ownership_leader_index_old}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=entity-ownership
     ...    shard_type=operational
-    BuiltIn.Return_From_Keyword_If    ${topology_config_leader_idx} != ${entity_ownership_leader_index_old}    ${entity_ownership_leader_index_old}
-    ${idx}=    Collections.Get_From_List    ${candidates}    0
+    IF    ${topology_config_leader_idx} != ${entity_ownership_leader_index_old}
+        RETURN    ${entity_ownership_leader_index_old}
+    END
+    ${idx} =    Collections.Get_From_List    ${candidates}    0
     ClusterAdmin.Make_Leader_Local    ${idx}    entity-ownership    operational
-    ${entity_ownership_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Verify_Shard_Leader_Elected    entity-ownership
-    ...    operational    ${True}    ${entity_ownership_leader_index_old}    verify_restconf=False
-    BuiltIn.Return_From_Keyword    ${entity_ownership_leader_index}
+    ${entity_ownership_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    60s
+    ...    3s
+    ...    ClusterManagement.Verify_Shard_Leader_Elected
+    ...    entity-ownership
+    ...    operational
+    ...    ${True}
+    ...    ${entity_ownership_leader_index_old}
+    ...    verify_restconf=False
+    RETURN    ${entity_ownership_leader_index}
index e9ecd425ab53418d7584b5c52b29d2b759d453f1..77c4e8bc83d7f0a67d7ca7065dd115eeb77b9bdc 100644 (file)
@@ -1,87 +1,98 @@
 *** Settings ***
-Documentation     Suite for High Availability testing netconf topology owner under stress.
+Documentation       Suite for High Availability testing netconf topology owner under stress.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Suite topology_leader_ha.robot is derived from this suite.
-...               Please, keep the logic in the suites as similar as possible.
+...                 Suite topology_leader_ha.robot is derived from this suite.
+...                 Please, keep the logic in the suites as similar as possible.
 ...
-...               This suite uses a Python utility to continuously configure/deconfigure
-...               device connections against devices simulated by testtool.
-...               The utility sends requests to the member which is leader for topology config shard.
+...                 This suite uses a Python utility to continuously configure/deconfigure
+...                 device connections against devices simulated by testtool.
+...                 The utility sends requests to the member which is leader for topology config shard.
 ...
-...               To avoid excessive resource consumption, the utility deconfigures old devices.
-...               In a stationary state, number of config items oscillates between
-...               ${CONFIGURED_DEVICES_LIMIT} and 1 + ${CONFIGURED_DEVICES_LIMIT}.
+...                 To avoid excessive resource consumption, the utility deconfigures old devices.
+...                 In a stationary state, number of config items oscillates between
+...                 ${CONFIGURED_DEVICES_LIMIT} and 1 + ${CONFIGURED_DEVICES_LIMIT}.
 ...
-...               The only tested HA event so far is reboot of the member
-...               which is the leader of entity-ownership operational shard.
-...               This suite assumes the entity-ownership operational shard leader and
-...               topology config shard leader are not co-located.
+...                 The only tested HA event so far is reboot of the member
+...                 which is the leader of entity-ownership operational shard.
+...                 This suite assumes the entity-ownership operational shard leader and
+...                 topology config shard leader are not co-located.
 ...
-...               Number of devices is configurable, wait times are computed from that,
-...               as it takes some time to initialize connections.
-...               Ideally, the utility should go through half of devices during entity-ownership leader downtime.
+...                 Number of devices is configurable, wait times are computed from that,
+...                 as it takes some time to initialize connections.
+...                 Ideally, the utility should go through half of devices during entity-ownership leader downtime.
 ...
-...               If there is a period when netconf manager ignores deletions in config datastore,
-...               the devices created previously could "leak", meaning the number of
-...               netconf topology items could be higher than 1 + ${CONFIGURED_DEVICES_LIMIT}.
+...                 If there is a period when netconf manager ignores deletions in config datastore,
+...                 the devices created previously could "leak", meaning the number of
+...                 netconf topology items could be higher than 1 + ${CONFIGURED_DEVICES_LIMIT}.
 ...
-...               One check for correctness is the final number of devices in operational netconf topology.
-...               Another check is performed on utility output.
+...                 One check for correctness is the final number of devices in operational netconf topology.
+...                 Another check is performed on utility output.
 ...
-...               Performance can be estimated by the total number of requests processed,
-...               but this suite does not perform such a computation.
+...                 Performance can be estimated by the total number of requests processed,
+...                 but this suite does not perform such a computation.
 ...
-...               TODO: After stopping utility, wait to see mount has succeeded on the devices.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     ${DEFAULT_TEARDOWN_KEYWORD}
-Default Tags      @{TAGS_CRITICAL}
-Library           OperatingSystem
-Library           SSHLibrary    timeout=10s
-Library           String    # for Get_Regexp_Matches
-Resource          ${CURDIR}/../../../libraries/ClusterAdmin.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 TODO: After stopping utility, wait to see mount has succeeded on the devices.
+
+Library             OperatingSystem
+Library             SSHLibrary    timeout=10s
+Library             String    # for Get_Regexp_Matches
+Resource            ${CURDIR}/../../../libraries/ClusterAdmin.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RemoteBash.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       ${DEFAULT_TEARDOWN_KEYWORD}
+
+Default Tags        @{tags_critical}
+
 
 *** Variables ***
-${CONFIGURED_DEVICES_LIMIT}    20
-${CONNECTION_SLEEP}    1.2
-${DEFAULT_TEARDOWN_KEYWORD}    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-${DEVICE_BASE_NAME}    netconf-test-device
-${DEVICE_SET_SIZE}    30
-@{TAGS_CRITICAL}    critical    @{TAGS_NONCRITICAL}
-@{TAGS_NONCRITICAL}    clustering    netconf
+${CONFIGURED_DEVICES_LIMIT}     20
+${CONNECTION_SLEEP}             1.2
+${DEFAULT_TEARDOWN_KEYWORD}     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+${DEVICE_BASE_NAME}             netconf-test-device
+${DEVICE_SET_SIZE}              30
+@{TAGS_CRITICAL}                critical    @{TAGS_NONCRITICAL}
+@{TAGS_NONCRITICAL}             clustering    netconf
+
 
 *** Test Cases ***
 Setup_Leaders_Location
     [Documentation]    Detect location of topology(config) and entity-ownership(operational) leaders and store related data into suite variables.
     ...    This cannot be part of Suite Setup, as Utils.Get_Index_From_List_Of_Dictionaries calls BuiltIn.Set_Test_Variable.
     ...    WUKS are used, as location failures are probably due to booting process, not bugs.
-    ${topology_config_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology
+    ${topology_config_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=topology
     ...    shard_type=config
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_index}
-    ${topology_config_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member    ${topology_config_leader_index}
+    ${topology_config_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member
+    ...    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_ip}
     ${topology_config_leader_http_session} =    Resolve_Http_Session_For_Member    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${topology_config_leader_http_session}
-    ${entity_ownership_leader_index}    Change_Entity_Ownership_Leader_If_Needed    ${topology_config_leader_index}
+    ${entity_ownership_leader_index}    Change_Entity_Ownership_Leader_If_Needed    ${topology_config_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_index}
-    ${entity_ownership_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member    ${entity_ownership_leader_index}
+    ${entity_ownership_leader_ip} =    ClusterManagement.Resolve_Ip_Address_For_Member
+    ...    ${entity_ownership_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_ip}
     ${entity_ownership_leader_http_session} =    Resolve_Http_Session_For_Member    ${entity_ownership_leader_index}
     BuiltIn.Set_Suite_Variable    \${entity_ownership_leader_http_session}
@@ -89,7 +100,9 @@ Setup_Leaders_Location
 Start_Testtool
     [Documentation]    Deploy and start test tool on its separate SSH session.
     SSHLibrary.Switch_Connection    ${testtool_connection_index}
-    NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_SET_SIZE}    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+    NetconfKeywords.Install_And_Start_Testtool
+    ...    device-count=${DEVICE_SET_SIZE}
+    ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
     # TODO: Introduce NetconfKeywords.Safe_Install_And_Start_Testtool to avoid teardown maniputation.
     [Teardown]    BuiltIn.Run_Keywords    SSHLibrary.Switch_Connection    ${configurer_connection_index}
     ...    AND    ${DEFAULT_TEARDOWN_KEYWORD}
@@ -99,11 +112,12 @@ Start_Configurer
     ${log_filename} =    Utils.Get_Log_File_Name    configurer
     BuiltIn.Set_Suite_Variable    \${log_filename}
     # TODO: Should things like restconf port/user/password be set from Variables?
-    ${command} =    BuiltIn.Set_Variable    python configurer.py --odladdress ${topology_config_leader_ip} --deviceaddress ${TOOLS_SYSTEM_IP} --devices ${DEVICE_SET_SIZE} --disconndelay ${CONFIGURED_DEVICES_LIMIT} --basename ${DEVICE_BASE_NAME} --connsleep ${CONNECTION_SLEEP} &> "${log_filename}"
+    ${command} =    BuiltIn.Set_Variable
+    ...    python configurer.py --odladdress ${topology_config_leader_ip} --deviceaddress ${TOOLS_SYSTEM_IP} --devices ${DEVICE_SET_SIZE} --disconndelay ${CONFIGURED_DEVICES_LIMIT} --basename ${DEVICE_BASE_NAME} --connsleep ${CONNECTION_SLEEP} &> "${log_filename}"
     SSHLibrary.Write    ${command}
     ${status}    ${text} =    BuiltIn.Run_Keyword_And_Ignore_Error    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${text}
-    BuiltIn.Run_Keyword_If    "${status}" != "FAIL"    BuiltIn.Fail    Prompt happened, see Log.
+    IF    "${status}" != "FAIL"    BuiltIn.Fail    Prompt happened, see Log.
     # Session is kept active.
 
 Wait_For_Config_Items
@@ -114,7 +128,7 @@ Wait_For_Config_Items
 Reboot_Entity_Ownership_Leader
     [Documentation]    Kill and restart member where entity-ownership shard leader was, including removal of persisted data.
     ...    After cluster sync, sleep additional time to ensure entity-ownership shard processes requests with the rebooted member fully rejoined.
-    [Tags]    @{TAGS_NONCRITICAL}    # To avoid long WUKS list expanded in log.html
+    [Tags]    @{tags_noncritical}    # To avoid long WUKS list expanded in log.html
     ClusterManagement.Kill_Single_Member    ${entity_ownership_leader_index}
     ${owner_list} =    BuiltIn.Create_List    ${entity_ownership_leader_index}
     ClusterManagement.Start_Single_Member    ${entity_ownership_leader_index}
@@ -141,6 +155,7 @@ Check_For_Connector_Leak
     # FIXME: Are separate keywords necessary?
     Check_Operational_Items_Upper_Bound
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize libraries and set suite variables..
@@ -163,46 +178,75 @@ Teardown_Everything
     RequestsLibrary.Delete_All_Sessions
 
 Count_Substring_Occurence
-    [Arguments]    ${substring}    ${main_string}
     [Documentation]    Apply the length_of_split method for counting how many times ${substring} occures within ${main_string}.
     ...    The method is reliable only if triple-double quotes are not present in either argument.
+    [Arguments]    ${substring}    ${main_string}
     BuiltIn.Comment    TODO: Migrate this keyword into an appropriate Resource.
     BuiltIn.Run_Keyword_And_Return    Builtin.Evaluate    len("""${main_string}""".split("""${substring}""")) - 1
 
 Get_Config_Device_Count
     [Documentation]    Count number of items in config netconf topology matching ${DEVICE_BASE_NAME}
-    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri    ${REST_API}/network-topology:network-topology/topology=topology-netconf    session=${topology_config_leader_http_session}
-    BuiltIn.Run_Keyword_And_Return    Count_Substring_Occurence    substring=${DEVICE_BASE_NAME}    main_string=${item_data}
+    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf
+    ...    session=${topology_config_leader_http_session}
+    BuiltIn.Run_Keyword_And_Return
+    ...    Count_Substring_Occurence
+    ...    substring=${DEVICE_BASE_NAME}
+    ...    main_string=${item_data}
 
 Get_Operational_Device_Count
     [Documentation]    Count number of items in operational netconf topology matching ${DEVICE_BASE_NAME}
-    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri    ${REST_API}/network-topology:network-topology/topology=topology-netconf?content=nonconfig    session=${topology_config_leader_http_session}
-    BuiltIn.Run_Keyword_And_Return    Count_Substring_Occurence    substring=${DEVICE_BASE_NAME}    main_string=${item_data}
+    ${item_data} =    TemplatedRequests.Get_As_Json_From_Uri
+    ...    ${REST_API}/network-topology:network-topology/topology=topology-netconf?content=nonconfig
+    ...    session=${topology_config_leader_http_session}
+    BuiltIn.Run_Keyword_And_Return
+    ...    Count_Substring_Occurence
+    ...    substring=${DEVICE_BASE_NAME}
+    ...    main_string=${item_data}
 
 Check_Config_Items_Lower_Bound
     [Documentation]    Count items matching ${DEVICE_BASE_NAME}, fail if less than ${CONFIGURED_DEVICES_LIMIT}
     ${device_count} =    Get_Config_Device_Count
-    BuiltIn.Run_Keyword_If    ${device_count} < ${CONFIGURED_DEVICES_LIMIT}    BuiltIn.Fail    Found ${device_count} config items, should be at least ${CONFIGURED_DEVICES_LIMIT}
+    IF    ${device_count} < ${CONFIGURED_DEVICES_LIMIT}
+        BuiltIn.Fail    Found ${device_count} config items, should be at least ${CONFIGURED_DEVICES_LIMIT}
+    END
 
 Check_Operational_Items_Upper_Bound
     [Documentation]    Count items matching ${DEVICE_BASE_NAME}, fail if more than 1 + ${CONFIGURED_DEVICES_LIMIT}
     ${device_count} =    Get_Operational_Device_Count
-    BuiltIn.Run_Keyword_If    ${device_count} > 1 + ${CONFIGURED_DEVICES_LIMIT}    BuiltIn.Fail    Found ${device_count} config items, should be at most 1 + ${CONFIGURED_DEVICES_LIMIT}
+    IF    ${device_count} > 1 + ${CONFIGURED_DEVICES_LIMIT}
+        BuiltIn.Fail    Found ${device_count} config items, should be at most 1 + ${CONFIGURED_DEVICES_LIMIT}
+    END
 
 Get_Typical_Time
-    [Arguments]    ${coefficient}=1.0
     [Documentation]    Return number of seconds typical for given scale variables.
-    BuiltIn.Run_Keyword_And_Return    BuiltIn.Evaluate    ${coefficient} * ${CONNECTION_SLEEP} * ${CONFIGURED_DEVICES_LIMIT}
+    [Arguments]    ${coefficient}=1.0
+    BuiltIn.Run_Keyword_And_Return
+    ...    BuiltIn.Evaluate
+    ...    ${coefficient} * ${CONNECTION_SLEEP} * ${CONFIGURED_DEVICES_LIMIT}
 
 Change_Entity_Ownership_Leader_If_Needed
-    [Arguments]    ${topology_config_leader_idx}
     [Documentation]    Move entity-ownership (operational) shard leader if it is on the same node as topology (config) shard leader.
     ...    TODO: move keyword to a common resource, e.g. ShardStability
-    ${entity_ownership_leader_index_old}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=entity-ownership
+    [Arguments]    ${topology_config_leader_idx}
+    ${entity_ownership_leader_index_old}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=entity-ownership
     ...    shard_type=operational
-    BuiltIn.Return_From_Keyword_If    ${topology_config_leader_idx} != ${entity_ownership_leader_index_old}    ${entity_ownership_leader_index_old}
-    ${idx}=    Collections.Get_From_List    ${candidates}    0
+    IF    ${topology_config_leader_idx} != ${entity_ownership_leader_index_old}
+        RETURN    ${entity_ownership_leader_index_old}
+    END
+    ${idx} =    Collections.Get_From_List    ${candidates}    0
     ClusterAdmin.Make_Leader_Local    ${idx}    entity-ownership    operational
-    ${entity_ownership_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Verify_Shard_Leader_Elected    entity-ownership
-    ...    operational    ${True}    ${entity_ownership_leader_index_old}    verify_restconf=False
-    BuiltIn.Return_From_Keyword    ${entity_ownership_leader_index}
+    ${entity_ownership_leader_index}    ${candidates} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    60s
+    ...    3s
+    ...    ClusterManagement.Verify_Shard_Leader_Elected
+    ...    entity-ownership
+    ...    operational
+    ...    ${True}
+    ...    ${entity_ownership_leader_index_old}
+    ...    verify_restconf=False
+    RETURN    ${entity_ownership_leader_index}
index eb823a5ed9f82a0e4a5873382e1c5e22d1e1241b..ed9c289209dda00995211b0736597b8ae7ef04e0 100644 (file)
@@ -1,61 +1,65 @@
 *** Settings ***
-Documentation     Basic tests for BGP application peer.
+Documentation       Basic tests for BGP application peer.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
-...               Test suite performs basic subscribtion case for data store notifications.
-...               For procedure description see the
-...               https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription
+...                 Test suite performs basic subscribtion case for data store notifications.
+...                 For procedure description see the
+...                 https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription
 ...
 ...
-...               This suite uses inventory (config part) as an area to make dummy writes into,
-...               just to trigger data change listener to produce a notification.
-...               Openflowplugin may have some data there, and before Boron, netconf-connector
-...               was also exposing some data in inventory.
+...                 This suite uses inventory (config part) as an area to make dummy writes into,
+...                 just to trigger data change listener to produce a notification.
+...                 Openflowplugin may have some data there, and before Boron, netconf-connector
+...                 was also exposing some data in inventory.
 ...
-...               To avoid unexpected responses, this suite depetes all data from config inventory,
-...               so this suite should not be followed by any suite expecting default data there.
+...                 To avoid unexpected responses, this suite depetes all data from config inventory,
+...                 so this suite should not be followed by any suite expecting default data there.
 ...
-...               Covered bugs:
-...               Bug 3934 - Websockets: Scope ONE doesn't work correctly
+...                 Covered bugs:
+...                 Bug 3934 - Websockets: Scope ONE doesn't work correctly
 ...
-...               TODO: Use cars/people model for data
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           SSHLibrary    timeout=10s
-Library           XML
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/Restconf.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
-Resource          ${CURDIR}/../../../variables/Variables.robot
+...                 TODO: Use cars/people model for data
+
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             SSHLibrary    timeout=10s
+Library             XML
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/Restconf.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/WaitForFailure.robot
+Resource            ${CURDIR}/../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${TEMPLATE_FOLDER}    ${CURDIR}/templates
-${DRAFT_STREAMS_URI}    restconf/streams
-${RFC8040_STREAMS_URI}    rests/data/ietf-restconf-monitoring:restconf-state/streams
-${NODES_STREAM_PATH}    network-topology:network-topology/datastore=CONFIGURATION/scope=BASE
-${DRAFT_DCN_STREAM_URI}    ${DRAFT_STREAMS_URI}/stream/data-change-event-subscription/${NODES_STREAM_PATH}
-${RFC8040_DCN_STREAM_URI}    ${RFC8040_STREAMS_URI}/stream/data-change-event-subscription/${NODES_STREAM_PATH}
-${RESTCONF_SUBSCRIBE_DATA}    subscribe.xml
-${RESTCONF_CONFIG_DATA}    config_data.xml
-${RECEIVER_LOG_FILE}    receiver.log
-${RECEIVER_OPTIONS}    ${EMPTY}
-${CONTROLLER_LOG_LEVEL}    INFO
+${TEMPLATE_FOLDER}              ${CURDIR}/templates
+${DRAFT_STREAMS_URI}            restconf/streams
+${RFC8040_STREAMS_URI}          rests/data/ietf-restconf-monitoring:restconf-state/streams
+${NODES_STREAM_PATH}            network-topology:network-topology/datastore=CONFIGURATION/scope=BASE
+${DRAFT_DCN_STREAM_URI}         ${DRAFT_STREAMS_URI}/stream/data-change-event-subscription/${NODES_STREAM_PATH}
+${RFC8040_DCN_STREAM_URI}       ${RFC8040_STREAMS_URI}/stream/data-change-event-subscription/${NODES_STREAM_PATH}
+${RESTCONF_SUBSCRIBE_DATA}      subscribe.xml
+${RESTCONF_CONFIG_DATA}         config_data.xml
+${RECEIVER_LOG_FILE}            receiver.log
+${RECEIVER_OPTIONS}             ${EMPTY}
+${CONTROLLER_LOG_LEVEL}         INFO
+
 
 *** Test Cases ***
 Create_DCN_Stream
@@ -64,7 +68,11 @@ Create_DCN_Stream
     Comment    Create DCN subscription
     ${body} =    OperatingSystem.Get_File    ${TEMPLATE_FOLDER}/${RESTCONF_SUBSCRIBE_DATA}
     ${uri} =    Restconf.Generate URI    sal-remote:create-data-change-event-subscription    rpc
-    ${resp} =    RequestsLibrary.Post_Request    restconf    ${uri}    headers=${SEND_ACCEPT_XML_HEADERS}    data=${body}
+    ${resp} =    RequestsLibrary.Post_Request
+    ...    restconf
+    ...    ${uri}
+    ...    headers=${SEND_ACCEPT_XML_HEADERS}
+    ...    data=${body}
     Log_Response    ${resp}
     BuiltIn.Should_Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
@@ -84,17 +92,26 @@ Subscribe_To_DCN_Stream
 List_DCN_Streams
     [Documentation]    List DCN streams.
     [Tags]    critical
-    ${uri} =    BuiltIn.Set_Variable_If    "${USE_RFC8040}" == "False"    ${DRAFT_STREAMS_URI}    ${RFC8040_STREAMS_URI}
+    ${uri} =    BuiltIn.Set_Variable_If
+    ...    "${USE_RFC8040}" == "False"
+    ...    ${DRAFT_STREAMS_URI}
+    ...    ${RFC8040_STREAMS_URI}
     ${resp} =    RequestsLibrary.Get_Request    restconf    ${uri}    headers=${SEND_ACCEPT_XML_HEADERS}
     Log_Response    ${resp}
     BuiltIn.Should_Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Comment    Stream only shows in RFC URL.
-    BuiltIn.Run_Keyword_If    "${USE_RFC8040}" == "True"    BuiltIn.Should_Contain    ${resp.text}    ${NODES_STREAM_PATH}
+    IF    "${USE_RFC8040}" == "True"
+        BuiltIn.Should_Contain    ${resp.text}    ${NODES_STREAM_PATH}
+    END
 
 Start_Receiver
     [Documentation]    Start the websocket listener
-    ${output} =    BuiltIn.Run_Keyword_If    "${USE_RFC8040}" == "False"    SSHLibrary.Write    python3 wsreceiver.py --uri ${location} --count 2 --logfile ${RECEIVER_LOG_FILE} ${RECEIVER_OPTIONS}
-    ...    ELSE    SSHLibrary.Write    python3 ssereceiver.py --uri ${location} --logfile ${RECEIVER_LOG_FILE}
+    IF    "${USE_RFC8040}" == "False"
+        ${output} =    SSHLibrary.Write
+        ...    python3 wsreceiver.py --uri ${location} --count 2 --logfile ${RECEIVER_LOG_FILE} ${RECEIVER_OPTIONS}
+    ELSE
+        ${output} =    SSHLibrary.Write    python3 ssereceiver.py --uri ${location} --logfile ${RECEIVER_LOG_FILE}
+    END
     BuiltIn.Log    ${output}
     ${output} =    SSHLibrary.Read    delay=2s
     BuiltIn.Log    ${output}
@@ -103,12 +120,20 @@ Change_DS_Config
     [Documentation]    Make a change in DS configuration.
     [Tags]    critical
     ${body} =    OperatingSystem.Get_File    ${TEMPLATE_FOLDER}/${RESTCONF_CONFIG_DATA}
-    ${uri} =    BuiltIn.Set_Variable_If    "${USE_RFC8040}" == "False"    /restconf/config/network-topology:network-topology
+    ${uri} =    BuiltIn.Set_Variable_If
+    ...    "${USE_RFC8040}" == "False"
+    ...    /restconf/config/network-topology:network-topology
     ...    /rests/data/network-topology:network-topology
-    ${resp} =    RequestsLibrary.Put_Request    restconf    ${uri}    headers=${SEND_ACCEPT_XML_HEADERS}    data=${body}
+    ${resp} =    RequestsLibrary.Put_Request
+    ...    restconf
+    ...    ${uri}
+    ...    headers=${SEND_ACCEPT_XML_HEADERS}
+    ...    data=${body}
     Log_Response    ${resp}
     BuiltIn.Should_Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${uri} =    BuiltIn.Set_Variable_If    "${USE_RFC8040}" == "False"    /restconf/config/network-topology:network-topology/topology/netconf-notif
+    ${uri} =    BuiltIn.Set_Variable_If
+    ...    "${USE_RFC8040}" == "False"
+    ...    /restconf/config/network-topology:network-topology/topology/netconf-notif
     ...    /rests/data/network-topology:network-topology/topology=netconf-notif
     ${resp} =    RequestsLibrary.Delete_Request    restconf    ${uri}    headers=${SEND_ACCEPT_XML_HEADERS}
     Log_Response    ${resp}
@@ -147,6 +172,7 @@ Check_Bug_3934
     BuiltIn.Should_Contain    ${packed_notification}    ${packed_data}
     [Teardown]    Report_Failure_Due_To_Bug    3934
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    SSH-login to mininet machine, create HTTP session,
@@ -157,8 +183,14 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/wstools/wsreceiver.py
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/wstools/ssereceiver.py
     SSHLibrary.Execute_Command    sudo apt-get install -y python3-pip    return_stdout=True    return_stderr=True
-    SSHLibrary.Execute_Command    sudo python3 -m pip install --upgrade pip setuptools wheel    return_stdout=True    return_stderr=True
-    SSHLibrary.Execute_Command    sudo python3 -m pip install websocket-client asyncio aiohttp aiohttp-sse-client coroutine    return_stdout=True    return_stderr=True
+    SSHLibrary.Execute_Command
+    ...    sudo python3 -m pip install --upgrade pip setuptools wheel
+    ...    return_stdout=True
+    ...    return_stderr=True
+    SSHLibrary.Execute_Command
+    ...    sudo python3 -m pip install websocket-client asyncio aiohttp aiohttp-sse-client coroutine
+    ...    return_stdout=True
+    ...    return_stderr=True
     RequestsLibrary.Create_Session    restconf    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${CONTROLLER_LOG_LEVEL}
 
@@ -169,8 +201,8 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Log_Response
-    [Arguments]    ${resp}
     [Documentation]    Log response.
+    [Arguments]    ${resp}
     BuiltIn.Log    ${resp}
     BuiltIn.Log    ${resp.headers}
     BuiltIn.Log    ${resp.text}
index 89565b77f3a8f3a914d77273ea48d6a3c72e9979..f443256d0bbfb93ee48aad0a7ce8b83e730b4c7e 100644 (file)
@@ -1,86 +1,92 @@
 *** Settings ***
-Documentation     netconf-connector readiness test suite.
+Documentation       netconf-connector readiness test suite.
 ...
-...               Copyright (c) 2015,2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015,2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Try to detect whether Netconf is up and running and wait for
-...               it for a configurable time if it is not yet up and running.
+...                 Try to detect whether Netconf is up and running and wait for
+...                 it for a configurable time if it is not yet up and running.
 ...
-...               This is achieved by the test Check_Whether_Netconf_Topology_Is_Ready. This test case
-...               does not use controller-config device. This test case is skipped (Pass Execution) if
-...               the usage of controller-config device is indicated.
-...               Testing itself is done by creating a netconf test device configured
-...               to all odl nodes one by one and check if GET works from mounted
-...               device. GET is done from all the odl nodes and it works for both, 1 or 3 nodes
-...               setup.
+...                 This is achieved by the test Check_Whether_Netconf_Topology_Is_Ready. This test case
+...                 does not use controller-config device. This test case is skipped (Pass Execution) if
+...                 the usage of controller-config device is indicated.
+...                 Testing itself is done by creating a netconf test device configured
+...                 to all odl nodes one by one and check if GET works from mounted
+...                 device. GET is done from all the odl nodes and it works for both, 1 or 3 nodes
+...                 setup.
 ...
-...               The next test cases are basically dedicated to test readiness of the netconf using
-...               controller-config device. This device is created when odl-netconf-connector-ssh|all
-...               feature is installed. Robot variable USE_NETCONF_CONNECTOR should be set to True.
-...               Connector test cases change behavior depending on ${USE_NETCONF_CONNECTOR}. If True,
-...               they check data mounted behind controller-config is readable, if False they only check
-...               topology-netconf is readable.
+...                 The next test cases are basically dedicated to test readiness of the netconf using
+...                 controller-config device. This device is created when odl-netconf-connector-ssh|all
+...                 feature is installed. Robot variable USE_NETCONF_CONNECTOR should be set to True.
+...                 Connector test cases change behavior depending on ${USE_NETCONF_CONNECTOR}. If True,
+...                 they check data mounted behind controller-config is readable, if False they only check
+...                 topology-netconf is readable.
 ...
-...               Some testsuites expect netconf-connector to be ready as soon as possible and will
-...               fail if it is not. We want to see a failure if this is the cause of the failure.
+...                 Some testsuites expect netconf-connector to be ready as soon as possible and will
+...                 fail if it is not. We want to see a failure if this is the cause of the failure.
 ...
 ...
-...               The usage of netconf-connector happens in other suites than netconf,
-...               especially bgpcep to configure odl's bgp peers. Testing the readiness
-...               of the netconf-connector must be invoked by the Robot invocation
-...               argument USE_NETCONF_CONNECTOR. By default it is set to False and
-...               test jobs should be responsible to set it to True if needed. In the
-...               default configuration the affected test cases waits for the netconf
-...               topology to appear only.
+...                 The usage of netconf-connector happens in other suites than netconf,
+...                 especially bgpcep to configure odl's bgp peers. Testing the readiness
+...                 of the netconf-connector must be invoked by the Robot invocation
+...                 argument USE_NETCONF_CONNECTOR. By default it is set to False and
+...                 test jobs should be responsible to set it to True if needed. In the
+...                 default configuration the affected test cases waits for the netconf
+...                 topology to appear only.
 ...
-...               If the netconf-connector is not ready upon startup and it's usage is set
-...               to True (as seen by the second test case failing), the next case starts
-...               to repeat the query for a minute to see whether it is going "to fix itself"
-...               within the minute. If yes, then the testcase will pass, which
-...               indicates that the "ODL cooldown" of 1 minute is not long enough
-...               to allow for netconf-connector to initialize properly.
-...               If this fails, one more check with even longer timeout is run.
-...               If the Check_Whether_Netconf_Is_Up_And_Running pass, then the next test
-...               case does nothing.
+...                 If the netconf-connector is not ready upon startup and it's usage is set
+...                 to True (as seen by the second test case failing), the next case starts
+...                 to repeat the query for a minute to see whether it is going "to fix itself"
+...                 within the minute. If yes, then the testcase will pass, which
+...                 indicates that the "ODL cooldown" of 1 minute is not long enough
+...                 to allow for netconf-connector to initialize properly.
+...                 If this fails, one more check with even longer timeout is run.
+...                 If the Check_Whether_Netconf_Is_Up_And_Running pass, then the next test
+...                 case does nothing.
 ...
-...               The other test case then checks whether Netconf can pretty print
-...               data. This sometimes makes problems, most likely due to too
-...               new Robot Requests library with an interface incompatible with
-...               this test suite.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 The other test case then checks whether Netconf can pretty print
+...                 data. This sometimes makes problems, most likely due to too
+...                 new Robot Requests library with an interface incompatible with
+...                 this test suite.
+
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${netconf_is_ready}    False
-${NETCONFREADY_WAIT}    60s
-${NETCONFREADY_FALLBACK_WAIT}    1200s
-${USE_NETCONF_CONNECTOR}    False
-${DEBUG_LOGGING_FOR_EVERYTHING}    False
-${NETCONFREADY_WAIT_MDSAL}    60s
-${DEVICE_NAME}    test-device
-${DEVICE_PORT}    2830
-${NETCONF_FOLDER}    ${CURDIR}/../../../variables/netconf/device
+${netconf_is_ready}                 False
+${NETCONFREADY_WAIT}                60s
+${NETCONFREADY_FALLBACK_WAIT}       1200s
+${USE_NETCONF_CONNECTOR}            False
+${DEBUG_LOGGING_FOR_EVERYTHING}     False
+${NETCONFREADY_WAIT_MDSAL}          60s
+${DEVICE_NAME}                      test-device
+${DEVICE_PORT}                      2830
+${NETCONF_FOLDER}                   ${CURDIR}/../../../variables/netconf/device
+
 
 *** Test Cases ***
 Check_Whether_Netconf_Topology_Is_Ready
-    [Tags]    ODLMICRO_IGN
     [Documentation]    Checks netconf readiness.
-    BuiltIn.Pass_Execution_If    ${USE_NETCONF_CONNECTOR}==${True}    Netconf connector is used. Next testcases do their job in this case.
+    [Tags]    odlmicro_ign
+    BuiltIn.Pass_Execution_If
+    ...    ${USE_NETCONF_CONNECTOR}==${True}
+    ...    Netconf connector is used. Next testcases do their job in this case.
     BuiltIn.Wait_Until_Keyword_Succeeds    10x    1s    Check_Netconf_Topology_Ready
 
 Check_Whether_Netconf_Connector_Is_Up_And_Running
@@ -92,13 +98,17 @@ Check_Whether_Netconf_Connector_Is_Up_And_Running
 Wait_For_Netconf_Connector
     [Documentation]    Wait for the Netconf to go up for configurable time.
     [Tags]    critical
-    BuiltIn.Run_Keyword_If    not ${netconf_is_ready}    BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_WAIT}    1s    Check_Netconf_Up_And_Running
+    IF    not ${netconf_is_ready}
+        BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_WAIT}    1s    Check_Netconf_Up_And_Running
+    END
     BuiltIn.Set_Suite_Variable    ${netconf_is_ready}    True
 
 Wait_Even_Longer
     [Documentation]    Bugs such as 7175 may require to wait longer till netconf-connector works.
     [Tags]    critical
-    BuiltIn.Pass_Execution_If    ${netconf_is_ready}    Netconf was detected to be up and running so bug 5014 did not show up.
+    BuiltIn.Pass_Execution_If
+    ...    ${netconf_is_ready}
+    ...    Netconf was detected to be up and running so bug 5014 did not show up.
     BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_FALLBACK_WAIT}    10s    Check_Netconf_Up_And_Running
     BuiltIn.Set_Suite_Variable    ${netconf_is_ready}    True
 
@@ -111,36 +121,50 @@ Check_For_Bug_5014
     ...    as this signifies the bug 5014 to be present. Skip this testcase
     ...    if Netconf is detected to be up and running.
     [Tags]    critical
-    BuiltIn.Pass_Execution_If    ${netconf_is_ready}    Netconf was detected to be up and running so bug 5014 did not show up.
+    BuiltIn.Pass_Execution_If
+    ...    ${netconf_is_ready}
+    ...    Netconf was detected to be up and running so bug 5014 did not show up.
     ${status}    ${error}=    BuiltIn.Run_Keyword_And_Ignore_Error    Check_Netconf_Usable
-    BuiltIn.Run_Keyword_If    '${status}'=='PASS'    BuiltIn.Set_Suite_Variable    ${netconf_is_ready}    True
+    IF    '${status}'=='PASS'
+        BuiltIn.Set_Suite_Variable    ${netconf_is_ready}    True
+    END
     BuiltIn.Should_Be_Equal    '${status}'    'FAIL'
 
 Check_Whether_Netconf_Can_Pretty_Print
     [Documentation]    Make one request to netconf-connector and see if it works.
     [Tags]    critical
-    BuiltIn.Run_Keyword_If    not ${netconf_is_ready}    Fail    Netconf is not ready so it can't pretty-print now.
+    IF    not ${netconf_is_ready}
+        Fail    Netconf is not ready so it can't pretty-print now.
+    END
     Check_Netconf_Up_And_Running    ?odl-pretty-print=true
 
 Wait_For_MDSAL
-    [Tags]    ODLMICRO_IGN
     [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.
+    [Tags]    odlmicro_ign
+    ${status}    ${message}=    BuiltIn.Run_Keyword_And_Ignore_Error
+    ...    KarafKeywords.Verify_Feature_Is_Installed
+    ...    odl-netconf-mdsal
+    IF    '${status}' == 'FAIL'
+        BuiltIn.Pass_Execution    The 'odl-netconf-mdsal' feature is not installed so no need to wait for it.
+    END
     SSHKeywords.Open_Connection_To_ODL_System
     BuiltIn.Wait_Until_Keyword_Succeeds    ${NETCONFREADY_WAIT_MDSAL}    1s    Check_Netconf_MDSAL_Up_And_Running
     SSHLibrary.Close_Connection
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils. Setup requests library and log into karaf.log that the netconf readiness wait starts.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     ${connector}=    Set_Netconf_Connector
     BuiltIn.Set_Suite_Variable    ${netconf_connector}    ${connector}
-    BuiltIn.Comment    A workaround for EOF error follows. TODO: Create a test case for the EOF bug, possibly tagged "exclude".
+    BuiltIn.Comment
+    ...    A workaround for EOF error follows. TODO: Create a test case for the EOF bug, possibly tagged "exclude".
     BuiltIn.Wait_Until_Keyword_Succeeds    2x    1s    KarafKeywords.Open_Controller_Karaf_Console_On_Background
     KarafKeywords.Log_Message_To_Controller_Karaf    Starting Netconf readiness test suite
-    BuiltIn.Run_Keyword_If    ${DEBUG_LOGGING_FOR_EVERYTHING}    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set DEBUG
+    IF    ${DEBUG_LOGGING_FOR_EVERYTHING}
+        KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set DEBUG
+    END
     RequestsLibrary.Create_Session    ses    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     NetconfKeywords.Setup_Netconf_Keywords
 
@@ -151,9 +175,10 @@ Teardown_Everything
 
 Set_Netconf_Connector
     [Documentation]    Sets netconf connector verify url according to the ${ODL_STREAM} and ${USE_NETCONF_CONNECTOR} combination
-    ${streamconnector}=    Set Variable    /node/controller-config/yang-ext:mount/config:modules/module/sal-restconf-service:json-restconf-service-impl/json-restconf-service-impl
+    ${streamconnector}=    Set Variable
+    ...    /node/controller-config/yang-ext:mount/config:modules/module/sal-restconf-service:json-restconf-service-impl/json-restconf-service-impl
     ${connector}=    BuiltIn.Set_Variable_If    ${USE_NETCONF_CONNECTOR}    ${streamconnector}    ${EMPTY}
-    BuiltIn.Return_From_Keyword    ${connector}
+    RETURN    ${connector}
 
 Check_Netconf_Topology_Ready
     [Documentation]    Verifies the netconf readiness for every odl node.
@@ -162,44 +187,68 @@ Check_Netconf_Topology_Ready
     END
 
 Verify_Netconf_Topology_Ready_For_Node
-    [Arguments]    ${node_index}
     [Documentation]    Netconf readines for a node is done by creating a netconf device connected to that node
     ...    and performing GET operation got from the device's mount point.
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${node_index}
+    [Arguments]    ${node_index}
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${node_index}
     Configure_Netconf_Device    ${DEVICE_NAME}    ${session}    ${ODL_SYSTEM_${node_index}_IP}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}
+    &{mapping}=    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}
     Wait_Netconf_Device_Mounted    ${DEVICE_NAME}    ${session}    ${mapping}
     FOR    ${idx}    IN    @{ClusterManagement__member_index_list}
         ${mod_session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${idx}
-        BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    TemplatedRequests.Get_As_Xml_Templated    ${NETCONF_FOLDER}${/}netconf-state    mapping=${mapping}
+        BuiltIn.Wait_Until_Keyword_Succeeds
+        ...    5x
+        ...    3s
+        ...    TemplatedRequests.Get_As_Xml_Templated
+        ...    ${NETCONF_FOLDER}${/}netconf-state
+        ...    mapping=${mapping}
         ...    session=${mod_session}
     END
     [Teardown]    Remove_Netconf_Device    ${DEVICE_NAME}    ${session}
 
 Configure_Netconf_Device
-    [Arguments]    ${device_name}    ${session}    ${device_ip}
     [Documentation]    Configures the device via REST api.
-    NetconfKeywords.Configure_Device_In_Netconf    ${device_name}    device_type=full-uri-device    device_port=${DEVICE_PORT}    device_address=${device_ip}    device_user=admin    device_password=admin
+    [Arguments]    ${device_name}    ${session}    ${device_ip}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${device_name}
+    ...    device_type=full-uri-device
+    ...    device_port=${DEVICE_PORT}
+    ...    device_address=${device_ip}
+    ...    device_user=admin
+    ...    device_password=admin
     ...    session=${session}
 
 Remove_Netconf_Device
-    [Arguments]    ${device_name}    ${session}
     [Documentation]    Removes configured device
+    [Arguments]    ${device_name}    ${session}
     NetconfKeywords.Remove_Device_From_Netconf    ${device_name}    session=${session}
 
 Wait_Netconf_Device_Mounted
-    [Arguments]    ${device_name}    ${session}    ${mapping}    ${timeout}=30s
     [Documentation]    Checks weather the device was mounted.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    3s    TemplatedRequests.Get_As_Xml_Templated    ${NETCONF_FOLDER}${/}full-uri-mount    mapping=${mapping}    session=${session}
+    [Arguments]    ${device_name}    ${session}    ${mapping}    ${timeout}=30s
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${timeout}
+    ...    3s
+    ...    TemplatedRequests.Get_As_Xml_Templated
+    ...    ${NETCONF_FOLDER}${/}full-uri-mount
+    ...    mapping=${mapping}
+    ...    session=${session}
 
 Check_Netconf_Up_And_Running
-    [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_Request    ses    rests/data/network-topology:network-topology/topology\=topology-netconf${netconf_connector}${pretty_print}
+    [Arguments]    ${pretty_print}=${EMPTY}
+    ${response}=    RequestsLibrary.Get_Request
+    ...    ses
+    ...    rests/data/network-topology:network-topology/topology\=topology-netconf${netconf_connector}${pretty_print}
     BuiltIn.Log    ${response.text}
-    ${status}=    BuiltIn.Run_Keyword_And_Return_Status    BuiltIn.Should_Contain    ${response.text}    data model content does not exist
-    BuiltIn.Run_Keyword_If    ${status}    BuiltIn.Set_Suite_Variable    ${netconf_not_ready_cause}    5832
-    BuiltIn.Run_Keyword_If    ${status}    SetupUtils.Set_Known_Bug_Id    5832
+    ${status}=    BuiltIn.Run_Keyword_And_Return_Status
+    ...    BuiltIn.Should_Contain
+    ...    ${response.text}
+    ...    data model content does not exist
+    IF    ${status}
+        BuiltIn.Set_Suite_Variable    ${netconf_not_ready_cause}    5832
+    END
+    IF    ${status}    SetupUtils.Set_Known_Bug_Id    5832
     BuiltIn.Should_Be_Equal_As_Strings    ${response.status_code}    200
 
 Check_Netconf_Usable
index 601db748bedfe4a1ed4674c9ebd27720e68ed357..d10ec5b51d982bf0ea4b9d815d58ad9c3c3a55ae 100644 (file)
@@ -1,41 +1,45 @@
 *** Settings ***
-Documentation     netconf-restperfclient MDSAL performance test suite.
+Documentation       netconf-restperfclient MDSAL performance test suite.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform given count of update operations on ODL MDSAL. In first half the
-...               requests are directed directly to MDSAL via Restconf and in the second
-...               half the MDSAL is mounted onto a netconf connector and the reqursts are
-...               directed to that connector. In both cases the netconf-testtool-restperfclient
-...               tool is used to generate and send the requests and the requests are sent
-...               synchronously as the netconf connector mounted MDSAL does not support
-...               asynchronous requests. The restperfclient is used to generate the "update"
-...               requests, the "create" request is issued in a sepate test case.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RestPerfClient.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 Perform given count of update operations on ODL MDSAL. In first half the
+...                 requests are directed directly to MDSAL via Restconf and in the second
+...                 half the MDSAL is mounted onto a netconf connector and the reqursts are
+...                 directed to that connector. In both cases the netconf-testtool-restperfclient
+...                 tool is used to generate and send the requests and the requests are sent
+...                 synchronously as the netconf connector mounted MDSAL does not support
+...                 asynchronous requests. The restperfclient is used to generate the "update"
+...                 requests, the "create" request is issued in a sepate test case.
+
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RestPerfClient.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${DIRECTORY_WITH_TEMPLATE_FOLDERS}    ${CURDIR}/../../../variables/netconf/RestPerfClient
-${REQUEST_COUNT}    16384
-${device_type}    full-uri-device
-${test_device}    odl-mdsal-northbound-via-netconf-connector
+${DIRECTORY_WITH_TEMPLATE_FOLDERS}      ${CURDIR}/../../../variables/netconf/RestPerfClient
+${REQUEST_COUNT}                        16384
+${device_type}                          full-uri-device
+${test_device}                          odl-mdsal-northbound-via-netconf-connector
+
 
 *** Test Cases ***
 Create_Test_Data_For_Direct_Access
@@ -73,12 +77,19 @@ Create_Test_Data_For_Connector_Access
 
 Configure_ODL_As_A_Device_On_Netconf
     [Documentation]    Configure ODL MDSAL Northbound as a Netconf device on a Netconf connector.
-    NetconfKeywords.Configure_Device_In_Netconf    ${test_device}    device_type=${device_type}    device_address=${ODL_SYSTEM_IP}    device_port=${ODL_NETCONF_MDSAL_PORT}    device_user=${ODL_NETCONF_USER}    device_password=${ODL_NETCONF_PASSWORD}
+    NetconfKeywords.Configure_Device_In_Netconf
+    ...    ${test_device}
+    ...    device_type=${device_type}
+    ...    device_address=${ODL_SYSTEM_IP}
+    ...    device_port=${ODL_NETCONF_MDSAL_PORT}
+    ...    device_user=${ODL_NETCONF_USER}
+    ...    device_password=${ODL_NETCONF_PASSWORD}
     NetconfKeywords.Wait_Device_Connected    ${test_device}
 
 Run_RestPerfClient_Through_Netconf_Connector
     [Documentation]    Ask RestPerfClient to send the requests to the MDSAL mapped via netconf topology device.
-    ${url}=    BuiltIn.Set_Variable    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${test_device}/yang-ext:mount/car:cars
+    ${url}=    BuiltIn.Set_Variable
+    ...    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${test_device}/yang-ext:mount/car:cars
     RestPerfClient.Invoke_Restperfclient    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT}    ${url}    testcase=netconf-connector
 
 Check_For_Failed_Netconf_Connector_Requests
@@ -107,6 +118,7 @@ Cleanup_And_Collect_For_Connector_Access
     RestPerfClient.Collect_From_Restperfclient
     TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
index 80eb4a1fdf5f67055e8eb91e14f280c243963c2a..898617785b88184dc8ba9af3db1c27e746685dc0 100644 (file)
@@ -1,51 +1,65 @@
 *** Settings ***
-Documentation     netconf-restperfclient Update performance test suite.
+Documentation       netconf-restperfclient Update performance test suite.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Perform given count of update operations on device data mounted onto a
-...               netconf connector (using the netconf-testtool-restperfclient tool) and
-...               see how much time it took. More exactly, it sends the data to a restconf
-...               mountpoint of the netconf connector belonging to the device, which turns
-...               out to turn the first request sent to a "create" request and the
-...               remaining requests to "update" requests (due to how the testtool device
-...               behavior is implemented).
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           Collections
-Library           RequestsLibrary
-Library           OperatingSystem
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RestPerfClient.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 Perform given count of update operations on device data mounted onto a
+...                 netconf connector (using the netconf-testtool-restperfclient tool) and
+...                 see how much time it took. More exactly, it sends the data to a restconf
+...                 mountpoint of the netconf connector belonging to the device, which turns
+...                 out to turn the first request sent to a "create" request and the
+...                 remaining requests to "update" requests (due to how the testtool device
+...                 behavior is implemented).
+
+Library             Collections
+Library             RequestsLibrary
+Library             OperatingSystem
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RestPerfClient.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${DEVICE_NAME}    ${FIRST_TESTTOOL_PORT}-sim-device
-${REQUEST_COUNT}    16384
+${DEVICE_NAME}                      ${FIRST_TESTTOOL_PORT}-sim-device
+${REQUEST_COUNT}                    16384
 ${directory_with_crud_templates}    ${CURDIR}/../../../variables/netconf/CRUD
-${device_type}    full-uri-device
+${device_type}                      full-uri-device
+
 
 *** Test Cases ***
 Start_Testtool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
     # Start test tool
     SSHLibrary.Switch_Connection    ${testtool}
-    Run Keyword If    '${IS_KARAF_APPL}' == 'True'    NetconfKeywords.Install_And_Start_Testtool    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas    debug=false
-    ...    ELSE    NetconfKeywords.Start_Testtool    ${NETCONF_FILENAME}    device-count=1    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas    debug=false
+    IF    '${IS_KARAF_APPL}' == 'True'
+        NetconfKeywords.Install_And_Start_Testtool
+        ...    device-count=1
+        ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+        ...    debug=false
+    ELSE
+        NetconfKeywords.Start_Testtool
+        ...    ${NETCONF_FILENAME}
+        ...    device-count=1
+        ...    schemas=${CURDIR}/../../../variables/netconf/CRUD/schemas
+        ...    debug=false
+    END
 
 Configure_Device_On_Netconf
     [Documentation]    Configure the testtool device on Netconf connector.
@@ -62,7 +76,8 @@ Create_Device_Data
 
 Run_Restperfclient
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the netconf connector of the device.
-    ${url}=    BuiltIn.Set_Variable    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${DEVICE_NAME}/yang-ext:mount/car:cars
+    ${url}=    BuiltIn.Set_Variable
+    ...    /rests/data/network-topology:network-topology/topology\=topology-netconf/node\=${DEVICE_NAME}/yang-ext:mount/car:cars
     RestPerfClient.Invoke_Restperfclient    ${TESTTOOL_DEVICE_TIMEOUT}    ${url}    async=false
 
 Check_For_Failed_Requests
@@ -83,6 +98,7 @@ Cleanup_And_Collect
     RestPerfClient.Collect_From_Restperfclient
     NetconfKeywords.Remove_Device_From_Netconf    ${DEVICE_NAME}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -92,8 +108,13 @@ Setup_Everything
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords
-    Run Keyword If    '${IS_KARAF_APPL}' == 'False'    RestPerfClient.Setup_Restperfclient    build_version=${NETCONF_TESTTOOL_VERSION}    build_location=org/opendaylight/netconf
-    ...    ELSE    RestPerfClient.Setup_Restperfclient
+    IF    '${IS_KARAF_APPL}' == 'False'
+        RestPerfClient.Setup_Restperfclient
+        ...    build_version=${NETCONF_TESTTOOL_VERSION}
+        ...    build_location=org/opendaylight/netconf
+    ELSE
+        RestPerfClient.Setup_Restperfclient
+    END
     # Connect to the tools system (testtool)
     ${testtool}=    SSHKeywords.Open_Connection_To_Tools_System
     BuiltIn.Set_Suite_Variable    ${testtool}    ${testtool}
index 97b544e3a257631a1d28958fd89aa7b3b6658211..a28d57d422ab6cdbd092a9ce302122e3926c00da 100644 (file)
@@ -1,44 +1,51 @@
 *** Settings ***
-Documentation     netconf-connector scaling test suite (multi-threaded GET requests).
+Documentation       netconf-connector scaling test suite (multi-threaded GET requests).
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Performs scaling tests:
-...               - Send configurations of the devices one by one (via restconf).
-...               - Wait for the devices to become connected.
-...               - Send requests for configuration data using ${WORKER_COUNT} worker threads
-...               (using external Python tool).
-...               - Deconfigure the devices one by one.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 Performs scaling tests:
+...                 - Send configurations of the devices one by one (via restconf).
+...                 - Wait for the devices to become connected.
+...                 - Send requests for configuration data using ${WORKER_COUNT} worker threads
+...                 (using external Python tool).
+...                 - Deconfigure the devices one by one.
+
+Library             Collections
+Library             String
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DEVICE_COUNT}    500
-${WORKER_COUNT}    10
-${TIMEOUT_FACTOR}    10
-${device_name_base}    netconf-scaling-device
-${device_type}    full-uri-device
-${base_port}      17830
+${DEVICE_COUNT}         500
+${WORKER_COUNT}         10
+${TIMEOUT_FACTOR}       10
+${device_name_base}     netconf-scaling-device
+${device_type}          full-uri-device
+${base_port}            17830
+
 
 *** Test Cases ***
 Start_Test_Tool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    Run Keyword If    '${IS_KARAF_APPL}' == 'True'    NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}
-    ...    ELSE    NetconfKeywords.Start_Testtool    ${NETCONF_FILENAME}    device-count=${DEVICE_COUNT}
+    IF    '${IS_KARAF_APPL}' == 'True'
+        NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}
+    ELSE
+        NetconfKeywords.Start_Testtool    ${NETCONF_FILENAME}    device-count=${DEVICE_COUNT}
+    END
 
 Configure_Devices_On_Netconf
     [Documentation]    Make requests to configure the testtool devices.
@@ -51,12 +58,13 @@ Wait_For_Devices_To_Connect
     NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Wait_Connected    timeout=${timeout}
 
 Issue_Requests_On_Devices
-    # FIXME: this test case is a keyword and nearly duplicated in the max_devices.robot suite. need to move it to a common lib
     [Documentation]    Spawn the specified count of worker threads to issue a GET request to each of the devices.
+    # FIXME: this test case is a keyword and nearly duplicated in the max_devices.robot suite. need to move it to a common lib
     ${current_ssh_connection}=    SSHLibrary.Get Connection
     SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}
     SSHKeywords.Flexible_Mininet_Login
-    SSHLibrary.Write    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${DEVICE_COUNT} --name=${device_name_base} --workers=${WORKER_COUNT}
+    SSHLibrary.Write
+    ...    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${DEVICE_COUNT} --name=${device_name_base} --workers=${WORKER_COUNT}
     FOR    ${number}    IN RANGE    1    ${DEVICE_COUNT}+1
         Read_Python_Tool_Operation_Result    ${number}
     END
@@ -75,6 +83,7 @@ Check_Devices_Are_Deconfigured
     ${timeout}=    BuiltIn.Evaluate    ${DEVICE_COUNT}*${TIMEOUT_FACTOR}
     NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Check_Device_Deconfigured    timeout=${timeout}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -95,18 +104,21 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Read_Python_Tool_Operation_Result
-    [Arguments]    ${number}
     [Documentation]    Read and process a report line emitted from the Python tool that corresponds to the device with the given number.
+    [Arguments]    ${number}
     ${test}=    SSHLibrary.Read_Until_Regexp    \\n
     ${test}=    String.Split_String    ${test}    |
     ${response}=    Collections.Get_From_List    ${test}    0
     ${message}=    Collections.Get_From_List    ${test}    1
-    BuiltIn.Run_Keyword_If    '${response}' == 'ERROR'    Fail    Error getting data: ${message}
+    IF    '${response}' == 'ERROR'    Fail    Error getting data: ${message}
     ${start}=    Collections.Get_From_List    ${test}    1
     ${stop}=    Collections.Get_From_List    ${test}    2
     ${ellapsed}=    Collections.Get_From_List    ${test}    3
     BuiltIn.Log    DATA REQUEST RESULT: Device=${number} StartTime=${start} StopTime=${stop} EllapsedTime=${ellapsed}
     ${data}=    Collections.Get_From_List    ${test}    4
-    ${expected}=    Run Keyword If    '${IS_KARAF_APPL}' == 'True'    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
-    ...    ELSE    Set Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    IF    '${IS_KARAF_APPL}' == 'True'
+        ${expected}=    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
+    ELSE
+        ${expected}=    Set Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    END
     BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
index eee2dcc6ad2e7e8ff4f7028c4a6ec929c3e7925b..f60b9a082d48b27c77ba0ecda515c939091e2b0b 100644 (file)
@@ -1,38 +1,45 @@
 *** Settings ***
-Documentation     netconf-connector scaling test suite (single-threaded GET requests).
+Documentation       netconf-connector scaling test suite (single-threaded GET requests).
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Performs scaling tests:
-...               - Configuring devices one by one.
-...               - Sending requests for configuration data.
-...               - Deconfiguring devices one by one.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Variables         ${CURDIR}/../../../variables/Variables.py
+...                 Performs scaling tests:
+...                 - Configuring devices one by one.
+...                 - Sending requests for configuration data.
+...                 - Deconfiguring devices one by one.
+
+Library             RequestsLibrary
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource            ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Variables           ${CURDIR}/../../../variables/Variables.py
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${DEVICE_COUNT}    500
-${TIMEOUT_FACTOR}    10
-${device_type}    full-uri-device
+${DEVICE_COUNT}         500
+${TIMEOUT_FACTOR}       10
+${device_type}          full-uri-device
+
 
 *** Test Cases ***
 Start_Test_Tool
     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
-    Run Keyword If    '${IS_KARAF_APPL}' == 'True'    NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}
-    ...    ELSE    NetconfKeywords.Start_Testtool    ${NETCONF_FILENAME}    device-count=${DEVICE_COUNT}
+    IF    '${IS_KARAF_APPL}' == 'True'
+        NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}
+    ELSE
+        NetconfKeywords.Start_Testtool    ${NETCONF_FILENAME}    device-count=${DEVICE_COUNT}
+    END
 
 Configure_Devices_Onto_Netconf
     [Documentation]    Make requests to configure the testtool devices.
@@ -52,6 +59,7 @@ Deconfigure_Devices_From_Netconf
     NetconfKeywords.Perform_Operation_On_Each_Device    Deconfigure_Device_And_Verify    timeout=${timeout}
     [Teardown]    Report_Failure_Due_To_Bug    4547
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
@@ -71,11 +79,17 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Check_Device_Data
-    [Arguments]    ${current_name}    ${log_response}=True
     [Documentation]    Opration for getting the configuration data of the device and checking that it matches what is expected.
+    [Arguments]    ${current_name}    ${log_response}=True
     KarafKeywords.Log_Message_To_Controller_Karaf    Getting data from device ${current_name}
-    ${data}=    Utils.Get_Data_From_URI    config    network-topology:network-topology/topology=topology-netconf/node=${current_name}/yang-ext:mount?content=config    headers=${ACCEPT_XML}
+    ${data}=    Utils.Get_Data_From_URI
+    ...    config
+    ...    network-topology:network-topology/topology=topology-netconf/node=${current_name}/yang-ext:mount?content=config
+    ...    headers=${ACCEPT_XML}
     KarafKeywords.Log_Message_To_Controller_Karaf    Got data from device ${current_name}
-    ${expected}=    Run Keyword If    '${IS_KARAF_APPL}' == 'True'    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
-    ...    ELSE    Set Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    IF    '${IS_KARAF_APPL}' == 'True'
+        ${expected}=    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
+    ELSE
+        ${expected}=    Set Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    END
     Should Be Equal As Strings    '${data}'    ${expected}
index da2d30d49fd0190ddcdb479e037b37d2c10b4eae..ac29a77bb9ea2882043acc13f8ec2bb23c5408d3 100644 (file)
@@ -1,41 +1,45 @@
 *** Settings ***
-Documentation     netconf-connector scaling test suite to find max connected devices
+Documentation       netconf-connector scaling test suite to find max connected devices
 ...
-...               Copyright (c) 2019 Lumina Networks, Inc. and others. All rights reserved.
+...                 Copyright (c) 2019 Lumina Networks, Inc. and others. All rights reserved.
 ...
-...               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
+...                 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
 ...
 ...
-...               Increasing numbers of netconf devices will be connected and cleaned up
-...               while validating and profiling between each iteration.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           Collections
-Library           String
-Library           SSHLibrary    timeout=1000s
-Library           ../../../libraries/TopologyNetconfNodes.py
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/NetconfKeywords.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../variables/Variables.robot
+...                 Increasing numbers of netconf devices will be connected and cleaned up
+...                 while validating and profiling between each iteration.
+
+Library             Collections
+Library             String
+Library             SSHLibrary    timeout=1000s
+Library             ../../../libraries/TopologyNetconfNodes.py
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/NetconfKeywords.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${INIT_DEVICE_COUNT}    250
-${MAX_DEVICE_COUNT}    100000
-${DEVICE_INCREMENT}    5000
-${DEVICE_NAME_BASE}    netconf-scaling-device
-${DEVICE_TYPE}    full-uri-device
-${BASE_PORT}      17830
-${NUM_WORKERS}    500
-${TIMEOUT_FACTOR}    3
-${MIN_CONNECT_TIMEOUT}    300
-${DEVICES_RESULT_FILE}    devices.csv
-${INSTALL_TESTTOOL}    True
-${TESTTOOL_EXECUTABLE}    ${EMPTY}
+${INIT_DEVICE_COUNT}        250
+${MAX_DEVICE_COUNT}         100000
+${DEVICE_INCREMENT}         5000
+${DEVICE_NAME_BASE}         netconf-scaling-device
+${DEVICE_TYPE}              full-uri-device
+${BASE_PORT}                17830
+${NUM_WORKERS}              500
+${TIMEOUT_FACTOR}           3
+${MIN_CONNECT_TIMEOUT}      300
+${DEVICES_RESULT_FILE}      devices.csv
+${INSTALL_TESTTOOL}         True
+${TESTTOOL_EXECUTABLE}      ${EMPTY}
+
 
 *** Test Cases ***
 Find Max Netconf Devices
@@ -46,49 +50,82 @@ Find Max Netconf Devices
     ${start} =    BuiltIn.Convert to Integer    ${INIT_DEVICE_COUNT}
     ${stop} =    BuiltIn.Convert to Integer    ${MAX_DEVICE_COUNT}
     ${increment} =    BuiltIn.Convert to Integer    ${DEVICE_INCREMENT}
-    ${schema_dir} =    Run Keyword If    "${SCHEMA_MODEL}" == "juniper"    Get Juniper Device Schemas
-    ...    ELSE    Set Variable    none
+    IF    "${SCHEMA_MODEL}" == "juniper"
+        ${schema_dir} =    Get Juniper Device Schemas
+    ELSE
+        ${schema_dir} =    Set Variable    none
+    END
     ${INSTALL_TESTTOOL} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    False    True
     ${TESTTOOL_EXECUTABLE} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    ${NETCONF_FILENAME}    ${EMPTY}
-    ${SCHEMAS} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    ${CURDIR}/../../../variables/netconf/CRUD/schemas    ${schema_dir}
+    ${SCHEMAS} =    Set Variable If
+    ...    '${IS_KARAF_APPL}' == 'False'
+    ...    ${CURDIR}/../../../variables/netconf/CRUD/schemas
+    ...    ${schema_dir}
     ${restconf_url} =    BuiltIn.Set_Variable    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests
     ${device_names} =    BuiltIn.Set_Variable    []
     FOR    ${devices}    IN RANGE    ${start}    ${stop+1}    ${increment}
         ${timeout} =    BuiltIn.Evaluate    ${devices}*${TIMEOUT_FACTOR}
         ${timeout} =    Set Variable If    ${timeout} > ${MIN_CONNECT_TIMEOUT}    ${timeout}    ${MIN_CONNECT_TIMEOUT}
         Log To Console    Starting Iteration with ${devices} devices
-        Run Keyword If    "${INSTALL_TESTTOOL}"=="True"    NetconfKeywords.Install_And_Start_Testtool    debug=false    schemas=${schema_dir}    device-count=${devices}    log_response=False
-        ...    ELSE    NetconfKeywords.Start_Testtool    ${TESTTOOL_EXECUTABLE}    debug=false    schemas=${SCHEMAS}    device-count=${devices}    log_response=False
+        IF    "${INSTALL_TESTTOOL}"=="True"
+            NetconfKeywords.Install_And_Start_Testtool
+            ...    debug=false
+            ...    schemas=${schema_dir}
+            ...    device-count=${devices}
+            ...    log_response=False
+        ELSE
+            NetconfKeywords.Start_Testtool
+            ...    ${TESTTOOL_EXECUTABLE}
+            ...    debug=false
+            ...    schemas=${SCHEMAS}
+            ...    device-count=${devices}
+            ...    log_response=False
+        END
         ${devices_to_configure} =    BuiltIn.Evaluate    ${devices} - len(${device_names})
         ${first_id} =    BuiltIn.Evaluate    len(${device_names}) + 1
-        ${device_names} =    TopologyNetconfNodes.Configure Device Range    restconf_url=${restconf_url}    device_name_prefix=${DEVICE_NAME_BASE}
-        ...    device_ipaddress=${TOOLS_SYSTEM_IP}    device_port=17830    device_count=${devices_to_configure}    first_device_id=${first_id}
-        TopologyNetconfNodes.Await Devices Connected    restconf_url=${restconf_url}    device_names=${device_names}    deadline_seconds=${timeout}
-        ${status}    ${result} =    Run Keyword And Ignore Error    Issue_Requests_On_Devices    ${TOOLS_SYSTEM_IP}    ${devices}    ${NUM_WORKERS}
-        Exit For Loop If    '${status}' == 'FAIL'
+        ${device_names} =    TopologyNetconfNodes.Configure Device Range
+        ...    restconf_url=${restconf_url}
+        ...    device_name_prefix=${DEVICE_NAME_BASE}
+        ...    device_ipaddress=${TOOLS_SYSTEM_IP}
+        ...    device_port=17830
+        ...    device_count=${devices_to_configure}
+        ...    first_device_id=${first_id}
+        TopologyNetconfNodes.Await Devices Connected
+        ...    restconf_url=${restconf_url}
+        ...    device_names=${device_names}
+        ...    deadline_seconds=${timeout}
+        ${status}    ${result} =    Run Keyword And Ignore Error
+        ...    Issue_Requests_On_Devices
+        ...    ${TOOLS_SYSTEM_IP}
+        ...    ${devices}
+        ...    ${NUM_WORKERS}
+        IF    '${status}' == 'FAIL'            BREAK
         ${maximum_devices} =    Set Variable    ${devices}
         NetconfKeywords.Stop_Testtool
     END
     [Teardown]    Run Keywords    NetconfKeywords.Stop_Testtool
     ...    AND    Collect_Data_Points    ${maximum_devices}
 
+
 *** Keywords ***
 Collect_Data_Points
-    [Arguments]    ${devices}
     [Documentation]    Parse and Log relevant information when Scale test finishes
+    [Arguments]    ${devices}
     OperatingSystem.Append To File    ${DEVICES_RESULT_FILE}    Max Devices\n
     OperatingSystem.Append To File    ${DEVICES_RESULT_FILE}    ${devices}\n
 
 Issue_Requests_On_Devices
-    # FIXME: this keyword is nearly duplicated in the getmulti.robot suite. need to move it to a common lib
-    [Arguments]    ${client_ip}    ${expected_count}    ${worker_count}
     [Documentation]    Spawn the specified count of worker threads to issue a GET request to each of the devices.
-    ${current_ssh_connection}=    SSHLibrary.Get Connection
+    [Arguments]    ${client_ip}    ${expected_count}    ${worker_count}
+    # FIXME: this keyword is nearly duplicated in the getmulti.robot suite. need to move it to a common lib
+    ${current_ssh_connection} =    SSHLibrary.Get Connection
     SSHLibrary.Open_Connection    ${client_ip}
     SSHKeywords.Flexible_Mininet_Login
-    SSHLibrary.Write    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
+    SSHLibrary.Write
+    ...    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
     SSHLibrary.Read_Until    ${DEFAULT_LINUX_PROMPT_STRICT}
-    SSHLibrary.Write    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
+    SSHLibrary.Write
+    ...    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
     FOR    ${number}    IN RANGE    1    ${expected_count}+1
         Read_Python_Tool_Operation_Result    ${number}
     END
@@ -106,7 +143,7 @@ Setup_Everything
     # Deploy testing tools.
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/netconf_tools/getter.py
     SSHLibrary.Put_File    ${CURDIR}/../../../libraries/AuthStandalone.py
-    ${device_type}=    BuiltIn.Set_Variable_If    ${USE_NETCONF_CONNECTOR}==${True}    default    ${device_type}
+    ${device_type} =    BuiltIn.Set_Variable_If    ${USE_NETCONF_CONNECTOR}==${True}    default    ${device_type}
     BuiltIn.Set_Suite_Variable    ${device_type}
 
 Teardown_Everything
@@ -115,27 +152,34 @@ Teardown_Everything
     NetconfKeywords.Stop_Testtool
 
 Read_Python_Tool_Operation_Result
-    [Arguments]    ${number}
     [Documentation]    Read and process a report line emitted from the Python tool that corresponds to the device with the given number.
-    ${test}=    SSHLibrary.Read_Until_Regexp    \\n
-    ${test}=    String.Split_String    ${test}    |
-    ${response}=    Collections.Get_From_List    ${test}    0
-    ${message}=    Collections.Get_From_List    ${test}    1
-    BuiltIn.Run_Keyword_If    '${response}' == 'ERROR'    Fail    Error getting data: ${message}
-    ${start}=    Collections.Get_From_List    ${test}    1
-    ${stop}=    Collections.Get_From_List    ${test}    2
-    ${ellapsed}=    Collections.Get_From_List    ${test}    3
+    [Arguments]    ${number}
+    ${test} =    SSHLibrary.Read_Until_Regexp    \\n
+    ${test} =    String.Split_String    ${test}    |
+    ${response} =    Collections.Get_From_List    ${test}    0
+    ${message} =    Collections.Get_From_List    ${test}    1
+    IF    '${response}' == 'ERROR'    Fail    Error getting data: ${message}
+    ${start} =    Collections.Get_From_List    ${test}    1
+    ${stop} =    Collections.Get_From_List    ${test}    2
+    ${ellapsed} =    Collections.Get_From_List    ${test}    3
     BuiltIn.Log    DATA REQUEST RESULT: Device=${number} StartTime=${start} StopTime=${stop} EllapsedTime=${ellapsed}
-    ${data}=    Collections.Get_From_List    ${test}    4
-    ${expected}=    Run Keyword If    '${IS_KARAF_APPL}' == 'False'    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
-    ...    ELSE    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
+    ${data} =    Collections.Get_From_List    ${test}    4
+    IF    '${IS_KARAF_APPL}' == 'False'
+        ${expected} =    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    ELSE
+        ${expected} =    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
+    END
     Should Be Equal As Strings    ${data}    ${expected}
 
 Check_Device_Deconfigured
-    [Arguments]    ${current_name}    ${log_response}=True
     [Documentation]    Operation for making sure the device is really deconfigured.
+    [Arguments]    ${current_name}    ${log_response}=True
     KarafKeywords.Log_Message_To_Controller_Karaf    Waiting for device ${current_name} to disappear
-    NetconfKeywords.Wait_Device_Fully_Removed    ${current_name}    period=0.5s    timeout=120s    log_response=${log_response}
+    NetconfKeywords.Wait_Device_Fully_Removed
+    ...    ${current_name}
+    ...    period=0.5s
+    ...    timeout=120s
+    ...    log_response=${log_response}
     KarafKeywords.Log_Message_To_Controller_Karaf    Device ${current_name} removed
 
 Get Juniper Device Schemas
@@ -144,4 +188,4 @@ Get Juniper Device Schemas
     OperatingSystem.Run    find yang/19.4/19.4R1/junos -type f -name '*yang' -exec cp {} /tmp/junos_19.4R1/ \\;
     OperatingSystem.Run    cp yang/19.4/19.4R1/common/* /tmp/junos_19.4R1/
     OperatingSystem.List Directory    /tmp/junos_19.4R1/
-    [Return]    /tmp/junos_19.4R1
+    RETURN    /tmp/junos_19.4R1