Eliminate USE_RFC8040 63/106263/13
authorOleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Tue, 30 May 2023 10:07:37 +0000 (12:07 +0200)
committerSangwook Ha <sangwook.ha@verizon.com>
Thu, 8 Jun 2023 14:35:09 +0000 (14:35 +0000)
We no more need USE_RFC8040 in csit/libraries/Restconf.robot.
Therefore it and all related logic was deleted in this patch.

JIRA: INTTEST-135
Change-Id: Icf2ef4883d07e6e4eab5da41d49bd1e7357686e0
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
csit/libraries/Restconf.robot
csit/suites/netconf/notifications/notifications_basic.robot

index a2118fdd65118d2e3d81b7fb4f02308662f9c74d..abfcc10682af0f32f0a5e6a0dd95012f4ba3be8c 100644 (file)
@@ -1,39 +1,11 @@
-*** Variables ***
-${USE_RFC8040} =    True
-
-
 *** Keywords ***
 Generate URI
-    [Documentation]    Returns the proper URI to use depending on if RFC8040 is to be used or not. Variable input
-    ...    error checking is done to ensure the ${USE_RFC8040} Flag is one of True or False and the ${datastore_flag} variable
-    ...    must be config, operational or rpc. @{node_value_list} is expected to be in the format of node=value. RFC8040 can
-    ...    use that as is with '=' delimiter, but older restconf URI will convert the '=' to a '/'
+    [Documentation]    Returns the proper URI to use. Variable input error checking is done to ensure the ${datastore_flag} variable
+    ...    is config, operational or rpc. @{node_value_list} is expected to be in the format of node=value. RFC8040 can
+    ...    use that as is with '=' delimiter
     [Arguments]    ${identifier}    ${datastore_flag}=config    @{node_value_list}
-    IF    "${USE_RFC8040}" == "True"
-        ${uri} =    Generate RFC8040 URI    ${identifier}    ${datastore_flag}    @{node_value_list}
-    ELSE
-        ${uri} =    Set Variable    ${None}
-    END
-    IF    "${USE_RFC8040}" == "True"    RETURN    ${uri}
-    IF    "${USE_RFC8040}" != "False"
-        Fail    Invalid Value for RFC8040 Flag: ${USE_RFC8040}
-    END
-    IF    "${datastore_flag}"!="config" and "${datastore_flag}"!="operational" and "${datastore_flag}"!="rpc"
-        Fail    Invalid value for datastore: ${datastore_flag}
-    END
-    IF    "${datastore_flag}"=="config"
-        ${uri} =    Set Variable    ${CONFIG_API}/${identifier}
-    ELSE IF    "${datastore_flag}"=="operational"
-        ${uri} =    Set Variable    ${OPERATIONAL_API}/${identifier}
-    ELSE
-        ${uri} =    Set Variable    ${OPERATIONS_API}/${identifier}
-    END
-    ${node_value_path} =    Set Variable    ${EMPTY}
-    FOR    ${nv}    IN    @{node_value_list}
-        ${nv} =    String.Replace String    ${nv}    =    /
-        ${node_value_path} =    Set Variable    ${node_value_path}/${nv}
-    END
-    RETURN    ${uri}${node_value_path}
+    ${uri} =    Generate RFC8040 URI    ${identifier}    ${datastore_flag}    @{node_value_list}
+    RETURN    ${uri}
 
 Generate RFC8040 URI
     [Arguments]    ${identifier}    ${datastore_flag}=config    @{node_value_list}
index 289069385c82c42dd8d4966355f74b6ce71debd7..07fd8cd274e1a7603c5b4ba34f063b9ed743bc22 100644 (file)
@@ -49,15 +49,12 @@ Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If
 
 *** 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
 
 
@@ -79,8 +76,7 @@ Create_DCN_Stream
 Subscribe_To_DCN_Stream
     [Documentation]    Subscribe to DCN streams.
     [Tags]    critical
-    ${uri} =    Set Variable If    "${USE_RFC8040}" == "False"    ${DRAFT_DCN_STREAM_URI}    ${RFC8040_DCN_STREAM_URI}
-    ${resp} =    RequestsLibrary.Get_On_Session    restconf    url=${uri}    headers=${SEND_ACCEPT_XML_HEADERS}
+    ${resp} =    RequestsLibrary.Get_On_Session    restconf    url=${RFC8040_DCN_STREAM_URI}    headers=${SEND_ACCEPT_XML_HEADERS}
     Log_Response    ${resp}
     BuiltIn.Should_Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     ${location} =    XML.Get_Element_Text    ${resp.content}
@@ -92,26 +88,15 @@ 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}
-    ${resp} =    RequestsLibrary.Get_On_Session    restconf    url=${uri}    headers=${SEND_ACCEPT_XML_HEADERS}
+    ${resp} =    RequestsLibrary.Get_On_Session    restconf    url=${RFC8040_DCN_STREAM_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.
-    IF    "${USE_RFC8040}" == "True"
-        BuiltIn.Should_Contain    ${resp.text}    ${NODES_STREAM_PATH}
-    END
+    BuiltIn.Should_Contain    ${resp.text}    ${NODES_STREAM_PATH}
 
 Start_Receiver
     [Documentation]    Start the websocket listener
-    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
+    ${output} =    SSHLibrary.Write    python3 ssereceiver.py --uri ${location} --logfile ${RECEIVER_LOG_FILE}
     BuiltIn.Log    ${output}
     ${output} =    SSHLibrary.Read    delay=2s
     BuiltIn.Log    ${output}
@@ -120,10 +105,7 @@ 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
-    ...    /rests/data/network-topology:network-topology
+    ${uri} =    BuiltIn.Set_Variable    /rests/data/network-topology:network-topology
     ${resp} =    RequestsLibrary.Put_On_Session
     ...    restconf
     ...    ${uri}
@@ -131,10 +113,7 @@ Change_DS_Config
     ...    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
-    ...    /rests/data/network-topology:network-topology/topology=netconf-notif
+    ${uri} =    BuiltIn.Set_Variable    /rests/data/network-topology:network-topology/topology=netconf-notif
     ${resp} =    RequestsLibrary.Delete_On_Session    restconf    ${uri}    headers=${SEND_ACCEPT_XML_HEADERS}
     Log_Response    ${resp}
     BuiltIn.Should_Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}