Replaced NetconfViaRestconf.robot with TemplatedRequests.robot 79/37279/7
authorJozef Behran <jbehran@cisco.com>
Thu, 7 Apr 2016 13:49:20 +0000 (15:49 +0200)
committerVratko Polák <vrpolak@cisco.com>
Wed, 13 Apr 2016 10:41:30 +0000 (10:41 +0000)
NetconfViaRestconf.robot is not compatible with
ClusterManagement.robot and is obsoleted by
TemplatedRequests.robot. The incompatibility problem prevents
easy construction of test suites testing scenarios with node
outages so this outdated piece of code had to be replaced
with the newer (and compatible) piece of code. The change is
quite involved because TemplatedRequests.robot has quite
different API.

Change-Id: Iaa791eab06d1eaaf4d1904f248c57f67a30afc61
Signed-off-by: Jozef Behran <jbehran@cisco.com>
39 files changed:
csit/libraries/ConfigViaRestconf.robot
csit/libraries/NetconfKeywords.robot
csit/libraries/NetconfViaRestconf.robot [deleted file]
csit/suites/netconf/CRUD/CRUD.robot
csit/suites/netconf/clustering/CRUD.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/variables/netconf/CRUD/cars/config.uri [deleted file]
csit/variables/netconf/CRUD/cars/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/cars/post_data.xml [moved from csit/variables/netconf/CRUD/cars/data.xml with 100% similarity]
csit/variables/netconf/CRUD/datamod1/config.uri [deleted file]
csit/variables/netconf/CRUD/datamod1/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/datamod2/config.uri [deleted file]
csit/variables/netconf/CRUD/datamod2/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/datamod3/config.uri [deleted file]
csit/variables/netconf/CRUD/datamod3/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/datamodjson/config.uri [deleted file]
csit/variables/netconf/CRUD/datamodjson/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/dataorig/config.uri [deleted file]
csit/variables/netconf/CRUD/dataorig/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/dataorig/post_data.json [moved from csit/variables/netconf/CRUD/dataorig/data.json with 100% similarity]
csit/variables/netconf/CRUD/dataorig/post_data.xml [moved from csit/variables/netconf/CRUD/dataorig/data.xml with 100% similarity]
csit/variables/netconf/CRUD/item1/config.uri [deleted file]
csit/variables/netconf/CRUD/item1/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/item1/post_data.xml [moved from csit/variables/netconf/CRUD/item1/data.xml with 100% similarity]
csit/variables/netconf/CRUD/item2/config.uri [deleted file]
csit/variables/netconf/CRUD/item2/location.uri [new file with mode: 0644]
csit/variables/netconf/CRUD/item2/post_data.json [moved from csit/variables/netconf/CRUD/item2/data.json with 100% similarity]
csit/variables/netconf/RestPerfClient/cars-delete/config.uri [deleted file]
csit/variables/netconf/RestPerfClient/cars-delete/location.uri [new file with mode: 0644]
csit/variables/netconf/RestPerfClient/cars/config.uri [deleted file]
csit/variables/netconf/RestPerfClient/cars/location.uri [new file with mode: 0644]
csit/variables/netconf/RestPerfClient/cars/post_data.xml [moved from csit/variables/netconf/RestPerfClient/cars/data.xml with 100% similarity]
csit/variables/netconf/device/configure-via-topology/config.uri [deleted file]
csit/variables/netconf/device/configure-via-topology/location.uri [new file with mode: 0644]
csit/variables/netconf/device/default/config.uri [deleted file]
csit/variables/netconf/device/default/location.uri [new file with mode: 0644]

index d0e42945a9c84c24ebfb7bb4353c746fc11e71e1..1c4649e134ef7578bac9afc4cefb88307ab9da80 100644 (file)
@@ -28,9 +28,6 @@ Documentation     Robot keyword library (Resource) for runtime changes to config
 ...               * netconf-connector feature installed on ODL.
 ...               * Setup_Config_Via_Restconf called from suite Setup
 ...               (or before any other call to a keyword from this library) at least once.
-...
-...               FIXME: This module needs merging with NetconfViaRestconf.robot and fixing.
-...               See comments in NetconfViaRestconf.robot for more details.
 Library           OperatingSystem
 Library           RequestsLibrary
 Library           String
index ac76e9e6ac451120ba92b52168cf3893e5c3ccaa..9d9e71367960e973a37f36d4c36eee6d0040327b 100644 (file)
@@ -15,9 +15,9 @@ Library           Collections
 Library           DateTime
 Library           RequestsLibrary
 Library           SSHLibrary
-Resource          NetconfViaRestconf.robot
 Resource          NexusKeywords.robot
 Resource          SSHKeywords.robot
+Resource          TemplatedRequests.robot
 Resource          Utils.robot
 
 *** Variables ***
@@ -31,69 +31,72 @@ ${ENABLE_NETCONF_TEST_TIMEOUT}    ${ENABLE_GLOBAL_TEST_DEADLINES}
 
 *** Keywords ***
 Setup_NetconfKeywords
+    [Arguments]    ${create_session_for_templated_requests}=True
     [Documentation]    Setup the environment for the other keywords of this Resource to work properly.
     ${tmp}=    BuiltIn.Create_Dictionary
     BuiltIn.Set_Suite_Variable    ${NetconfKeywords__mounted_device_types}    ${tmp}
-    NetconfViaRestconf.Setup_Netconf_Via_Restconf
+    BuiltIn.Run_Keyword_If    ${create_session_for_templated_requests}    TemplatedRequests.Create_Default_Session
     NexusKeywords.Initialize_Artifact_Deployment_And_Usage
 
 Configure_Device_In_Netconf
     [Arguments]    ${device_name}    ${device_type}=default    ${device_port}=${FIRST_TESTTOOL_PORT}    ${device_address}=${TOOLS_SYSTEM_IP}    ${device_user}=admin    ${device_password}=topsecret
+    ...    ${session}=default
     [Documentation]    Tell Netconf about the specified device so it can add it into its configuration.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_IP': '${device_address}', 'DEVICE_NAME': '${device_name}', 'DEVICE_PORT': '${device_port}', 'DEVICE_USER': '${device_user}', 'DEVICE_PASSWORD': '${device_password}'}
-    NetconfViaRestconf.Put_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_DEVICE_TEMPLATES}${/}${device_type}    ${template_as_string}
+    TemplatedRequests.Put_As_Xml_Templated    ${DIRECTORY_WITH_DEVICE_TEMPLATES}${/}${device_type}    ${template_as_string}    session=${session}
     Collections.Set_To_Dictionary    ${NetconfKeywords__mounted_device_types}    ${device_name}    ${device_type}
 
 Count_Netconf_Connectors_For_Device
-    [Arguments]    ${device_name}
+    [Arguments]    ${device_name}    ${session}=default
     [Documentation]    Count all instances of the specified device in the Netconf topology (usually 0 or 1).
     # FIXME: This no longer counts netconf connectors, it counts "device instances in Netconf topology".
     # This keyword should be renamed but without an automatic keyword naming standards checker this is
     # potentially destabilizing change so right now it is as FIXME. Proposed new name:
     # Count_Device_Instances_In_Netconf_Topology
-    ${mounts}=    NetconfViaRestconf.Get_Operational_Data_From_URI    network-topology:network-topology/topology/topology-netconf
+    ${mounts}=    TemplatedRequests.Get_As_Json_From_Uri    ${OPERATIONAL_API}/network-topology:network-topology/topology/topology-netconf    session=${session}
     Builtin.Log    ${mounts}
-    ${actual_count}=    Builtin.Evaluate    len('''${mounts}'''.split('"node-id":"${device_name}"'))-1
+    ${actual_count}=    Builtin.Evaluate    len('''${mounts}'''.split('"node-id": "${device_name}"'))-1
     Builtin.Return_From_Keyword    ${actual_count}
 
 Check_Device_Has_No_Netconf_Connector
-    [Arguments]    ${device_name}
+    [Arguments]    ${device_name}    ${session}=default
     [Documentation]    Check that there are no instances of the specified device in the Netconf topology.
     # FIXME: Similarlt to "Count_Netconf_Connectors_For_Device", this does not check whether the device has
     # no netconf connector but whether the device is present in the netconf topology or not. Rename, proposed
     # new name: Check_Device_Not_Present_In_Netconf_Topology
-    ${count}    Count_Netconf_Connectors_For_Device    ${device_name}
+    ${count}    Count_Netconf_Connectors_For_Device    ${device_name}    session=${session}
     Builtin.Should_Be_Equal_As_Strings    ${count}    0
 
 Check_Device_Completely_Gone
-    [Arguments]    ${device_name}
+    [Arguments]    ${device_name}    ${session}=default
     [Documentation]    Check that the specified device has no Netconf connectors nor associated data.
-    Check_Device_Has_No_Netconf_Connector    ${device_name}
-    ${uri}=    Builtin.Set_Variable    network-topology:network-topology/topology/topology-netconf/node/${device_name}
-    ${response}=    RequestsLibrary.Get Request    nvr_session    ${uri}    ${ACCEPT_XML}
-    BuiltIn.Should_Be_Equal_As_Integers    ${response.status_code}    404
+    Check_Device_Has_No_Netconf_Connector    ${device_name}    session=${session}
+    ${uri}=    Builtin.Set_Variable    ${CONFIG_API}/network-topology:network-topology/topology/topology-netconf/node/${device_name}
+    ${status}    ${response}=    BuiltIn.Run_Keyword_And_Ignore_Error    TemplatedRequests.Get_As_Xml_From_Uri    ${uri}    session=${session}
+    BuiltIn.Should_Be_Equal_As_Strings    ${status}    FAIL
+    BuiltIn.Should_Contain    ${response}    404
 
 Check_Device_Connected
-    [Arguments]    ${device_name}
+    [Arguments]    ${device_name}    ${session}=default
     [Documentation]    Check that the specified device is accessible from Netconf.
-    ${device_status}=    NetconfViaRestconf.Get_Operational_Data_From_URI    network-topology:network-topology/topology/topology-netconf/node/${device_name}
-    Builtin.Should_Contain    ${device_status}    "netconf-node-topology:connection-status":"connected"
+    ${device_status}=    TemplatedRequests.Get_As_Json_From_Uri    ${OPERATIONAL_API}/network-topology:network-topology/topology/topology-netconf/node/${device_name}    session=${session}
+    Builtin.Should_Contain    ${device_status}    "netconf-node-topology:connection-status": "connected"
 
 Wait_Device_Connected
-    [Arguments]    ${device_name}    ${timeout}=10s    ${period}=1s
+    [Arguments]    ${device_name}    ${timeout}=10s    ${period}=1s    ${session}=default
     [Documentation]    Wait for the device to become connected.
     ...    It is more readable to use this keyword in a test case than to put the whole WUKS below into it.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${period}    Check_Device_Connected    ${device_name}
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${period}    Check_Device_Connected    ${device_name}    session=${session}
 
 Remove_Device_From_Netconf
-    [Arguments]    ${device_name}
+    [Arguments]    ${device_name}    ${session}=default
     [Documentation]    Tell Netconf to deconfigure the specified device
     ${device_type}=    Collections.Pop_From_Dictionary    ${NetconfKeywords__mounted_device_types}    ${device_name}
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_DEVICE_TEMPLATES}${/}${device_type}    ${template_as_string}
+    TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_DEVICE_TEMPLATES}${/}${device_type}    ${template_as_string}    session=${session}
 
 Wait_Device_Fully_Removed
-    [Arguments]    ${device_name}    ${timeout}=10s    ${period}=1s
+    [Arguments]    ${device_name}    ${timeout}=10s    ${period}=1s    ${session}=default
     [Documentation]    Wait until all netconf connectors for the device with the given name disappear.
     ...    Call of Remove_Device_From_Netconf returns before netconf gets
     ...    around deleting the device's connector. To ensure the device is
@@ -102,7 +105,7 @@ Wait_Device_Fully_Removed
     ...    is not made before using this keyword, the wait will fail.
     ...    Using this keyword is more readable than putting the WUKS below
     ...    into a test case.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${period}    Check_Device_Completely_Gone    ${device_name}
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${period}    Check_Device_Completely_Gone    ${device_name}    session=${session}
 
 NetconfKeywords__Deploy_Additional_Schemas
     [Arguments]    ${schemas}
diff --git a/csit/libraries/NetconfViaRestconf.robot b/csit/libraries/NetconfViaRestconf.robot
deleted file mode 100644 (file)
index 947dd3e..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-*** Settings ***
-Documentation     Access Netconf via Restconf.
-...
-...               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
-...
-...               FIXME: This whole thing needs to be refactored and merged with
-...               "ConfigViaRestconf.robot" which contains nearly identical (or even completely
-...               identical) pieces of code.
-...
-...               FIXME: This module (along with "ConfigViaRestconf.robot") uses the deprecated
-...               "RequestsLibrary.Put" keyword to issue requests to the ODL. Convert these
-...               statements to use "RequestsLibrary.Put_Request" instead. Similarly for
-...               "RequestsLibrary.Post" and "RequestsLibrary.Delete". It might be best to do
-...               this change after the code duplication in these two modules is removed (see
-...               the previous FIXME).
-Library           RequestsLibrary
-Library           OperatingSystem
-Resource          Utils.robot
-
-*** Variables ***
-@{allowed_status_codes}    ${200}    ${201}    ${204}    # List of integers, not strings. Used by both PUT and DELETE.
-
-*** Keywords ***
-FIXME__POLISH_THIS
-    # The following code has a bunch of problems which are very hard to fix in
-    # terms of debugging and review times. Therefore I propose to merge this test
-    # first "as is" and solve the problems of this code in later commits. These
-    # problems were identified so far:
-    #
-    # - Code duplication. The following code is almost identical to what is
-    #    present in ConfigViaRestconf.robot. Fixing this means refactoring
-    #    ConfigViaRestconf.robot to use this library instead of doing
-    #    everything on its own.
-    # - The interface of this code might be too optimized for the needs of
-    #    one test suite. Maybe it should be generalized.
-    # - The Teardown_Netconf_Via_Restconf seems to be incomplete. It is
-    #    supposed to close the session but (as the code suggests in a
-    #    comment), the functionality needed is not implemented.
-    #
-    # Issues identified when trying to make this a library:
-    #
-    # - A better name might be necessary (this actually allows not only
-    #    netconf to be accessed but other restconf accessible subsystems as
-    #    well).
-    # - The ConfigViaRestconf might need to be merged with this code to avoid
-    #    strange name clashes when using both in a suite.
-
-Setup_Netconf_Via_Restconf
-    [Documentation]    Creates a default requests session to be used by subsequent keywords.
-    # Do not append slash at the end uf URL, Requests would add another, resulting in error.
-    Create_NVR_Session    nvr_session    ${ODL_SYSTEM_IP}
-    Activate_NVR_Session    nvr_session
-
-Teardown_Netconf_Via_Restconf
-    [Documentation]    Teardown to pair with Setup (otherwise no-op).
-    BuiltIn.Comment    TODO: The following line does not seem to be implemented by RequestsLibrary. Look for a workaround.
-    BuiltIn.Comment    Delete_Session    nvr_session
-
-Resolve_URI_From_Template_Folder
-    [Arguments]    ${folder}    ${mapping_as_string}
-    [Documentation]    Read URI template from folder, strip endline, make changes according to mapping, return the result.
-    ${uri_template}=    OperatingSystem.Get_File    ${folder}${/}config.uri
-    BuiltIn.Log    ${uri_template}
-    ${uri_part}=    Strip_Endline_And_Apply_Substitutions_From_Mapping    ${uri_template}    ${mapping_as_string}
-    [Return]    ${uri_part}
-
-Resolve_Xml_Data_From_Template_Folder
-    [Arguments]    ${folder}    ${mapping_as_string}
-    [Documentation]    Read data template from folder, strip endline, make changes according to mapping, return the result.
-    ${data_template}=    OperatingSystem.Get_File    ${folder}${/}data.xml
-    BuiltIn.Log    ${data_template}
-    ${xml_data}=    Strip_Endline_And_Apply_Substitutions_From_Mapping    ${data_template}    ${mapping_as_string}
-    [Return]    ${xml_data}
-
-Resolve_Json_Data_From_Template_Folder
-    [Arguments]    ${folder}    ${mapping_as_string}
-    [Documentation]    Read data template from folder, strip endline, make changes according to mapping, return the result.
-    ${data_template}=    OperatingSystem.Get_File    ${folder}${/}data.json
-    BuiltIn.Log    ${data_template}
-    ${json_data}=    Strip_Endline_And_Apply_Substitutions_From_Mapping    ${data_template}    ${mapping_as_string}
-    [Return]    ${json_data}
-
-Strip_Endline_And_Apply_Substitutions_From_Mapping
-    [Arguments]    ${template_as_string}    ${mapping_as_string}
-    [Documentation]    Strip endline, apply substitutions, Log and return the result.
-    # Robot Framework does not understand dictionaries well, so resort to Evaluate.
-    # Needs python module "string", and since the template string is expected to contain newline, it has to be enclosed in triple quotes.
-    # Using rstrip() removes all trailing whitespace, which is what we want if there is something more than an endline.
-    ${final_text}=    BuiltIn.Evaluate    string.Template('''${template_as_string}'''.rstrip()).substitute(${mapping_as_string})    modules=string
-    BuiltIn.Log    ${final_text}
-    [Return]    ${final_text}
-
-Post_Xml_Via_Restconf
-    [Arguments]    ${uri_part}    ${xml_data}
-    [Documentation]    Post XML data to given controller-config URI, check reponse text is empty and status_code is 204.
-    BuiltIn.Log    ${uri_part}
-    BuiltIn.Log    ${xml_data}
-    # As seen in previous two Keywords, Post does not need long specific URI.
-    # But during Lithium development, Post ceased to do merge, so those Keywords do not work anymore.
-    # This Keyword can still be used with specific URI to create a new container and fail if a container was already present.
-    ${response}=    RequestsLibrary.Post Request    ${NetconfViaRestconf__active_config_session}    ${uri_part}    data=${xml_data}
-    BuiltIn.Log    ${response.text}
-    BuiltIn.Should_Be_Empty    ${response.text}
-    BuiltIn.Should_Be_Equal_As_Strings    ${response.status_code}    204
-
-Post_Xml_Template_Folder_Via_Restconf
-    [Arguments]    ${folder}    ${mapping_as_string}={}
-    [Documentation]    Resolve URI and data from folder, POST to restconf.
-    ${uri_part}=    Resolve_URI_From_Template_Folder    ${folder}    ${mapping_as_string}
-    ${xml_data}=    Resolve_Xml_Data_From_Template_Folder    ${folder}    ${mapping_as_string}
-    Post_Xml_Via_Restconf    ${uri_part}    ${xml_data}
-
-Post_Json_Via_Restconf
-    [Arguments]    ${uri_part}    ${json_data}
-    [Documentation]    Post JSON data to given controller-config URI, check reponse text is empty and status_code is 204.
-    BuiltIn.Log    ${uri_part}
-    BuiltIn.Log    ${json_data}
-    # As seen in previous two Keywords, Post does not need long specific URI.
-    # But during Lithium development, Post ceased to do merge, so those Keywords do not work anymore.
-    # This Keyword can still be used with specific URI to create a new container and fail if a container was already present.
-    ${response}=    RequestsLibrary.Post    ${NetconfViaRestconf__active_config_session}    ${uri_part}    data=${json_data}    headers=${HEADERS_YANG_JSON}
-    BuiltIn.Log    ${response.text}
-    BuiltIn.Should_Be_Empty    ${response.text}
-    BuiltIn.Should_Be_Equal_As_Strings    ${response.status_code}    204
-
-Post_Json_Template_Folder_Via_Restconf
-    [Arguments]    ${folder}    ${mapping_as_string}={}
-    [Documentation]    Resolve URI and data from folder, POST to restconf.
-    ${uri_part}=    Resolve_URI_From_Template_Folder    ${folder}    ${mapping_as_string}
-    ${json_data}=    Resolve_Json_Data_From_Template_Folder    ${folder}    ${mapping_as_string}
-    Post_Json_Via_Restconf    ${uri_part}    ${json_data}
-
-Put_Xml_Via_Restconf
-    [Arguments]    ${uri_part}    ${xml_data}
-    [Documentation]    Put XML data to given controller-config URI, check reponse text is empty and status_code is one of allowed ones.
-    BuiltIn.Log    ${uri_part}
-    BuiltIn.Log    ${xml_data}
-    ${response}=    RequestsLibrary.Put Request    ${NetconfViaRestconf__active_config_session}    ${uri_part}    data=${xml_data}
-    BuiltIn.Log    ${response.text}
-    BuiltIn.Log    ${response.status_code}
-    BuiltIn.Should_Be_Empty    ${response.text}
-    BuiltIn.Should_Contain    ${allowed_status_codes}    ${response.status_code}
-
-Put_Xml_Template_Folder_Via_Restconf
-    [Arguments]    ${folder}    ${mapping_as_string}={}
-    [Documentation]    Resolve URI and data from folder, PUT to controller config.
-    ${uri_part}=    Resolve_URI_From_Template_Folder    ${folder}    ${mapping_as_string}
-    ${xml_data}=    Resolve_Xml_Data_From_Template_Folder    ${folder}    ${mapping_as_string}
-    Put_Xml_Via_Restconf    ${uri_part}    ${xml_data}
-
-Put_Json_Via_Restconf
-    [Arguments]    ${uri_part}    ${json_data}
-    [Documentation]    Put JSON data to given controller-config URI, check reponse text is empty and status_code is one of allowed ones.
-    BuiltIn.Log    ${uri_part}
-    BuiltIn.Log    ${json_data}
-    ${response}=    RequestsLibrary.Put Request    ${NetconfViaRestconf__active_config_session}    ${uri_part}    data=${json_data}    headers=${HEADERS_YANG_JSON}
-    BuiltIn.Log    ${response.text}
-    BuiltIn.Log    ${response.status_code}
-    BuiltIn.Should_Be_Empty    ${response.text}
-    BuiltIn.Should_Contain    ${allowed_status_codes}    ${response.status_code}
-
-Put_Json_Template_Folder_Via_Restconf
-    [Arguments]    ${folder}    ${mapping_as_string}={}
-    [Documentation]    Resolve URI and data from folder, PUT to controller config.
-    ${uri_part}=    Resolve_URI_From_Template_Folder    ${folder}    ${mapping_as_string}
-    ${json_data}=    Resolve_Json_Data_From_Template_Folder    ${folder}    ${mapping_as_string}
-    Put_Json_Via_Restconf    ${uri_part}    ${json_data}
-
-Delete_Via_Restconf
-    [Arguments]    ${uri_part}
-    [Documentation]    Delete resource at controller-config URI, check reponse text is empty and status_code is 204.
-    BuiltIn.Log    ${uri_part}
-    ${response}=    RequestsLibrary.Delete Request    ${NetconfViaRestconf__active_config_session}    ${uri_part}
-    BuiltIn.Log    ${response.text}
-    BuiltIn.Should_Be_Empty    ${response.text}
-    BuiltIn.Should_Contain    ${allowed_status_codes}    ${response.status_code}
-
-Delete_Xml_Template_Folder_Via_Restconf
-    [Arguments]    ${folder}    ${mapping_as_string}={}
-    [Documentation]    Resolve URI from folder, DELETE from controller config.
-    ${uri_part}=    Resolve_URI_From_Template_Folder    ${folder}    ${mapping_as_string}
-    Delete_Via_Restconf    ${uri_part}
-
-Create_NVR_Session
-    [Arguments]    ${name}    ${host}
-    [Documentation]    Create a Netconf Via Restconf session pointing to the given host with the given name. The new session is NOT made active.
-    RequestsLibrary.Create_Session    ${name}    http://${host}:${RESTCONFPORT}${CONFIG_API}    headers=${HEADERS_XML}    auth=${AUTH}
-    RequestsLibrary.Create_Session    ${name}_operational    http://${host}:${RESTCONFPORT}${OPERATIONAL_API}    headers=${HEADERS_XML}    auth=${AUTH}
-
-Get_Active_NVR_Session
-    [Documentation]    Get the name of the currently active NVR session.
-    [Return]    ${NetconfViaRestconf__active_config_session}
-
-Activate_NVR_Session
-    [Arguments]    ${name}
-    [Documentation]    Activate the given NVR session.
-    BuiltIn.Set_Suite_Variable    ${NetconfViaRestconf__active_config_session}    ${name}
-    BuiltIn.Set_Suite_Variable    ${NetconfViaRestconf__active_operational_session}    ${name}_operational
-
-Get_Config_Data_From_URI
-    [Arguments]    ${uri}    ${headers}=${NONE}
-    ${data}=    Utils.Get_Data_From_URI    ${NetconfViaRestconf__active_config_session}    ${uri}    ${headers}
-    [Return]    ${data}
-
-Get_Operational_Data_From_URI
-    [Arguments]    ${uri}    ${headers}=${NONE}
-    ${data}=    Utils.Get_Data_From_URI    ${NetconfViaRestconf__active_operational_session}    ${uri}    ${headers}
-    [Return]    ${data}
index 79503abf4c849fe0d311ef0df575be97ec2f4419..eb1f605fd10c41165916fa6da81e7f9d6ccdf7f9 100644 (file)
@@ -27,8 +27,8 @@ Library           SSHLibrary    timeout=10s
 Resource          ${CURDIR}/../../../libraries/FailFast.robot
 Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfViaRestconf.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../../libraries/Utils.robot
 Variables         ${CURDIR}/../../../variables/Variables.py
 
@@ -68,7 +68,7 @@ Check_Device_Data_Is_Empty
 Create_Device_Data_Label_Via_Xml
     [Documentation]    Send a sample test data label into the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}dataorig    ${template_as_string}
+    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}dataorig    ${template_as_string}
 
 Check_Device_Data_Label_Is_Created
     [Documentation]    Get the device data label and make sure it contains the created content.
@@ -77,7 +77,7 @@ Check_Device_Data_Label_Is_Created
 Modify_Device_Data_Label_Via_Xml
     [Documentation]    Send a request to change the sample test data label and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Put_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
+    TemplatedRequests.Put_As_Xml_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
 
 Check_Device_Data_Label_Is_Modified
     [Documentation]    Get the device data label and make sure it contains the modified content.
@@ -113,7 +113,7 @@ Check_Modified_Device_Data_Is_Still_There
 Modify_Device_Data_Again
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Put_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}datamod2    ${template_as_string}
+    TemplatedRequests.Put_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}datamod2    ${template_as_string}
 
 Check_Device_Data_Is_Modified_Again
     [Documentation]    Get the device data and make sure it contains the created content.
@@ -122,7 +122,7 @@ Check_Device_Data_Is_Modified_Again
 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.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Put_Json_Template_Folder_Via_Restconf    ${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.
@@ -131,7 +131,7 @@ Check_Device_Data_Label_Is_Modified_Via_Json
 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.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}cars    ${template_as_string}
+    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}cars    ${template_as_string}
 
 Check_Car_List_Created
     [Documentation]    Get the device data label as XML and make sure it matches the content posted as JSON in the previous case.
@@ -151,7 +151,7 @@ Check_Car_List_Created
 Add_Device_Data_Item_1_Via_XML_Post
     [Documentation]    Send a request to create a data item in the test list and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}item1    ${template_as_string}
+    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_template_folders}${/}item1    ${template_as_string}
 
 Check_Item1_Is_Created
     [Documentation]    Get the device data as XML and make sure it matches the content posted as JSON in the previous case.
@@ -170,7 +170,7 @@ Check_Item1_Is_Created
 Add_Device_Data_Item_2_Via_JSON_Post
     [Documentation]    Send a JSON request to change the sample test data and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Post_Json_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}item2    ${template_as_string}
+    TemplatedRequests.Post_As_Json_Templated    ${directory_with_template_folders}${/}item2    ${template_as_string}
 
 Check_Item2_Is_Created
     [Documentation]    Get the device data as XML and make sure it matches the content posted as JSON in the previous case.
@@ -189,8 +189,8 @@ Check_Item2_Is_Created
 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.Set_Variable    {'DEVICE_NAME': '${device_name}'}
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}item1    ${template_as_string}
+    TemplatedRequests.Delete_Templated    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
+    TemplatedRequests.Delete_Templated    ${directory_with_template_folders}${/}item1    ${template_as_string}
 
 Check_Device_Data_Is_Deleted
     [Documentation]    Get the device data and make sure it is empty again.
@@ -224,14 +224,13 @@ Setup_Everything
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     BuiltIn.Run_Keyword_And_Ignore_Error    NetconfKeywords.Stop_Testtool
 
 Get_Config_Data
     [Documentation]    Get and return the config data from the device.
-    ${url}=    Builtin.Set_Variable    network-topology:network-topology/topology/topology-netconf/node/${device_name}/yang-ext:mount
-    ${data}=    Utils.Get_Data_From_URI    nvr_session    ${url}    headers=${ACCEPT_XML}
+    ${url}=    Builtin.Set_Variable    ${CONFIG_API}/network-topology:network-topology/topology/topology-netconf/node/${device_name}/yang-ext:mount
+    ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}
     [Return]    ${data}
 
 Check_Config_Data
index 347ff48538f428241edbd88eef0f1cc9293dee32..d23fc6d3441bd5c6b24996a6adc05f2ee77109d0 100644 (file)
@@ -43,8 +43,8 @@ Library           SSHLibrary    timeout=10s
 Resource          ${CURDIR}/../../../libraries/FailFast.robot
 Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfViaRestconf.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../../libraries/Utils.robot
 Variables         ${CURDIR}/../../../variables/Variables.py
 
@@ -67,36 +67,30 @@ Start_Testtool
 Check_Device_Is_Not_Mounted_At_Beginning
     [Documentation]    Sanity check making sure our device is not there. Fail if found.
     [Tags]    critical
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    NetconfKeywords.Check_Device_Has_No_Netconf_Connector    ${DEVICE_NAME}
+    NetconfKeywords.Check_Device_Has_No_Netconf_Connector    ${DEVICE_NAME}    session=${NODE_CONFIGURER}
 
 Configure_Device_On_Netconf
     [Documentation]    Make request to configure a testtool device on Netconf connector
     [Tags]    critical
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    NetconfKeywords.Configure_Device_In_Netconf    ${DEVICE_NAME}    device_type=configure-via-topology
+    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
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEVICE_CHECK_TIMEOUT}    1s    Check_Device_Instance_Count    1
+    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.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}    session=${NODE_CONFIGURER}
 
 Wait_For_Device_To_Become_Visible_For_Checker
     [Documentation]    Wait until the device becomes visible on checker node.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CHECKER}
-    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}    session=${NODE_CHECKER}
 
 Wait_For_Device_To_Become_Visible_For_Setter
     [Documentation]    Wait until the device becomes visible on setter node.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_SETTER}
-    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Connected    ${DEVICE_NAME}    session=${NODE_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.
@@ -112,9 +106,8 @@ Check_Device_Data_Is_Seen_As_Empty_On_Setter
 
 Create_Device_Data
     [Documentation]    Send some sample test data into the device and check that the request went OK.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_SETTER}
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${DEVICE_NAME}'}
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}dataorig    ${template_as_string}
+    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.
@@ -130,9 +123,8 @@ Check_New_Device_Data_Is_Visible_On_Configurer
 
 Modify_Device_Data
     [Documentation]    Send a request to change the sample test data and check that the request went OK.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_SETTER}
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${DEVICE_NAME}'}
-    NetconfViaRestconf.Put_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
+    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
@@ -152,9 +144,8 @@ 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.
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_SETTER}
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${DEVICE_NAME}'}
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${directory_with_template_folders}${/}datamod1    ${template_as_string}
+    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
@@ -176,8 +167,7 @@ Deconfigure_Device_In_Netconf
     [Documentation]    Make request to deconfigure the device on Netconf connector.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    NetconfKeywords.Remove_Device_From_Netconf    ${DEVICE_NAME}
+    NetconfKeywords.Remove_Device_From_Netconf    ${DEVICE_NAME}    session=${NODE_CONFIGURER}
 
 Check_Device_Deconfigured_On_Configurer
     [Documentation]    Check that the device is really going to be gone. Fail if still there after one minute.
@@ -186,46 +176,41 @@ Check_Device_Deconfigured_On_Configurer
     ...    data once completed. This test makes sure this asynchronous operation does not take
     ...    unreasonable amount of time.
     [Tags]    critical
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CONFIGURER}
-    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${NODE_CONFIGURER}
 
 Check_Device_Deconfigured_On_Checker
     [Documentation]    Check that the device is going to be gone from the checker node. Fail if still there after one minute.
     [Tags]    critical
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_CHECKER}
-    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${NODE_CHECKER}
 
 Check_Device_Deconfigured_On_Setter
     [Documentation]    Check that the device is going to be gone from the setter node. Fail if still there after one minute.
     [Tags]    critical
-    NetconfViaRestconf.Activate_NVR_Session    ${NODE_SETTER}
-    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}
+    NetconfKeywords.Wait_Device_Fully_Removed    ${DEVICE_NAME}    session=${NODE_SETTER}
 
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    NetconfKeywords.Setup_Netconf_Keywords
-    NetconfViaRestconf.Create_NVR_Session    node1    ${ODL_SYSTEM_1_IP}
-    NetconfViaRestconf.Create_NVR_Session    node2    ${ODL_SYSTEM_2_IP}
-    NetconfViaRestconf.Create_NVR_Session    node3    ${ODL_SYSTEM_3_IP}
+    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}
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     NetconfKeywords.Stop_Testtool
 
 Check_Device_Instance_Count
-    [Arguments]    ${expected}
-    ${count}    NetconfKeywords.Count_Netconf_Connectors_For_Device    ${DEVICE_NAME}
+    [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
-    NetconfViaRestconf.Activate_NVR_Session    ${node}
-    ${url}=    Builtin.Set_Variable    network-topology:network-topology/topology/topology-netconf/node/${DEVICE_NAME}/yang-ext:mount
-    ${data}=    NetconfViaRestconf.Get_Config_Data_From_URI    ${url}    headers=${ACCEPT_XML}
+    ${url}=    Builtin.Set_Variable    ${CONFIG_API}/network-topology:network-topology/topology/topology-netconf/node/${DEVICE_NAME}/yang-ext:mount
+    ${data}=    TemplatedRequests.Get_As_Xml_From_Uri    ${url}    session=${node}
     BuiltIn.Run_Keyword_Unless    ${contains}    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
     BuiltIn.Run_Keyword_If    ${contains}    BuiltIn.Should_Contain    ${data}    ${expected}
index 8b098b6a9eebf1ba011db2a76f1898d64c12dfe2..5574fbd7a27eb19d82c7f10a96310f1a5bfb114e 100644 (file)
@@ -24,10 +24,10 @@ Library           RequestsLibrary
 Library           OperatingSystem
 Library           SSHLibrary    timeout=10s
 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfViaRestconf.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
 
@@ -38,7 +38,7 @@ ${REQUEST_COUNT}    65536
 *** Test Cases ***
 Create_Test_Data_For_Direct_Access
     [Documentation]    Send some sample test data into the device and check that the request went OK.
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
+    TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
 
 Run_RestPerfClient_Directly_On_MDSAL
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the MDSAL via Restconf.
@@ -62,12 +62,12 @@ Cleanup_And_Collect_For_Direct_Access
     [Documentation]    Cleanup the test data produced by the direct MDSAL access.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     RestPerfClient.Collect_From_Restperfclient
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
+    TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
 
 Create_Test_Data_For_Connector_Access
     [Documentation]    Create the test data container again so it is ready for the netconf connector test.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
+    TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
 
 Configure_ODL_As_A_Device_On_Netconf
     [Documentation]    Configure ODL MDSAL Northbound as a Netconf device on a Netconf connector.
@@ -103,7 +103,7 @@ Cleanup_And_Collect_For_Connector_Access
     [Documentation]    Delete the test data produced by the Netconf connector MDSAL access.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     RestPerfClient.Collect_From_Restperfclient
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
+    TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
 
 *** Keywords ***
 Setup_Everything
@@ -120,6 +120,5 @@ Setup_Everything
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     RestPerfClient.Teardown_Restperfclient
index 9185e91622a1f4559afc2d653186db07f1db8721..115b3a582cf7d4c6f944ca3b95f3edf7eae74180 100644 (file)
@@ -26,10 +26,10 @@ Library           String
 Library           SSHLibrary    timeout=10s
 Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfViaRestconf.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
 
@@ -56,7 +56,7 @@ Wait_For_Device_To_Become_Connected
 Create_Device_Data
     [Documentation]    Send some sample test data into the device and check that the request went OK.
     ${template_as_string}=    BuiltIn.Set_Variable    {'DEVICE_NAME': '${DEVICE_NAME}'}
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${directory_with_crud_templates}${/}cars    ${template_as_string}
+    TemplatedRequests.Post_As_Xml_Templated    ${directory_with_crud_templates}${/}cars    ${template_as_string}
 
 Run_Restperfclient
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the netconf connector of the device.
@@ -97,7 +97,6 @@ Setup_Everything
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     RestPerfClient.Teardown_Restperfclient
     SSHLibrary.Switch_Connection    ${testtool}
index 6e4e8ba095b44306da93a9e1a66ea658d9f328a8..ff792c2a60e107c9050062be12a0ae738a0e5599 100644 (file)
@@ -84,7 +84,6 @@ Setup_Everything
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     NetconfKeywords.Stop_Testtool
 
index ac9186cdef48178c6b5b2b0a3c232bff64946c7a..03733b946fef156d47ae91cce3931dc0cd93b081 100644 (file)
@@ -62,7 +62,6 @@ Setup_Everything
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     NetconfKeywords.Stop_Testtool
 
diff --git a/csit/variables/netconf/CRUD/cars/config.uri b/csit/variables/netconf/CRUD/cars/config.uri
deleted file mode 100644 (file)
index e06ec93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount
diff --git a/csit/variables/netconf/CRUD/cars/location.uri b/csit/variables/netconf/CRUD/cars/location.uri
new file mode 100644 (file)
index 0000000..178b4a9
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount
diff --git a/csit/variables/netconf/CRUD/datamod1/config.uri b/csit/variables/netconf/CRUD/datamod1/config.uri
deleted file mode 100644 (file)
index 41fb71a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamod1/location.uri b/csit/variables/netconf/CRUD/datamod1/location.uri
new file mode 100644 (file)
index 0000000..08a49b2
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamod2/config.uri b/csit/variables/netconf/CRUD/datamod2/config.uri
deleted file mode 100644 (file)
index 41fb71a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamod2/location.uri b/csit/variables/netconf/CRUD/datamod2/location.uri
new file mode 100644 (file)
index 0000000..08a49b2
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamod3/config.uri b/csit/variables/netconf/CRUD/datamod3/config.uri
deleted file mode 100644 (file)
index 41fb71a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamod3/location.uri b/csit/variables/netconf/CRUD/datamod3/location.uri
new file mode 100644 (file)
index 0000000..08a49b2
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamodjson/config.uri b/csit/variables/netconf/CRUD/datamodjson/config.uri
deleted file mode 100644 (file)
index 41fb71a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/datamodjson/location.uri b/csit/variables/netconf/CRUD/datamodjson/location.uri
new file mode 100644 (file)
index 0000000..08a49b2
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/test:cont
diff --git a/csit/variables/netconf/CRUD/dataorig/config.uri b/csit/variables/netconf/CRUD/dataorig/config.uri
deleted file mode 100644 (file)
index e06ec93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount
diff --git a/csit/variables/netconf/CRUD/dataorig/location.uri b/csit/variables/netconf/CRUD/dataorig/location.uri
new file mode 100644 (file)
index 0000000..178b4a9
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount
diff --git a/csit/variables/netconf/CRUD/item1/config.uri b/csit/variables/netconf/CRUD/item1/config.uri
deleted file mode 100644 (file)
index bca9d0c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/car:cars
diff --git a/csit/variables/netconf/CRUD/item1/location.uri b/csit/variables/netconf/CRUD/item1/location.uri
new file mode 100644 (file)
index 0000000..648baed
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/car:cars
diff --git a/csit/variables/netconf/CRUD/item2/config.uri b/csit/variables/netconf/CRUD/item2/config.uri
deleted file mode 100644 (file)
index bca9d0c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/car:cars
diff --git a/csit/variables/netconf/CRUD/item2/location.uri b/csit/variables/netconf/CRUD/item2/location.uri
new file mode 100644 (file)
index 0000000..648baed
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/car:cars
diff --git a/csit/variables/netconf/RestPerfClient/cars-delete/config.uri b/csit/variables/netconf/RestPerfClient/cars-delete/config.uri
deleted file mode 100644 (file)
index 70fb5e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-car:cars
diff --git a/csit/variables/netconf/RestPerfClient/cars-delete/location.uri b/csit/variables/netconf/RestPerfClient/cars-delete/location.uri
new file mode 100644 (file)
index 0000000..09038c8
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/car:cars
diff --git a/csit/variables/netconf/RestPerfClient/cars/config.uri b/csit/variables/netconf/RestPerfClient/cars/config.uri
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/csit/variables/netconf/RestPerfClient/cars/location.uri b/csit/variables/netconf/RestPerfClient/cars/location.uri
new file mode 100644 (file)
index 0000000..b0220ee
--- /dev/null
@@ -0,0 +1 @@
+restconf/config
diff --git a/csit/variables/netconf/device/configure-via-topology/config.uri b/csit/variables/netconf/device/configure-via-topology/config.uri
deleted file mode 100644 (file)
index 2b44517..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME
diff --git a/csit/variables/netconf/device/configure-via-topology/location.uri b/csit/variables/netconf/device/configure-via-topology/location.uri
new file mode 100644 (file)
index 0000000..cbacc69
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME
diff --git a/csit/variables/netconf/device/default/config.uri b/csit/variables/netconf/device/default/config.uri
deleted file mode 100644 (file)
index 141d8ed..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/$DEVICE_NAME
diff --git a/csit/variables/netconf/device/default/location.uri b/csit/variables/netconf/device/default/location.uri
new file mode 100644 (file)
index 0000000..b35eb85
--- /dev/null
@@ -0,0 +1 @@
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/$DEVICE_NAME