*** 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
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.
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
[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.
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}