Replace Bierman02 with RFC8040 for OpenFlow Plugin 58/97658/31
authorSangwook Ha <sangwook.ha@verizon.com>
Tue, 28 Sep 2021 01:50:12 +0000 (18:50 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Sun, 21 Nov 2021 21:43:23 +0000 (21:43 +0000)
Create new variables for RFC8040 topology & inventory API URLs
for OpenFlow Plugin test suites and replace RESTCONF APIs
based on Bierman02 with the ones for RFC8040.

Some of the common libraries in 'csit/libraries' used by OpenFlow
Plugin test suites are also updated. This requires additional
changes in other test suites using the updated libraries.

HEADERS_YANG_JSON variable is temporarily changed from
'application/yang.data+json' to 'application/json' to make
it compatible for both Bierman02 & RFC8040 - the former
is not accepted by RFC8040 URLs.

Add a step to break out of request loop in ScaleClient.py
if there are many request timeout exceptions (more than 10)
and a step to check if there is RuntimeException in the
controller log after checking NPE in WorflowsOpenFlow.robot
and WorflowsL2switch.robot - using RFC8040 triggered
RuntimeException because of the circuit breaker timeout
issue (CONTROLLER-2026) making overall test fail to complete
(or take too long).

Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Sandhiya Selvaraj <sandhiya.selvaraj@verizon.com>
Change-Id: I25625598e5eb7aedac7d5a0b536af8ac26a9ebf7

61 files changed:
csit/libraries/BulkomaticKeywords.robot
csit/libraries/ClusterManagement.robot
csit/libraries/ClusterOpenFlow.robot
csit/libraries/DIDMKeywords.robot
csit/libraries/DataModels.robot
csit/libraries/FlowLib.robot
csit/libraries/OpenStackOperations.robot
csit/libraries/ScaleClient.py
csit/libraries/Utils.robot
csit/libraries/VsctlListParser.py
csit/libraries/WorkflowsL2switch.robot
csit/libraries/WorkflowsOpenFlow.robot
csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.robot
csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.robot
csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.robot
csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.robot
csit/suites/openflowplugin/Bug_Validation/6917.robot
csit/suites/openflowplugin/Bug_Validation/7258.robot
csit/suites/openflowplugin/Bug_Validation/7335.robot
csit/suites/openflowplugin/Bug_Validation/7349.robot
csit/suites/openflowplugin/Bug_Validation/8723.robot
csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot
csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot
csit/suites/openflowplugin/EntityOwnership/030_Cluster_Sync_Problems.robot
csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot
csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot
csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot
csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot
csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot
csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot
csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot
csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot
csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot
csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot
csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot
csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/010_restconf_inventory.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/030_restconf_statistics.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/010_restconf_inventory.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/030_restconf_statistics.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot
csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot
csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot
csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot
csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot
csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot
csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot
csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot
csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot
csit/suites/openflowplugin/Performance_Restconf/100K_Flows_100DPN_1Node_Perf_Test.robot
csit/suites/openflowplugin/Performance_Restconf/100K_Flows_100DPN_3Node_Cluster_Perf_Test.robot
csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot
csit/suites/openflowplugin/Sanity3Node/010__Flows_OF13_Cluster.robot
csit/suites/openflowplugin/Switch_Qualification/010_OpenFlow_Connection.robot
csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.robot
csit/variables/Variables.py
csit/variables/Variables.robot
csit/variables/openflowplugin/Variables.robot [new file with mode: 0644]

index 8bb88644730746cef06f9809f33910b120c79bfc..6b37c65d4d293a83d875fd8cbba9c6029f79b4c0 100644 (file)
@@ -6,9 +6,9 @@ Resource          Utils.robot
 Variables         ../variables/Variables.py
 
 *** Variables ***
-${ADD_BULK_CONFIG_NODES_API}    /restconf/operations/sal-bulk-flow:flow-test
-${GET_BULK_CONFIG_NODES_API}    /restconf/operations/sal-bulk-flow:read-flow-test
-${ADD_TABLE_NODEs_API}    /restconf/operations/sal-bulk-flow:table-test
+${ADD_BULK_CONFIG_NODES_API}    /rests/operations/sal-bulk-flow:flow-test
+${GET_BULK_CONFIG_NODES_API}    /rests/operations/sal-bulk-flow:read-flow-test
+${ADD_TABLE_NODEs_API}    /rests/operations/sal-bulk-flow:table-test
 ${jolokia_write_op_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
 ${jolokia_read_op_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
 ${jolokia_flow_count_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
index 7a9d2a82a0985acdc502dd78cf49397f8a6114e3..77da92ab61c5add50d5621e63a0b443b2b06fcbf 100644 (file)
@@ -41,7 +41,6 @@ Resource          ${CURDIR}/Utils.robot    # for Run_Command_On_Controller
 Resource          ../variables/Variables.robot
 
 *** Variables ***
-${ENTITY_OWNER_URI}    restconf/operational/entity-owners:entity-owners
 ${RESTCONF_URI}    rests
 ${GC_LOG_PATH}    ${KARAF_HOME}/data/log
 ${JAVA_HOME}      ${EMPTY}    # releng/builder scripts should provide correct value
@@ -675,6 +674,15 @@ Put_As_Json_And_Check_Member_List_Or_All
     Wait Until Keyword Succeeds    5s    1s    Check_Json_Member_List_Or_All    uri=${uri}    expected_data=${data}    member_index_list=${member_index_list}
     [Return]    ${response_text}
 
+Put_As_Json_And_Check_Member_List_Or_All_RFC8040
+    # FIXME: merge this keyword with Bierman02 version above when OVSDB test is migrated to RFC8040
+    [Arguments]    ${uri}    ${data}    ${member_index}    ${member_index_list}=${EMPTY}
+    [Documentation]    Send a PUT with the supplied uri ${uri} and body ${data} to member ${member_index}.
+    ...    Then check data is replicated in all or some members defined in ${member_index_list}.
+    ${response_text} =    Put_As_Json_To_Member    uri=${uri}    data=${data}    member_index=${member_index}
+    Wait Until Keyword Succeeds    5s    1s    Check_Json_Member_List_Or_All    uri=${uri}?content=config    expected_data=${data}    member_index_list=${member_index_list}
+    [Return]    ${response_text}
+
 Put_As_Json_To_Member
     [Arguments]    ${uri}    ${data}    ${member_index}
     [Documentation]    Send a PUT with the supplied uri and data to member ${member_index}.
index ac214ecefac2fea1bb21ecc24ad98f2cb6f6b40b..38c034494a34091b7be1896511bbadd8e512804f 100644 (file)
@@ -8,13 +8,14 @@ Resource          CompareStream.robot
 Resource          MininetKeywords.robot
 Resource          Utils.robot
 Variables         ../variables/Variables.py
+Resource          ../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 @{SHARD_OPER_LIST}    inventory    topology    default    entity-ownership
 @{SHARD_CONF_LIST}    inventory    topology    default
-${config_table_0}    ${CONFIG_NODES_API}/node/openflow:1/table/0
-${operational_table_0}    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0
-${operational_port_1}    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1
+${config_table_0}    ${RFC8040_NODES_API}/node=openflow%3A1/table=0
+${operational_table_0}    ${RFC8040_NODES_API}/node=openflow%3A1/table=0?${RFC8040_OPERATIONAL_CONTENT}
+${operational_port_1}    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
 
 *** Keywords ***
 Get InventoryConfig Shard Status
@@ -57,7 +58,7 @@ Check OpenFlow Network Operational Information For Sample Topology
     ...    Inventory should show 1x node_id per device 1x node_id per connector. Topology should show 2x node_id per device + 3x node_id per connector
     ...    + 5x node_id per link termination. TODO: A Keyword that can calculate this based on mininet topology.
     ${dictionary}    Create Dictionary    openflow:1=4    openflow:2=5    openflow:3=5
-    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${OPERATIONAL_NODES_API}    dictionary=${dictionary}    member_index_list=${controller_index_list}
+    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${RFC8040_OPERATIONAL_NODES_API}    dictionary=${dictionary}    member_index_list=${controller_index_list}
     ${dictionary}    Create Dictionary    openflow:1=21    openflow:2=19    openflow:3=19
     Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${OPERATIONAL_TOPO_API}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
@@ -65,11 +66,11 @@ Check No OpenFlow Network Operational Information
     [Arguments]    ${controller_index_list}=${EMPTY}
     [Documentation]    Check device is not in operational inventory or topology in all cluster instances in ${controller_index_list}.
     ${dictionary}    Create Dictionary    openflow=0
-    CompareStream.Run_Keyword_If_At_Least_Neon    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_No_Content_Member_List_Or_All    uri=${OPERATIONAL_NODES_API}    member_index_list=${controller_index_list}
-    CompareStream.Run_Keyword_If_At_Most_Fluorine    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${OPERATIONAL_NODES_API}    dictionary=${dictionary}
+    CompareStream.Run_Keyword_If_At_Least_Neon    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_No_Content_Member_List_Or_All    uri=${RFC8040_OPERATIONAL_NODES_API}    member_index_list=${controller_index_list}
+    CompareStream.Run_Keyword_If_At_Most_Fluorine    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${RFC8040_OPERATIONAL_NODES_API}    dictionary=${dictionary}
     ...    member_index_list=${controller_index_list}
     ${dictionary}    Create Dictionary    openflow=0
-    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${OPERATIONAL_TOPO_API}    dictionary=${dictionary}    member_index_list=${controller_index_list}
+    Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${RFC8040_OPERATIONAL_TOPO_API}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Add Sample Flow And Verify
     [Arguments]    ${controller_index}    ${controller_index_list}=${EMPTY}
@@ -79,7 +80,7 @@ Add Sample Flow And Verify
     # replicating some of the matches in the flows section. Same comment applies for further keywords.
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'helium'    Set Test Variable    &{dictionary}    10.0.1.0/24=2    "output-node-connector":"1"=1
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'lithium'    Set Test Variable    &{dictionary}    10.0.1.0/24=1    "output-node-connector":"1"=1
-    ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All    ${config_table_0}/flow/1    ${body}    ${controller_index}    ${controller_index_list}
+    ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All_RFC8040    ${config_table_0}/flow=1    ${body}    ${controller_index}    ${controller_index_list}
     Wait Until Keyword Succeeds    15s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${operational_table_0}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Verify Sample Flow
@@ -97,14 +98,14 @@ Modify Sample Flow And Verify
     ${body}=    OperatingSystem.Get File    ${CURDIR}/../variables/openflowplugin/sample_flow_2.json
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'helium'    Set Test Variable    &{dictionary}    10.0.1.0/24=2    "output-node-connector":"2"=1
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'lithium'    Set Test Variable    &{dictionary}    10.0.1.0/24=1    "output-node-connector":"2"=1
-    ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All    ${config_table_0}/flow/1    ${body}    ${controller_index}    ${controller_index_list}
+    ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All_RFC8040    ${config_table_0}/flow=1    ${body}    ${controller_index}    ${controller_index_list}
     Wait Until Keyword Succeeds    15s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${operational_table_0}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Delete Sample Flow And Verify
     [Arguments]    ${controller_index}    ${controller_index_list}=${EMPTY}
     [Documentation]    Delete sample flow in Owner and verify it gets removed from all instances.
     ${dictionary}=    Create Dictionary    10.0.1.0/24=0
-    ClusterManagement.Delete_And_Check_Member_List_Or_All    ${config_table_0}/flow/1    ${controller_index}    ${controller_index_list}
+    ClusterManagement.Delete_And_Check_Member_List_Or_All    ${config_table_0}/flow=1    ${controller_index}    ${controller_index_list}
     Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${operational_table_0}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Send RPC Add Sample Flow And Verify
@@ -113,7 +114,7 @@ Send RPC Add Sample Flow And Verify
     ${body}=    OperatingSystem.Get File    ${CURDIR}/../variables/openflowplugin/add_flow_rpc.json
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'helium'    Set Test Variable    &{dictionary}    10.0.1.0/24=2
     Run Keyword If    '${ODL_OF_PLUGIN}' == 'lithium'    Set Test Variable    &{dictionary}    10.0.1.0/24=1
-    ClusterManagement.Post_As_Json_To_Member    uri=/restconf/operations/sal-flow:add-flow    data=${body}    member_index=${controller_index}
+    ClusterManagement.Post_As_Json_To_Member    uri=/rests/operations/sal-flow:add-flow    data=${body}    member_index=${controller_index}
     Wait Until Keyword Succeeds    15s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${operational_table_0}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Send RPC Delete Sample Flow And Verify
@@ -121,7 +122,7 @@ Send RPC Delete Sample Flow And Verify
     [Documentation]    Delete sample flow in ${controller_index} and verify it gets removed from all instances in ${controller_index_list}.
     ${body}=    OperatingSystem.Get File    ${CURDIR}/../variables/openflowplugin/delete_flow_rpc.json
     ${dictionary}=    Create Dictionary    10.0.1.0/24=0
-    ClusterManagement.Post_As_Json_To_Member    uri=/restconf/operations/sal-flow:remove-flow    data=${body}    member_index=${controller_index}
+    ClusterManagement.Post_As_Json_To_Member    uri=/rests/operations/sal-flow:remove-flow    data=${body}    member_index=${controller_index}
     Wait Until Keyword Succeeds    5s    1s    ClusterManagement.Check_Item_Occurrence_Member_List_Or_All    uri=${operational_table_0}    dictionary=${dictionary}    member_index_list=${controller_index_list}
 
 Take OpenFlow Device Link Down and Verify
@@ -158,7 +159,7 @@ Check Linear Topology On Member
     [Arguments]    ${switches}    ${member_index}=1
     [Documentation]    Check Linear topology.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
-    ${resp}    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_TOPO_API}
+    ${resp}    RequestsLibrary.Get Request    ${session}    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${switch}    IN RANGE    1    ${switches+1}
@@ -177,7 +178,7 @@ Check No Switches On Member
     [Arguments]    ${switches}    ${member_index}=1
     [Documentation]    Check no switch is in topology
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
-    ${resp}    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_TOPO_API}
+    ${resp}    RequestsLibrary.Get Request    ${session}    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${switch}    IN RANGE    1    ${switches+1}
@@ -188,7 +189,7 @@ Check Number Of Flows On Member
     [Arguments]    ${flows}    ${member_index}=1
     [Documentation]    Check number of flows in the inventory.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
-    ${resp}=    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    ${session}    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Count    ${resp.text}    "priority"
@@ -198,7 +199,7 @@ Check Number Of Groups On Member
     [Arguments]    ${groups}    ${member_index}=1
     [Documentation]    Check number of groups in the inventory.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
-    ${resp}=    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    ${session}    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${group_count}=    Get Count    ${resp.text}    "group-type"
index 881d9d0b42d24787a242cd4a3747edbf4d4d7c91..a42e047ccc8705802317c1df494d0d89ecd013f7 100644 (file)
@@ -5,11 +5,12 @@ Library           Collections
 Library           RequestsLibrary
 Variables         ../variables/Variables.py
 Resource          ./Utils.robot
+Resource          ../variables/openflowplugin/Variables.robot
 
 *** Keywords ***
 Check DIDM Registered With Device
     [Documentation]    Check for DIDM registered with the device
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Should Be Equal As Strings    ${resp.status_code}    200
     Log    ${resp.text}
     Should Contain    ${resp.text}    didm
index 871b8137ed23a81e5f1c61ab21c7849c4de24074..f9df0cfa6e04c4525ee0f10001795df2e51da491 100644 (file)
@@ -9,7 +9,7 @@ Resource          ../variables/netvirt/Variables.robot
 
 *** Keywords ***
 Get Model Dump
-    [Arguments]    ${controller_ip}    ${data_models}=@{internal_data_models}
+    [Arguments]    ${controller_ip}    ${data_models}=@{internal_data_models}    ${restconf_root}=restconf
     [Documentation]    Will output a list of mdsal models using ${data_models} list
     # while feature request in bug 7892 is not done, we will quickly timeout and not retry the model dump get
     # request. This is because when it's done in a failed cluster state, it could take 20s for the reesponse to
@@ -18,7 +18,7 @@ Get Model Dump
     # pass a timeout to restconf
     Create Session    model_dump_session    http://${controller_ip}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}    timeout=1    max_retries=0
     FOR    ${model}    IN    @{data_models}
-        ${resp}=    RequestsLibrary.Get Request    model_dump_session    restconf/${model}
+        ${resp}=    RequestsLibrary.Get Request    model_dump_session    ${restconf_root}/${model}
         ${pretty_output}=    To Json    ${resp.text}    pretty_print=True
         Log    ${pretty_output}
     END
index b7b832dc9bc6d88f9739d4f22f9a8b25ded5f127..819f99db6f477b826f55e1bcec9da04ecf0489a2 100644 (file)
@@ -11,12 +11,13 @@ Library           FlowLib.py
 Library           XmlComparator.py
 Library           Common.py
 Variables         ../variables/Variables.py
+Resource          ../variables/openflowplugin/Variables.robot
 
 *** Keywords ***
 Check No Switches In Inventory
     [Arguments]    ${switches}
     [Documentation]    Check no switch is in inventory
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     FOR    ${switch}    IN RANGE    1    ${switches+1}
         Should Not Contain    ${resp.text}    "openflow:${switch}"
@@ -25,7 +26,7 @@ Check No Switches In Inventory
 Check No Switches In Topology
     [Arguments]    ${switches}
     [Documentation]    Check no switch is in topology
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${switch}    IN RANGE    1    ${switches+1}
@@ -36,7 +37,7 @@ Check Switches In Inventory
     [Arguments]    ${switches}
     [Documentation]    Check all switches and stats in operational inventory
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}/node/openflow:${switch}
+        ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch}
         Log    ${resp.text}
         Should Be Equal As Strings    ${resp.status_code}    200
         Should Contain    ${resp.text}    flow-capable-node-connector-statistics
@@ -46,7 +47,7 @@ Check Switches In Inventory
 Check Switches In Topology
     [Arguments]    ${switches}
     [Documentation]    Check switches are in the topology.
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Count    ${resp.text}    "node-id":"openflow:
@@ -55,7 +56,7 @@ Check Switches In Topology
 Check Number Of Links
     [Arguments]    ${links}
     [Documentation]    Check number of links in the topolgy.
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Count    ${resp.text}    "link-id":"openflow:
@@ -64,7 +65,7 @@ Check Number Of Links
 Check Linear Topology
     [Arguments]    ${switches}
     [Documentation]    Check Linear topology.
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${switch}    IN RANGE    1    ${switches+1}
@@ -88,7 +89,7 @@ Check Flows Operational Datastore
 Check Number Of Flows
     [Arguments]    ${flows}
     [Documentation]    Check number of flows in the inventory.
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Count    ${resp.text}    "priority"
@@ -97,7 +98,7 @@ Check Number Of Flows
 Check Number Of Groups
     [Arguments]    ${groups}
     [Documentation]    Check number of groups in the inventory.
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${group_count}=    Get Count    ${resp.text}    "group-type"
@@ -105,8 +106,8 @@ Check Number Of Groups
 
 Check Flow Stats Are Available
     [Arguments]    ${node_id}    ${flows}
-    [Documentation]    A GET on the /node/${node_id} inventory API is made and flow stats string is checked for existence.
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}/node/${node_id}/table/2
+    [Documentation]    A GET on the /node=${node_id} inventory API is made and flow stats string is checked for existence.
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=${node_id}/table=2
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain X Times    ${resp.text}    priority    ${flows}
@@ -114,7 +115,7 @@ Check Flow Stats Are Available
 Check Number Of Hosts
     [Arguments]    ${hosts}
     [Documentation]    Check number of hosts in topology
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Count    ${resp.text}    "node-id":"host:
@@ -122,7 +123,7 @@ Check Number Of Hosts
 
 Check No Hosts
     [Documentation]    Check if all hosts are deleted from inventory
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Not Contain    ${resp.text}    "node-id":"host:
 
@@ -132,7 +133,7 @@ Add Table Miss Flows
     ${switches}=    Convert To Integer    ${switches}
     ${data}=    OperatingSystem.Get File    ${CURDIR}/../variables/openflowplugin/table_miss_flow.json
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Put As Json To Uri    ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/default    ${data}    session
+        TemplatedRequests.Put As Json To Uri    ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=default    ${data}    session
     END
 
 Check Table Miss Flows
@@ -140,7 +141,7 @@ Check Table Miss Flows
     [Documentation]    Check table miss flows in switches.
     ${switches}=    Convert To Integer    ${switches}
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Get As Json From Uri    ${OPERATIONAL_NODES_API}/node/openflow:${switch}/table/0/flow/default    session
+        TemplatedRequests.Get As Json From Uri    ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=default    session
     END
 
 Create Inventory Flow
@@ -274,10 +275,10 @@ Remove Flow XML Element
 Add Group To Controller And Verify
     [Arguments]    ${group_body}    ${node_id}    ${group_id}
     [Documentation]    Push group through REST-API and verify in data-store
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}    headers=${HEADERS_XML}    data=${group_body}
+    ${resp}    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}    headers=${HEADERS_XML}    data=${group_body}
     Log    ${resp.text}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}    headers=${ACCEPT_XML}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=config    headers=${ACCEPT_XML}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     Compare Xml    ${group_body}    ${resp.text}
@@ -285,10 +286,10 @@ Add Group To Controller And Verify
 Add Flow To Controller And Verify
     [Arguments]    ${flow_body}    ${node_id}    ${table_id}    ${flow_id}
     [Documentation]    Push flow through REST-API and verify in data-store
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}    headers=${HEADERS_XML}    data=${flow_body}
+    ${resp}    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}    headers=${HEADERS_XML}    data=${flow_body}
     Log    ${resp.text}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}    headers=${ACCEPT_XML}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}?content=config    headers=${ACCEPT_XML}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     Compare Xml    ${flow_body}    ${resp.text}
@@ -306,10 +307,10 @@ Verify Flow On Mininet Switch
 Remove Group From Controller And Verify
     [Arguments]    ${node_id}    ${group_id}
     [Documentation]    Remove group and verify
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}
+    ${resp}    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}
     Log    ${resp.text}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=config
     Builtin.Return_From_Keyword_If    ${resp.status_code} == 404 or ${resp.status_code} == 409
     Builtin.Log    ${resp.text}
     Builtin.Fail    The request failed with code ${resp.status_code}
@@ -317,10 +318,10 @@ Remove Group From Controller And Verify
 Remove Flow From Controller And Verify
     [Arguments]    ${node_id}    ${table_id}    ${flow_id}
     [Documentation]    Remove flow and verify
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}
+    ${resp}    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}
     Log    ${resp.text}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}?content=config
     Builtin.Return_From_Keyword_If    ${resp.status_code} == 404 or ${resp.status_code} == 409
     Builtin.Log    ${resp.text}
     Builtin.Fail    The request failed with code ${resp.status_code}
@@ -348,11 +349,11 @@ Remove Default Flows
     Log    Flow XML is ${flow.xml}
     write    dpctl dump-flows -O OpenFlow13
     ${switchoutput}    Read Until    >
-    ${headers}=    Create Dictionary    Content-Type=application/yang.data+xml
-    ${resp}    RequestsLibrary.Post Request    session    restconf/operations/sal-flow:remove-flow    data=${flow.xml}    headers=${headers}
+    ${headers}=    Create Dictionary    Content-Type=application/yang-data+xml
+    ${resp}    RequestsLibrary.Post Request    session    rests/operations/sal-flow:remove-flow    data=${flow.xml}    headers=${headers}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.text}
     Should Not Contain    ${resp.text}    "output-node-connector": "CONTROLLER",
     ${strings_to_check_for}=    Create List    CONTROLLER
@@ -390,7 +391,7 @@ Flow Presence In Config Store
     [Documentation]    Checks the config store for given flow. Returns True if present, otherwise returns False
     ...    This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx}
     ${headers}=    Create Dictionary    Accept=application/xml
-    ${resp}=    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${headers}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}?content=config    headers=${headers}
     Log    ${resp}
     Log    ${resp.text}
     Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
@@ -403,7 +404,7 @@ Flow Presence In Operational Store
     [Documentation]    Checks the operational store for given flow. Returns True if present, otherwise returns False
     ...    This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx}
     ${headers}=    Create Dictionary    Accept=application/xml
-    ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}    headers=${headers}
     Log    ${resp}
     Log    ${resp.text}
     Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
@@ -449,7 +450,7 @@ Add Flow Via RPC
     Set Element Attribute    ${nodeelm}    xmlns:inv    urn:opendaylight:inventory
     Log Element    ${req}
     ${strxml}=    Element To String    ${req}
-    ${resp}=    RequestsLibrary.Post Request    session    /restconf/operations/sal-flow:add-flow    data=${strxml}
+    ${resp}=    RequestsLibrary.Post Request    session    /rests/operations/sal-flow:add-flow    data=${strxml}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
 
@@ -457,10 +458,10 @@ Add Flow Via Restconf
     [Arguments]    ${node_id}    ${table_id}    ${flow_body}
     [Documentation]    Configures a flow specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using POST method
     Log    ${flow_body}
-    ${resp}=    RequestsLibrary.Post Request    session    ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}    data=${flow_body}
+    ${resp}=    RequestsLibrary.Post Request    session    ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}    data=${flow_body}
     Log    ${resp.text}
-    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings    ${resp.status_code}    204    msg=${msg}
+    ${msg}=    Set Variable    Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    201    msg=${msg}
 
 Update Flow Via RPC
     [Arguments]    ${node_id}    ${configured_flow_body}    ${updating_flow_body}
@@ -485,7 +486,7 @@ Update Flow Via RPC
     Set Element Attribute    ${nodeelm}    xmlns:inv    urn:opendaylight:inventory
     Log Element    ${xml}
     ${strxml}=    Element To String    ${xml}
-    ${resp}=    RequestsLibrary.Post Request    session    /restconf/operations/sal-flow:update-flow    data=${strxml}
+    ${resp}=    RequestsLibrary.Post Request    session    /rests/operations/sal-flow:update-flow    data=${strxml}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
 
@@ -493,10 +494,10 @@ Update Flow Via Restconf
     [Arguments]    ${node_id}    ${table_id}    ${flow_id}    ${flow_body}
     [Documentation]    Updates a flow configuration by given flow details (${node_id}, ${table_id}, ${flow_body}) using PUT method
     Log    ${flow_body}
-    ${resp}=    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id}    data=${flow_body}
+    ${resp}=    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id}    data=${flow_body}
     Log    ${resp.text}
-    ${msg}=    Set Variable    Updating flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+    ${msg}=    Set Variable    Updating flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    204    msg=${msg}
 
 Delete Flow Via RPC
     [Arguments]    ${node_id}    ${xmlroot}
@@ -511,22 +512,22 @@ Delete Flow Via RPC
     Set Element Attribute    ${nodeelm}    xmlns:inv    urn:opendaylight:inventory
     Log Element    ${req}
     ${strxml}=    Element To String    ${req}
-    ${resp}=    RequestsLibrary.Post Request    session    /restconf/operations/sal-flow:remove-flow    data=${strxml}
+    ${resp}=    RequestsLibrary.Post Request    session    /rests/operations/sal-flow:remove-flow    data=${strxml}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Delete Flow Via Restconf
     [Arguments]    ${node_id}    ${table_id}    ${flow_id}
     [Documentation]    Deletes a flow from configuration datastore specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using DELETE method
-    ${resp}=    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id}
+    ${resp}=    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id}
     Log    ${resp.text}
-    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    204    msg=${msg}
 
 Get Flow Id
     [Arguments]    ${dpnid}    ${table_id}    ${flow_element}
     [Documentation]    This verifies specific flow-id for particular table-id matching from the flow element
-    ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:${dpnid}/table/${table_id}
+    ${resp} =    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/table=${table_id}?content=config
     BuiltIn.Log    ${resp.text}
     @{flow_id} =    String.Get Regexp Matches    ${resp.text}    id\":\"(\\d+${flow_element})    1
     [Return]    @{flow_id}[0]
index d2600c9951ef3d2e4e11177eb1961faa00911ae7..a89820d17099764a70df06754c3036f19d79025b 100644 (file)
@@ -17,6 +17,7 @@ Resource          SSHKeywords.robot
 Resource          Tcpdump.robot
 Resource          Utils.robot
 Resource          ../variables/Variables.robot
+Resource          ../variables/openflowplugin/Variables.robot
 Resource          ../variables/netvirt/Variables.robot
 Variables         ../variables/netvirt/Modules.py
 
@@ -1348,7 +1349,7 @@ Verify Expected Default Tunnels
 Verify Expected Default Tables On Nodes
     [Arguments]    ${node_ips}=@{OS_ALL_IPS}
     [Documentation]    Verify if Default Table Entries are programmed on all Nodes
-    ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
+    ${resp} =    RequestsLibrary.Get Request    session    ${RFC8040_CONFIG_NODES_API}
     Utils.Log Content    ${resp.text}
     ${failed_node_list} =    BuiltIn.Create List
     FOR    ${node_ip}    IN    @{node_ips}
index 612d38ae4f9651f246bcaa50de88a914b76f36ea..bcaea6475820880b13e0124f83c1dbd0a13b6169 100644 (file)
@@ -32,29 +32,27 @@ class Counter(object):
 
 _spreads = ["gauss", "linear", "first"]  # possible defined spreads at the moment
 _default_flow_template_json = {  # templease used for config datastore
-    u"flow": [
+    "flow": [
         {
-            u"hard-timeout": 65000,
-            u"idle-timeout": 65000,
-            u"cookie_mask": 4294967295,
-            u"flow-name": u"FLOW-NAME-TEMPLATE",
-            u"priority": 2,
-            u"strict": False,
-            u"cookie": 0,
-            u"table_id": 0,
-            u"installHw": False,
-            u"id": u"FLOW-ID-TEMPLATE",
-            u"match": {
-                u"ipv4-destination": u"0.0.0.0/32",
-                u"ethernet-match": {u"ethernet-type": {u"type": 2048}},
+            "hard-timeout": 65000,
+            "idle-timeout": 65000,
+            "cookie_mask": 4294967295,
+            "flow-name": "FLOW-NAME-TEMPLATE",
+            "priority": 2,
+            "strict": False,
+            "cookie": 0,
+            "table_id": 0,
+            "installHw": False,
+            "id": "FLOW-ID-TEMPLATE",
+            "match": {
+                "ipv4-destination": "0.0.0.0/32",
+                "ethernet-match": {"ethernet-type": {"type": 2048}},
             },
-            u"instructions": {
-                u"instruction": [
+            "instructions": {
+                "instruction": [
                     {
-                        u"order": 0,
-                        u"apply-actions": {
-                            u"action": [{u"drop-action": {}, u"order": 0}]
-                        },
+                        "order": 0,
+                        "apply-actions": {"action": [{"drop-action": {}, "order": 0}]},
                     }
                 ]
             },
@@ -171,8 +169,8 @@ def _prepare_add(cntl, method, flows, template=None):
     fl1 = flows[0]
     sw, tab, fl, ip = fl1
     url = "http://" + cntl + ":" + "8181"
-    url += "/restconf/config/opendaylight-inventory:nodes/node/openflow:" + str(sw)
-    url += "/table/" + str(tab) + "/flow/" + str(fl)
+    url += "/rests/data/opendaylight-inventory:nodes/node=openflow%3A" + str(sw)
+    url += "/table=" + str(tab) + "/flow=" + str(fl)
     flow = copy.deepcopy(template["flow"][0])
     flow["cookie"] = fl
     flow["flow-name"] = "TestFlow-%d" % fl
@@ -185,7 +183,7 @@ def _prepare_add(cntl, method, flows, template=None):
     req = requests.Request(
         "PUT",
         url,
-        headers={"Content-Type": "application/json"},
+        headers={"Content-Type": "application/yang-data+json"},
         data=req_data,
         auth=("admin", "admin"),
     )
@@ -211,9 +209,9 @@ def _prepare_table_add(cntl, method, flows, template=None):
     sw, tab, fl, ip = fl1
     url = "http://" + cntl + ":" + "8181"
     url += (
-        "/restconf/config/opendaylight-inventory:nodes/node/openflow:"
+        "/rests/data/opendaylight-inventory:nodes/node=openflow%3A"
         + str(sw)
-        + "/table/"
+        + "/table="
         + str(tab)
     )
     fdets = []
@@ -231,7 +229,7 @@ def _prepare_table_add(cntl, method, flows, template=None):
     req = requests.Request(
         "POST",
         url,
-        headers={"Content-Type": "application/json"},
+        headers={"Content-Type": "application/yang-data+json"},
         data=req_data,
         auth=("admin", "admin"),
     )
@@ -256,12 +254,12 @@ def _prepare_delete(cntl, method, flows, template=None):
     fl1 = flows[0]
     sw, tab, fl, ip = fl1
     url = "http://" + cntl + ":" + "8181"
-    url += "/restconf/config/opendaylight-inventory:nodes/node/openflow:" + str(sw)
-    url += "/table/" + str(tab) + "/flow/" + str(fl)
+    url += "/rests/data/opendaylight-inventory:nodes/node=openflow%3A" + str(sw)
+    url += "/table=" + str(tab) + "/flow=" + str(fl)
     req = requests.Request(
         "DELETE",
         url,
-        headers={"Content-Type": "application/json"},
+        headers={"Content-Type": "application/yang-data+json"},
         auth=("admin", "admin"),
     )
     return req
@@ -284,7 +282,7 @@ def _prepare_rpc_item(cntl, method, flows, template=None):
     """
     f1 = flows[0]
     sw, tab, fl, ip = f1
-    url = "http://" + cntl + ":" + "8181/restconf/operations/sal-bulk-flow:" + method
+    url = "http://" + cntl + ":" + "8181/rests/operations/sal-bulk-flow:" + method
     fdets = []
     for sw, tab, fl, ip in flows:
         flow = copy.deepcopy(template["input"]["bulk-flow-item"][0])
@@ -300,7 +298,7 @@ def _prepare_rpc_item(cntl, method, flows, template=None):
     req = requests.Request(
         "POST",
         url,
-        headers={"Content-Type": "application/json"},
+        headers={"Content-Type": "application/yang-data+json"},
         data=req_data,
         auth=("admin", "admin"),
     )
@@ -326,7 +324,7 @@ def _prepare_ds_item(cntl, method, flows, template=None):
     """
     f1 = flows[0]
     sw, tab, fl, ip = f1
-    url = "http://" + cntl + ":" + "8181/restconf/operations/sal-bulk-flow:" + method
+    url = "http://" + cntl + ":" + "8181/rests/operations/sal-bulk-flow:" + method
     fdets = []
     for sw, tab, fl, ip in flows:
         flow = copy.deepcopy(template["input"]["bulk-flow-item"][0])
@@ -344,7 +342,7 @@ def _prepare_ds_item(cntl, method, flows, template=None):
     req = requests.Request(
         "POST",
         url,
-        headers={"Content-Type": "application/json"},
+        headers={"Content-Type": "application/yang-data+json"},
         data=req_data,
         auth=("admin", "admin"),
     )
@@ -407,8 +405,17 @@ def _wt_request_sender(
         try:
             rsp = ses.send(prep, timeout=5)
         except requests.exceptions.Timeout:
+            print(f"*WARN* Timeout: {req.method} {req.url}")
             counter[99] += 1
+            if counter[99] > 10:
+                print("*ERROR* Too many timeouts.")
+                break
             continue
+        else:
+            if rsp.status_code not in [200, 201, 204]:
+                print(
+                    f"*WARN* Status code {rsp.status_code}: {req.method} {req.url}\n{rsp.text}"
+                )
         counter[rsp.status_code] += 1
     res = {}
     for i, v in enumerate(counter):
@@ -686,22 +693,22 @@ def _get_operational_inventory_of_switches(controller):
     url = (
         "http://"
         + controller
-        + ":8181/restconf/operational/opendaylight-inventory:nodes"
+        + ":8181/rests/data/opendaylight-inventory:nodes?content=nonconfig"
     )
     rsp = requests.get(
         url,
-        headers={"Accept": "application/json"},
+        headers={"Accept": "application/yang-data+json"},
         stream=False,
         auth=("admin", "admin"),
     )
     if rsp.status_code != 200:
         return None
     inv = json.loads(rsp.content)
-    if "nodes" not in inv:
+    if "opendaylight-inventory:nodes" not in inv:
         return None
-    if "node" not in inv["nodes"]:
+    if "node" not in inv["opendaylight-inventory:nodes"]:
         return []
-    inv = inv["nodes"]["node"]
+    inv = inv["opendaylight-inventory:nodes"]["node"]
     switches = [sw for sw in inv if "openflow:" in sw["id"]]
     return switches
 
index 88611e65232b5cf297a5f3a0095aade02eca1091..1a5016b7a4309a0a57f9fdb5367c010decc16094 100644 (file)
@@ -11,6 +11,7 @@ Library           ${CURDIR}/UtilLibrary.py
 Resource          ${CURDIR}/SSHKeywords.robot
 Resource          ${CURDIR}/TemplatedRequests.robot
 Resource          ${CURDIR}/../variables/Variables.robot
+Resource          ${CURDIR}/../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 # TODO: Introduce ${tree_size} and use instead of 1 in the next line.
@@ -85,7 +86,7 @@ Check Nodes Stats
     [Arguments]    ${node}    ${session}=session
     [Documentation]    A GET on the /node/${node} API is made and specific flow stat
     ...    strings are checked for existence.
-    ${resp}    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_NODES_API}/node/${node}
+    ${resp}    RequestsLibrary.Get Request    ${session}    ${RFC8040_NODES_API}/node=${node}?${RFC8040_OPERATIONAL_CONTENT}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.text}    flow-capable-node-connector-statistics
     Should Contain    ${resp.text}    flow-table-statistics
@@ -270,6 +271,11 @@ Verify Controller Has No Null Pointer Exceptions
     [Documentation]    Will execute any tests to verify the controller is not having any null pointer eceptions.
     Check Karaf Log File Does Not Have Messages    ${controller_ip}    java.lang.NullPointerException
 
+Verify Controller Has No Runtime Exceptions
+    [Arguments]    ${controller_ip}=${ODL_SYSTEM_IP}
+    [Documentation]    Will execute any tests to verify the controller is not having any runtime eceptions.
+    Check Karaf Log File Does Not Have Messages    ${controller_ip}    java.lang.RuntimeException
+
 Get Epoch Time
     [Arguments]    ${time}
     [Documentation]    Get the Epoc time from MM/DD/YYYY HH:MM:SS
index 509eed6d2c62ecb997dec713039d396450b90dc9..5b7c58246c62d988ca336fd1cd3ae6c6fee4a452 100644 (file)
@@ -15,7 +15,7 @@ import traceback
 
 
 def _parse_stdout(stdout):
-    """ Transforms stdout to dict """
+    """Transforms stdout to dict"""
     text = stdout.replace(" ", "")
     text = text.replace("\r", "")
     pat = re.compile(r"(?P<key>\w+):(?P<value>.+)")
index ef71212b4d093936dbb60d507045d7870c6bbd13..63b33c9296c7dfcc08c9b25f5a48fff2b1d3b179 100644 (file)
@@ -36,6 +36,8 @@ Workflow Single Switch Multiple Hosts
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller is dead    ${host_discover_time}
     ${status}    ${result}    BuiltIn.Run Keyword And Ignore Error    Utils.Verify Controller Has No Null Pointer Exceptions    ${ODL_SYSTEM_IP}
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has NPE    ${host_discover_time}
+    ${status}    ${result}    BuiltIn.Run Keyword And Ignore Error    Utils.Verify Controller Has No Runtime Exceptions    ${ODL_SYSTEM_IP}
+    Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has RuntimeException    ${topology_discover_time}
     Log To Console    Check number of hosts in topology is ${hosts}
     ${status}    ${result}    BuiltIn.Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${hosts}    2s    FlowLib.Check Number Of Hosts
     ...    ${hosts}
index 694686285608b4dfcdd78517cbd2331f4bcc5f84..50ec659d444fbf3cd001dd7051bff6981401f0aa 100644 (file)
@@ -11,6 +11,7 @@ Resource          CompareStream.robot
 Resource          MininetKeywords.robot
 Resource          KarafKeywords.robot
 Resource          ../variables/Variables.robot
+Resource          ../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${log_level}      ERROR
@@ -46,6 +47,8 @@ Workflow Linear Topology
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller is dead    ${topology_discover_time}
     ${status}    ${result}    Run Keyword And Ignore Error    Utils.Verify Controller Has No Null Pointer Exceptions    ${ODL_SYSTEM_IP}
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has NPE    ${topology_discover_time}
+    ${status}    ${result}    Run Keyword And Ignore Error    Utils.Verify Controller Has No Runtime Exceptions    ${ODL_SYSTEM_IP}
+    Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has RuntimeException    ${topology_discover_time}
     Log To Console    Checking ${switches} switches
     ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    2s    FlowLib.Check Switches In Inventory
     ...    ${switches}
@@ -126,6 +129,8 @@ Workflow Full Mesh Topology
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller is dead    ${topology_discover_time}
     ${status}    ${result}    Run Keyword And Ignore Error    Utils.Verify Controller Has No Null Pointer Exceptions    ${ODL_SYSTEM_IP}
     Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has NPE    ${topology_discover_time}
+    ${status}    ${result}    Run Keyword And Ignore Error    Utils.Verify Controller Has No Runtime Exceptions    ${ODL_SYSTEM_IP}
+    Return From Keyword If    '${status}' == 'FAIL'    ${status}    Controller has RuntimeException    ${topology_discover_time}
     Log To Console    Checking ${switches} switches
     ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Switches In Inventory
     ...    ${switches}
@@ -178,6 +183,6 @@ Workflow Setup
 
 Workflow Teardown
     [Documentation]    Cleanup when workflow is interrupt
-    Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     Utils.Clean Mininet System
     RequestsLibrary.Delete All Sessions
index 6347371de5f4ba997e9c32156d2f7ec46567ef7a..d3c9edd019c07c924bbd9cc62cacc7853400cf8e 100644 (file)
@@ -4,6 +4,7 @@ Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCON
 Suite Teardown    Delete All Sessions
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
@@ -14,20 +15,20 @@ ${IP_3}           "10.0.0.3"
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
 
 Check No Host Is Present
     [Documentation]    Get the invnetory, should not contain any host address
     @{list}    Create List    ${IP_1}    ${IP_2}    ${IP_3}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
 
 Ping All
     [Documentation]    Pingall, verify no packet loss
@@ -36,20 +37,20 @@ Ping All
 Check node 1 addresses
     [Documentation]    Get the address observations for node 1
     @{list}    Create List    ${IP_2}    ${IP_3}
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${IP_1}    1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig    ${IP_1}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig    ${list}
 
 Check node 2 addresses
     [Documentation]    Get the address observations for node 2
     @{list}    Create List    ${IP_1}    ${IP_3}
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${IP_2}    1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig    ${IP_2}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig    ${list}
 
 Check node 3 addresses
     [Documentation]    Get the address observations for node 3
     @{list}    Create List    ${IP_1}    ${IP_2}
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${IP_3}    1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig    ${IP_3}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig    ${list}
 
 *** Keywords ***
 Ping All Works Good
index aff53fdcd6729e14e643aa5ca12234f340eaa7e2..04dc4bd12a8a84c59f7458c94e111ad6c7d04dc0 100644 (file)
@@ -5,6 +5,7 @@ Suite Teardown    Delete All Sessions
 Library           Collections
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
@@ -12,19 +13,19 @@ Variables         ../../../variables/Variables.py
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
 
 Check Flows
     [Documentation]    Check all flows are present
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "output-node-connector"    21
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    "output-node-connector"    21
 
 Ping All Test
     [Documentation]    Ping all, verify no packet loss or duplicates
index 2e9c80932119a700d8fad18059d7f902bfd1c4d2..00ebcc99263cd21154fac175bf486cd5b2e885bd 100644 (file)
@@ -4,6 +4,7 @@ Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCON
 Suite Teardown    Delete All Sessions
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
@@ -17,15 +18,15 @@ ${IP_3}           10.0.0.3
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
 
 Check Switch Links
     [Documentation]    Get the topology and check links
@@ -63,7 +64,7 @@ Link Down
     Write    link s1 h1 down
     Read Until    mininet>
     @{list}    Create List    "link-down":true
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig    ${list}
     @{list}    Create List    ${MAC_1}
     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
@@ -73,7 +74,7 @@ Link Up
     Write    link s1 h1 up
     Read Until    mininet>
     @{list}    Create List    "link-down":false
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig    ${list}
     Write    pingall
     Read Until    mininet>
     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
@@ -92,7 +93,7 @@ Add Port
     Write    sh ovs-vsctl add-port s1 s1-eth1 -- set interface s1-eth1 ofport=1
     Read Until    mininet>
     @{list}    Create List    "link-down":false
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig    ${list}
     Write    pingall
     Read Until    mininet>
     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
index a9a3c5574b78da760d07c7eaa1e4e0013e098443..4ba5ea3036fcddf41ee1630c9f9f549a8447eb7a 100644 (file)
@@ -4,6 +4,7 @@ Suite Setup       Start Suite
 Suite Teardown    Utils.Stop Mininet
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
@@ -13,31 +14,31 @@ ${DISCARD}        "stp-status-aware-node-connector:status":"discarding"
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
 
 Check Ports
     [Documentation]    Check all ports are present
     @{list}    Create List    openflow:1:1    openflow:1:2    openflow:1:3    openflow:2:1    openflow:2:2
     ...    openflow:2:3    openflow:3:1    openflow:3:2    openflow:3:3
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
 
 Check Ports STP status
     [Documentation]    Check the stp status of the ports (forwarding/discarding)
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${DISCARD}    2
 
 Check Flows
     [Documentation]    Check all flows are present
     [Tags]    bug 6984    bug
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "output-node-connector"    16
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    "output-node-connector"    16
     [Teardown]    Report_Failure_Due_To_Bug    6984
 
 Ping Test
@@ -50,7 +51,7 @@ Link Down
     Write    link s1 s2 down
     Read Until    mininet>
     @{list}    Create List    ${DISCARD}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
 
 Link Up
@@ -58,8 +59,8 @@ Link Up
     [Tags]    exclude
     Write    link s1 s2 up
     Read Until    mininet>
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${DISCARD}    2
     # This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
     # it produces a packet storm in mininet that makes the test unresponsive.
     Sleep    1
@@ -77,8 +78,8 @@ Add Port
     [Tags]    exclude
     Write    sh ovs-vsctl add-port s1 s1-eth2 -- set interface s1-eth2 ofport=2
     Read Until    mininet>
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${DISCARD}    2
     # This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
     # it produces a packet storm in mininet that makes the test unresponsive.
     Sleep    1
index beb7a06a501ba7470af5b9f7defbc44e1d068d52..4c3ac1c73a64df410663ccc1604d70f213dfe4f9 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
@@ -66,4 +67,4 @@ Add Flow
     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Datastore Presence    ${flowfile}    ${True}    ${True}
     ...    ${False}    ${True}
     Sleep    8
-    [Teardown]    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    [Teardown]    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
index 3d93737d600c07b253b9a3c5a3d1511a8836d636..a43a2b1ed2f22d1ec963cd50e13f4c25c5f39937 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
@@ -33,6 +34,6 @@ Initialization Phase
 
 Final Phase
     [Documentation]    Stops mininet.
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
     RequestsLibrary.Delete All Sessions
index 65ecb45c7727ccdf9abd24a15de735ed41912ab5..9c473e75bf42618f5852c64356edc6928111f24f 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
@@ -28,7 +29,8 @@ Update Flow With Invalid Match And Check It Is Not In Operational DS
     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile2}
     FlowLib.Update Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}    ${data}
     FlowLib.Check Config Flow    ${True}    ${data}
-    BuiltIn.Wait Until Keyword Succeeds    10s    1s    Utils.No Content From URI    session    ${OPERATIONAL_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    BuiltIn.Wait Until Keyword Succeeds    10s    1s    Utils.No Content From URI    session
+    ...    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}?content=nonconfig
     [Teardown]    Report_Failure_Due_To_Bug    7335
 
 *** Keywords ***
@@ -41,6 +43,6 @@ Initialization Phase
 
 Final Phase
     [Documentation]    Stops mininet.
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
     RequestsLibrary.Delete All Sessions
index 73b0f37f5b1af21d386f938c10a10e6a21960907..8a9d6dd1022bf1e239da717131ea0218700b8e9f 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
@@ -42,6 +43,6 @@ Initialization Phase
 
 Final Phase
     [Documentation]    Stops mininet.
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
     RequestsLibrary.Delete All Sessions
index 31092c7c1d9eb2fd97797be9029338484970e382..8dd96ef2f844445b5796d558c391cf0e4d61d824 100644 (file)
@@ -10,6 +10,7 @@ Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../libraries/OVSDB.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${ODL_OF_PORT1}    6653
@@ -46,7 +47,7 @@ Initialization Phase
 
 Final Phase
     [Documentation]    Stops mininet.
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
     RequestsLibrary.Delete All Sessions
 
index e76ed9ba7b89d52e5eec50d763a892dc03f41cf2..51238730bdcbc4114b7a9e3331618b234b87f690 100644 (file)
@@ -11,6 +11,7 @@ Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../variables/Variables.robot
 Resource          ../../../variables/netvirt/Variables.robot
 Resource          ../../../libraries/DataModels.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XMLSDIR}        ${CURDIR}/../../../../csit/variables/openflowplugin
@@ -19,7 +20,7 @@ ${XMLSDIR}        ${CURDIR}/../../../../csit/variables/openflowplugin
 @{GROUP_ID}       1    2    3
 ${FLAG_MSG}       "bundle-based-reconciliation-enabled configuration property was changed to 'true'"
 ${STATIC_FLOW}    table=91
-@{DATA_MODELS}    config/opendaylight-inventory:nodes    operational/opendaylight-inventory:nodes
+@{DATA_MODELS}    data/opendaylight-inventory:nodes?${RFC8040_CONFIG_CONTENT}    data/opendaylight-inventory:nodes?${RFC8040_OPERATIONAL_CONTENT}
 
 *** Test Cases ***
 TC01_Reconciliation check after switch restart
@@ -80,7 +81,7 @@ Start Suite
 
 End Suite
     [Documentation]    Run at end of the suite
-    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     KarafKeywords.Issue_Command_On_Karaf_Console    log:set INFO org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl
     SSHLibrary.Close All Connections
 
@@ -91,7 +92,7 @@ Configure DPN
     Utils.Run Command On Remote System    ${ip}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
     Utils.Run Command On Remote System    ${ip}    sudo ovs-vsctl set-controller ${INTEGRATION_BRIDGE} tcp:${ODL_SYSTEM_IP}:6653
     Utils.Run Command On Remote System    ${ip}    sudo ovs-vsctl set bridge ${INTEGRATION_BRIDGE} protocols=OpenFlow13
-    Wait Until Keyword Succeeds    20s    2s    DataModels.Get Model Dump    ${ODL_SYSTEM_IP}    ${DATA_MODELS}
+    Wait Until Keyword Succeeds    20s    2s    DataModels.Get Model Dump    ${ODL_SYSTEM_IP}    ${DATA_MODELS}    ${RFC8040_RESTCONF_ROOT}
 
 Push Static Flow
     [Arguments]    ${ip}
@@ -111,7 +112,7 @@ Push Flow Via Restcall
 Push Groups Via Restcall
     [Arguments]    ${switch_idx}    ${index}
     ${GROUP_BODY}    OperatingSystem.Get File    ${XMLSDIR}/${GROUPFILE[${index}]}
-    ${node_id}    BuiltIn.Set Variable    openflow:${switch_idx}
+    ${node_id}    BuiltIn.Set Variable    openflow%3A${switch_idx}
     ${group_id}    BuiltIn.Set Variable    ${GROUP_ID[${index}]}
     FlowLib.Add Group To Controller And Verify    ${GROUP_BODY}    ${node_id}    ${group_id}
-    Wait Until Keyword Succeeds    5s    1s    Utils.Get URI And Verify    ${OPERATIONAL_NODES_API}/node/${node_id}/group/${group_id}
+    Wait Until Keyword Succeeds    5s    1s    Utils.Get URI And Verify    ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=nonconfig
index 795d7d5c211839eea87a22a5372552c97a298739..830736df87b6d8b3f30016e5ef61f79c042ceaa8 100644 (file)
@@ -13,6 +13,7 @@ Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/OvsManager.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${SWITCHES}       3
@@ -375,7 +376,7 @@ Final Phase
     [Documentation]    Delete all sessions.
     ${command} =    BuiltIn.Set Variable    sudo iptables -v -F
     BuiltIn.Run Keyword And Ignore Error    ClusterManagement.Run_Bash_Command_On_List_Or_All    ${command}
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     RequestsLibrary.Delete All Sessions
 
 Add Groups And Flows On Member
@@ -398,9 +399,9 @@ Remove Single Group And Flow On Member
     [Documentation]    Remove 1 group 1&2 and 1 flow in every switch.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
-        RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
-        RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+        RequestsLibrary.Delete Request    ${session}    ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=1
+        RequestsLibrary.Delete Request    ${session}    ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1
+        RequestsLibrary.Delete Request    ${session}    ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1000
     END
 
 Check Flow Stats Are Not Frozen
@@ -417,7 +418,7 @@ Extract Flow Duration
     [Arguments]    ${member_index}
     [Documentation]    Extract duration for flow 1 in switch 1.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
-    ${resp}    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1    headers=${headers}
+    ${resp}    RequestsLibrary.Get Request    ${session}    ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=1?content=nonconfig    headers=${headers}
     Log    ${resp.content}
     ${json_resp} =    RequestsLibrary.To_Json    ${resp.content}
     ${flow_list} =    Collections.Get_From_Dictionary    ${json_resp}    flow-node-inventory:flow
index f2c6ffbe6825ea9f297c1175504b7bfd75211785..4214ddcde42a47cb6848cf498ea857cde8a64d03 100644 (file)
@@ -20,6 +20,7 @@ ${SWITCHES}       1
 ${START_CMD}      sudo mn --topo linear,${SWITCHES}
 @{CONTROLLER_NODES}    ${ODL_SYSTEM_1_IP}    ${ODL_SYSTEM_2_IP}    ${ODL_SYSTEM_3_IP}
 @{cntls_idx_list}    ${1}    ${2}    ${3}
+${ENTITY_OWNER_URI}    rests/data/entity-owners:entity-owners
 
 *** Test Cases ***
 Start Mininet To All Nodes
@@ -158,6 +159,7 @@ Isolate Controller From The Cluster
 Check No Device Owners In Controller
     [Documentation]    Check there is no owners in controllers
     ${session} =    Resolve_Http_Session_For_Member    member_index=${active_member}
+    # FIXME: The URI only works for Silicon & earlier versions. This should be replaced with new RPC calls for Phosphorus.
     ${data} =    TemplatedRequests.Get_As_Json_From_Uri    uri=${ENTITY_OWNER_URI}    session=${session}
     #ofp-topology-manager entity is introduced in the OPNFLWPLUG-1022 bug fix, and this entity will
     #always be present in the EOS output. All 3 controller nodes will be candidate, so EOS output will
index 1b18c6bd9d0a0e1d8c698509ebdb66379eb9d81c..fee03a0ba0afb115dbf95fe8a6df4859fc853150 100644 (file)
@@ -10,8 +10,8 @@ Resource          ../../../libraries/FlowLib.robot
 Variables         ../../../variables/ofplugin/RpcVariables.py
 
 *** Variables ***
-${send_barrier_url}    /restconf/operations/flow-capable-transaction:send-barrier
-${send_echo_url}    /restconf/operations/sal-echo:send-echo
+${send_barrier_url}    /rests/operations/flow-capable-transaction:send-barrier
+${send_echo_url}    /rests/operations/sal-echo:send-echo
 
 *** Test Cases ***
 Sending Barrier
index d186e8960bb89d98c9a309b19798a8348fa7e375..e5df8165fc62e548d1c94597bced24139e6b628f 100644 (file)
@@ -10,7 +10,7 @@ Resource          ../../../libraries/FlowLib.robot
 Variables         ../../../variables/ofplugin/RpcVariables.py
 
 *** Variables ***
-${send_update_table_url}    /restconf/operations/sal-table:update-table
+${send_update_table_url}    /rests/operations/sal-table:update-table
 ${start}          sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo tree,1 --switch user
 
 *** Test Cases ***
index 090f699c68daff673c73fb6fc8b22e2a90d7f8d8..3ed3b61ac723c7cf2a39f9ef43e25f778e5db677 100644 (file)
@@ -9,6 +9,7 @@ Library           RequestsLibrary
 Library           SSHLibrary
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/FlowLib.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 Library           ../../../libraries/XmlComparator.py
 
@@ -53,7 +54,7 @@ Final Phase
 
 Delete Flow
     [Documentation]    Removes used flow
-    ${resp}=    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${resp}=    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
index 3dcdc6ad5b9e8b625c0c4dd3911bcf10d350fdb5..227621ee28f37b29c2567d635ce4a6ac59c17956 100644 (file)
@@ -40,7 +40,7 @@ Test Add Flows Group 0
         # Lets wait for ofp to collect stats
     END
     ${flows}=    Get Length    ${flowlist0}
-    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
+    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Flow Stats Are Available    openflow%3A1    ${flows}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
index fc18e172221b2e1e9bb96e6ca81005caf7972348..57024f66204c98e36a8bef54483c27e2082c7a5b 100644 (file)
@@ -39,7 +39,7 @@ Test Add Flows Group 0
         # Lets wait for ofp to collect stats
     END
     ${flows}=    Get Length    ${flowlist0}
-    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
+    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Flow Stats Are Available    openflow%3A1    ${flows}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
index 0569e32435c024ef73c45ab4020e781339d0a9f0..25f3b73f1c02e230876a6b4127b40c8fac03cfa3 100644 (file)
@@ -6,9 +6,10 @@ Library           OperatingSystem
 Library           Collections
 Library           XML
 Library           ../../../libraries/XmlComparator.py
-Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
@@ -216,7 +217,7 @@ Check Config Flow Presence
 
 Flow Presence Config Flow
     ${headers}=    Create Dictionary    Accept=application/xml
-    ${resp}=    RequestsLibrary.Get Request    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${headers}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}    headers=${headers}
     Log    ${resp}
     Log    ${resp.content}
     Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
@@ -236,7 +237,7 @@ Check Operational Table Presence
 
 Flow Presence Operational Table
     ${headers}=    Create Dictionary    Accept=application/xml
-    ${resp}=    RequestsLibrary.Get Request    session    /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
+    ${resp}=    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}?${RFC8040_OPERATIONAL_CONTENT}    headers=${headers}
     Log    ${resp}
     Log    ${resp.content}
     Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
@@ -246,13 +247,13 @@ Flow Presence Operational Table
 
 Add Flow
     Log    ${data}
-    ${resp}=    RequestsLibrary.Put Request    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${HEADERS_XML}    data=${data}
-    ${msg}=    Set Variable    Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${resp}=    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}    headers=${HEADERS_XML}    data=${data}
+    ${msg}=    Set Variable    Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Delete Flow
-    ${resp}=    RequestsLibrary.Delete Request    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-    ${msg}=    Set Variable    Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${resp}=    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Delete All Flows
index b9b507ae25ee688f406436a3858887f3ebd51241..4aa018909677c07e0f3beea01906cf67018baeed 100644 (file)
@@ -8,12 +8,11 @@ Library           OperatingSystem
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 Resource          ../../../libraries/Utils.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes/
-${REST_CONTEXT_CF}    /restconf/config/opendaylight-inventory:nodes/node/openflow:1
-${REST_CONTEXT_OP}    /restconf/operational/opendaylight-inventory:nodes/node/openflow:1
+${REST_CONTEXT}    ${RFC8040_NODES_API}/node=openflow%3A1
 ${GROUP}          ${CURDIR}/../../../variables/xmls/g4.xml
 ${FLOW}           ${CURDIR}/../../../variables/xmls/f50.xml
 ${GROUP_NAME}     Foo
@@ -23,20 +22,20 @@ ${FLOW_NAME}      forward
 Get list of nodes
     [Documentation]    Get the inventory to make sure openflow:1 comes up
     ${node_list}=    Create List    openflow:1
-    Wait Until Keyword Succeeds    90s    1s    Check For Elements At URI    ${REST_CONTEXT_OP}    ${node_list}
+    Wait Until Keyword Succeeds    90s    1s    Check For Elements At URI    ${REST_CONTEXT}?${RFC8040_OPERATIONAL_CONTENT}    ${node_list}
 
 Add a group
     [Documentation]    Add a group using RESTCONF
     [Tags]    Push
     ${body}    OperatingSystem.Get File    ${GROUP}
     Set Suite Variable    ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT_CF}/group/1    headers=${HEADERS_XML}    data=${body}
+    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT}/group=1    headers=${HEADERS_XML}    data=${body}
     Log    ${resp.content}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding group config
     [Documentation]    Get the group stat in config
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/group/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/group=1?${RFC8040_CONFIG_CONTENT}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${GROUP_NAME}
@@ -45,21 +44,21 @@ Verify after adding group operational
     [Documentation]    Get the group stat in operational
     ${elements}=    Create List    group-statistics    ref-count    packet-count    byte-count    buckets
     ...    weight    group-select
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT_OP}/group/1    ${elements}
+    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT}/group=1?${RFC8040_OPERATIONAL_CONTENT}    ${elements}
 
 Add a flow that includes a group
     [Documentation]    Push a flow through RESTCONF
     [Tags]    Push
     ${body}    OperatingSystem.Get File    ${FLOW}
     Set Suite Variable    ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT_CF}/table/0/flow/1    headers=${HEADERS_XML}    data=${body}
+    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT}/table=0/flow=1    headers=${HEADERS_XML}    data=${body}
     Log    ${resp.content}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding flow config
     [Documentation]    Verify the flow
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/table/0/flow/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/table=0/flow=1?${RFC8040_CONFIG_CONTENT}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${FLOW_NAME}
@@ -67,28 +66,28 @@ Verify after adding flow config
 Verify after adding flow operational
     [Documentation]    Verify the flow
     ${elements}=    Create List    group-action    group-id
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT_OP}/table/0/flow/1    ${elements}
+    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT}/table=0/flow=1?${RFC8040_OPERATIONAL_CONTENT}    ${elements}
 
 Remove the flow
     [Documentation]    Remove the flow
-    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT_CF}/table/0/flow/1
+    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT}/table=0/flow=1
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting flow
     [Documentation]    Verify the flow removal
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/table/0/flow/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/table=0/flow=1?${RFC8040_CONFIG_CONTENT}
     Should Not Contain    ${resp.content}    ${FLOW_NAME}
 
 Delete the group
     [Documentation]    Remove the group
     [Tags]    Delete
-    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT_CF}/group/1
+    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT}/group=1
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting group
     [Documentation]    Verify the flow removal
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/group/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/group=1?${RFC8040_CONFIG_CONTENT}
     Should Not Contain    ${resp.content}    ${GROUP_NAME}
index 0726eac85d0f0945223b6b33017ea65e3e1d6199..40152def4710cb42347447d5238700ed67c68f5b 100644 (file)
@@ -8,12 +8,11 @@ Library           OperatingSystem
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 Resource          ../../../libraries/Utils.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes/
-${REST_CONTEXT_CF}    /restconf/config/opendaylight-inventory:nodes/node/openflow:1
-${REST_CONTEXT_OP}    /restconf/operational/opendaylight-inventory:nodes/node/openflow:1
+${REST_CONTEXT}    ${RFC8040_NODES_API}/node=openflow%3A1
 ${METER}          ${CURDIR}/../../../variables/xmls/m4.xml
 ${FLOW}           ${CURDIR}/../../../variables/xmls/f51.xml
 ${METER_NAME}     Foo
@@ -23,20 +22,20 @@ ${FLOW_NAME}      forward
 Get list of nodes
     [Documentation]    Get the inventory to make sure openflow:1 comes up
     ${node_list}=    Create List    openflow:1
-    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_CONTEXT_OP}    ${node_list}
+    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_CONTEXT}?${RFC8040_OPERATIONAL_CONTENT}    ${node_list}
 
 Add a meter
     [Documentation]    Add a meter using RESTCONF
     [Tags]    Push
     ${body}    OperatingSystem.Get File    ${METER}
     Set Suite Variable    ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT_CF}/meter/1    headers=${HEADERS_XML}    data=${body}
+    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT}/meter=1    headers=${HEADERS_XML}    data=${body}
     Log    ${resp.content}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding meter config
     [Documentation]    Get the meter stat in config
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/meter/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${METER_NAME}
@@ -45,21 +44,21 @@ Verify after adding meter operational
     [Documentation]    Get the meter stat in operational
     ${elements}=    Create List    meter-statistics    meter-kbps    flow-count    packet-in-count    byte-in-count
     ...    meter-band-stats    meter-band-headers
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT_OP}/meter/1    ${elements}
+    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT}/meter=1?${RFC8040_OPERATIONAL_CONTENT}    ${elements}
 
 Add a flow that includes a meter
     [Documentation]    Push a flow through RESTCONF
     [Tags]    Push
     ${body}    OperatingSystem.Get File    ${FLOW}
     Set Suite Variable    ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT_CF}/table/0/flow/2    headers=${HEADERS_XML}    data=${body}
+    ${resp}    RequestsLibrary.Put Request    session    ${REST_CONTEXT}/table=0/flow=2    headers=${HEADERS_XML}    data=${body}
     Log    ${resp.content}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding flow config
     [Documentation]    Verify the flow
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/table/0/flow/2
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/table=0/flow=2?${RFC8040_CONFIG_CONTENT}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${FLOW_NAME}
@@ -67,28 +66,28 @@ Verify after adding flow config
 Verify after adding flow operational
     [Documentation]    Verify the flow
     ${elements}=    Create List    meter-id    flow
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT_OP}/table/0/flow/2    ${elements}
+    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${REST_CONTEXT}/table=0/flow=2?${RFC8040_OPERATIONAL_CONTENT}    ${elements}
 
 Remove the flow
     [Documentation]    Remove the flow
-    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT_CF}/table/0/flow/2
+    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT}/table=0/flow=2
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting flow
     [Documentation]    Verify the flow removal
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/table/0/flow/2
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/table=0/flow=2?${RFC8040_CONFIG_CONTENT}
     Should Not Contain    ${resp.content}    ${FLOW_NAME}
 
 Delete the meter
     [Documentation]    Remove the meter
     [Tags]    Delete
-    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT_CF}/meter/1
+    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CONTEXT}/meter=1
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting meter
     [Documentation]    Verify the flow removal
     [Tags]    Get
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT_CF}/meter/1
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
     Should Not Contain    ${resp.content}    ${METER_NAME}
index 8e0d92787449b66607da70e4fa455f5b18bd7124..90855427ec45930b7bd4e22e45dcd679e1d35804 100644 (file)
@@ -6,9 +6,9 @@ Library           Collections
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 
 *** Test Cases ***
 Get list of nodes
@@ -21,7 +21,7 @@ Get list of nodes
 Get nodeconnector for the root node
     [Documentation]    Get the inventory for the root node
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:1
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.text}
@@ -43,7 +43,7 @@ Get Stats for a node
 *** Keywords ***
 Check Every Nodes
     [Arguments]    ${numnodes}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${IND}    IN RANGE    1    ${numnodes+1}
         Should Contain    ${resp.text}    openflow:${IND}
@@ -52,7 +52,7 @@ Check Every Nodes
 Check Every Nodes Stats
     [Arguments]    ${numnodes}
     FOR    ${IND}    IN RANGE    1    ${numnodes+1}
-        ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:${IND}
+        ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
         Log    ${resp.text}
         Should Be Equal As Strings    ${resp.status_code}    200
         Should Contain    ${resp.text}    flow-capable-node-connector-statistics
@@ -62,7 +62,7 @@ Check Every Nodes Stats
 Check Every Nodes Nodeconnector
     [Arguments]    ${numnodes}
     FOR    ${IND}    IN RANGE    2    ${numnodes+1}
-        ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:${IND}
+        ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
         Log    ${resp.text}
         Should Be Equal As Strings    ${resp.status_code}    200
         Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.text}
index 512ebaac184f0f2bf77892d92bbdcc3e1916d0ba..e570e5bdab3deb543fbb9f1e2f60c1d4269cfda9 100644 (file)
@@ -7,9 +7,9 @@ Library           XML
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
 
 *** Test Cases ***
 Get Nodes Count
@@ -17,7 +17,7 @@ Get Nodes Count
     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
-    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    node    ${numnodes}
 
 Get Links Count
     [Documentation]    Checks the number of links
@@ -25,12 +25,12 @@ Get Links Count
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
     ${numlinks}    Evaluate    (${numnodes}-1)*2
-    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    link    ${numlinks}
 
 *** Keywords ***
 Verify Element Count
     [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Element Count    ${resp.text}    xpath=${xpath_location}
index 8e0d92787449b66607da70e4fa455f5b18bd7124..90855427ec45930b7bd4e22e45dcd679e1d35804 100644 (file)
@@ -6,9 +6,9 @@ Library           Collections
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 
 *** Test Cases ***
 Get list of nodes
@@ -21,7 +21,7 @@ Get list of nodes
 Get nodeconnector for the root node
     [Documentation]    Get the inventory for the root node
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:1
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.text}
@@ -43,7 +43,7 @@ Get Stats for a node
 *** Keywords ***
 Check Every Nodes
     [Arguments]    ${numnodes}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Should Be Equal As Strings    ${resp.status_code}    200
     FOR    ${IND}    IN RANGE    1    ${numnodes+1}
         Should Contain    ${resp.text}    openflow:${IND}
@@ -52,7 +52,7 @@ Check Every Nodes
 Check Every Nodes Stats
     [Arguments]    ${numnodes}
     FOR    ${IND}    IN RANGE    1    ${numnodes+1}
-        ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:${IND}
+        ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
         Log    ${resp.text}
         Should Be Equal As Strings    ${resp.status_code}    200
         Should Contain    ${resp.text}    flow-capable-node-connector-statistics
@@ -62,7 +62,7 @@ Check Every Nodes Stats
 Check Every Nodes Nodeconnector
     [Arguments]    ${numnodes}
     FOR    ${IND}    IN RANGE    2    ${numnodes+1}
-        ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}/node/openflow:${IND}
+        ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
         Log    ${resp.text}
         Should Be Equal As Strings    ${resp.status_code}    200
         Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.text}
index 512ebaac184f0f2bf77892d92bbdcc3e1916d0ba..e570e5bdab3deb543fbb9f1e2f60c1d4269cfda9 100644 (file)
@@ -7,9 +7,9 @@ Library           XML
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
 
 *** Test Cases ***
 Get Nodes Count
@@ -17,7 +17,7 @@ Get Nodes Count
     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
-    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    node    ${numnodes}
 
 Get Links Count
     [Documentation]    Checks the number of links
@@ -25,12 +25,12 @@ Get Links Count
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
     ${numlinks}    Evaluate    (${numnodes}-1)*2
-    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    link    ${numlinks}
 
 *** Keywords ***
 Verify Element Count
     [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
-    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${count}=    Get Element Count    ${resp.text}    xpath=${xpath_location}
index 46abaff7553ea3a08f6bf4419a40f31b46a98402..13983dee8a6e2d0fabc5781155f5ed5758c6c2df 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${VENDOR}         Nicira, Inc.
@@ -20,46 +21,46 @@ ${SW_HARDWARE}    "flow-node-inventory:hardware":"${HARDWARE}"
 *** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${node_list}
 
 Check No Link Down
     [Documentation]    Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "link-down":false    8
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    "link-down":false    8
     [Teardown]    Report_Failure_Due_To_Bug    6595
 
 Get node 1 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:1:1
     ...    openflow:1:2
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Get node 2 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:2:1
     ...    openflow:2:2    openflow:2:3
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Get node 3 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:3:1
     ...    openflow:3:2    openflow:3:3
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Link Down
     [Documentation]    Take link s1-s2 down
     Write    link s1 s2 down
     Read Until    mininet>
     @{list}    Create List    "link-down":true
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Link Up
     [Documentation]    Take link s1-s2 up
     Write    link s1 s2 up
     Read Until    mininet>
     @{list}    Create List    "link-down":false
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Remove Port
     [Documentation]    Remove port s2-eth1
@@ -67,7 +68,7 @@ Remove Port
     Write    sh ovs-vsctl del-port s2 s2-eth1
     Read Until    mininet>
     @{list}    Create List    openflow:2:1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
 
 Add Port
     [Documentation]    Add port s2-eth1, new id 4
@@ -75,4 +76,4 @@ Add Port
     Write    sh ovs-vsctl add-port s2 s2-eth1
     Read Until    mininet>
     @{list}    Create List    openflow:2:4
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
index 85023db7d58e4ece73e9b18e7b0688c08a8a611c..9d73911b3d67832142c5c01fef67d4a3108d4b1d 100644 (file)
@@ -6,6 +6,7 @@ Library           Collections
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 Resource          ../../../libraries/Utils.robot
 
 *** Variables ***
@@ -14,8 +15,8 @@ Resource          ../../../libraries/Utils.robot
 *** Test Cases ***
 Get RESTCONF Topology
     [Documentation]    Get RESTCONF Topology and validate the result.
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${node_list}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
 
 List all the links
@@ -69,7 +70,7 @@ Remove Port
     Write    sh ovs-vsctl del-port s2 s2-eth2
     Read Until    mininet>
     @{list}    Create List    openflow:2:2
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${list}
 
 Add Port
     [Documentation]    Add port s2-eth2, new id 5
@@ -77,17 +78,17 @@ Add Port
     Write    sh ovs-vsctl add-port s2 s2-eth2
     Read Until    mininet>
     @{list}    Create List    openflow:2:5
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${list}
 
 *** Keywords ***
 Verify Links
     [Arguments]    ${expected_links}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}/topology/flow:1
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${result}    To JSON    ${resp.text}
     Log    ${result}
-    ${content}    Get From Dictionary    ${result}    topology
+    ${content}    Get From Dictionary    ${result}    network-topology:topology
     ${topology}    Get From List    ${content}    0
     ${links}    Get From Dictionary    ${topology}    link
     FOR    ${expected_link}    IN    @{expected_links}
index 11f6c33fcb4bce107f731e750caa33bea741e0b8..e2d916244262708e98240357d24abe15b97df85f 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 @{node_list}      openflow:1    openflow:2    openflow:3
@@ -14,16 +15,16 @@ Resource          ../../../libraries/Utils.robot
 *** Test Cases ***
 Get Stats for all nodes
     [Documentation]    Get the stats for all nodes
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${node_list}
 
 Get Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Get Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Get Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
index 7c986052d183d5ccf6143ad631c485d7efd34906..7514ad5f49d479f837ce0bac2153c04c7f3ceae4 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
@@ -14,28 +15,28 @@ ${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</pri
 *** Test Cases ***
 Add a flow - Output to physical port#
     [Documentation]    Push a flow through REST-API
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152    headers=${HEADERS_XML}    data=${BODY2}
+    ${resp}    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152    headers=${HEADERS_XML}    data=${BODY2}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding flow config - Output to physical port#
     [Documentation]    Verify the flow
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=config
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.text}    152
 
 Verify after adding flow operational - Output to physical port#
     [Documentation]    Verify the flow
     ${elements}=    Create List    10.0.20.1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/152    ${elements}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152?content=nonconfig    ${elements}
 
 Remove a flow - Output to physical port#
     [Documentation]    Remove a flow
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152
-    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152
+    Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify after deleting flow config - Output to physical port#
     [Documentation]    Verify the flow
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=config
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Not Contain    ${resp.text}    152
     #    Standing bug #368 - This has been fixed
@@ -43,4 +44,4 @@ Verify after deleting flow config - Output to physical port#
 Verify after deleting flow operational - Output to physical port#
     [Documentation]    Verify the flow
     ${elements}=    Create List    10.0.20.1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0    ${elements}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=nonconfig    ${elements}
index 3f3734328029d36545de6250ea58f0a6666304b6..b56a8c2c6fd4cd6bfa34b8c1983ea6b8f62925cf 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${VENDOR}         Nicira, Inc.
@@ -20,45 +21,45 @@ ${SW_HARDWARE}    "flow-node-inventory:hardware":"${HARDWARE}"
 *** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${node_list}
 
 Check No Link Down
     [Documentation]    Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
-    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "link-down":false    8
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    "link-down":false    8
 
 Get node 1 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:1:1
     ...    openflow:1:2
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Get node 2 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:2:1
     ...    openflow:2:2    openflow:2:3
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Get node 3 inventory
     [Documentation]    Get the inventory for a node
     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:3:1
     ...    openflow:3:2    openflow:3:3
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Link Down
     [Documentation]    Take link s1-s2 down
     Write    link s1 s2 down
     Read Until    mininet>
     @{list}    Create List    "link-down":true
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Link Up
     [Documentation]    Take link s1-s2 up
     Write    link s1 s2 up
     Read Until    mininet>
     @{list}    Create List    "link-down":false
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
 
 Remove Port
     [Documentation]    Remove port s2-eth1
@@ -66,7 +67,7 @@ Remove Port
     Write    sh ovs-vsctl del-port s2 s2-eth1
     Read Until    mininet>
     @{list}    Create List    openflow:2:1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
 
 Add Port
     [Documentation]    Add port s2-eth1, new id 4
@@ -74,4 +75,4 @@ Add Port
     Write    sh ovs-vsctl add-port s2 s2-eth1
     Read Until    mininet>
     @{list}    Create List    openflow:2:4
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
index 85023db7d58e4ece73e9b18e7b0688c08a8a611c..78cedcbe9d3bb2841d110be2948542f188bc6a24 100644 (file)
@@ -6,6 +6,7 @@ Library           Collections
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 Resource          ../../../libraries/Utils.robot
 
 *** Variables ***
@@ -14,8 +15,8 @@ Resource          ../../../libraries/Utils.robot
 *** Test Cases ***
 Get RESTCONF Topology
     [Documentation]    Get RESTCONF Topology and validate the result.
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${node_list}
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_API}
     Log    ${resp.text}
 
 List all the links
@@ -68,26 +69,26 @@ Remove Port
     [Tags]    exclude
     Write    sh ovs-vsctl del-port s2 s2-eth2
     Read Until    mininet>
-    @{list}    Create List    openflow:2:2
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list}    Create List    openflow%3A2%3A2
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${list}
 
 Add Port
     [Documentation]    Add port s2-eth2, new id 5
     [Tags]    exclude
     Write    sh ovs-vsctl add-port s2 s2-eth2
     Read Until    mininet>
-    @{list}    Create List    openflow:2:5
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list}    Create List    openflow%3A2%3A5
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_TOPO_API}    ${list}
 
 *** Keywords ***
 Verify Links
     [Arguments]    ${expected_links}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}/topology/flow:1
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
     Log    ${resp.text}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${result}    To JSON    ${resp.text}
     Log    ${result}
-    ${content}    Get From Dictionary    ${result}    topology
+    ${content}    Get From Dictionary    ${result}    network-topology:topology
     ${topology}    Get From List    ${content}    0
     ${links}    Get From Dictionary    ${topology}    link
     FOR    ${expected_link}    IN    @{expected_links}
index 11f6c33fcb4bce107f731e750caa33bea741e0b8..e2d916244262708e98240357d24abe15b97df85f 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 @{node_list}      openflow:1    openflow:2    openflow:3
@@ -14,16 +15,16 @@ Resource          ../../../libraries/Utils.robot
 *** Test Cases ***
 Get Stats for all nodes
     [Documentation]    Get the stats for all nodes
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${node_list}
 
 Get Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
 
 Get Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
 
 Get Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
index 7e3ae087cf90008d47e5cc40778f4ecb1add3ec1..d7ecf80ffc5a3934a5705adc291122fede81fbf0 100644 (file)
@@ -7,6 +7,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${BODY1}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
@@ -15,48 +16,48 @@ ${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</pri
 *** Test Cases ***
 Add a flow - Sending IPv4 Dest Address and Eth type
     [Documentation]    Push a flow through REST-API
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139    headers=${HEADERS_XML}    data=${BODY1}
+    ${resp}    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139    headers=${HEADERS_XML}    data=${BODY1}
     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
 
 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.text}    139
 
 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
     ${elements}=    Create List    10.0.10.1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/2/flow/139    ${elements}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig    ${elements}
 
 Modify a flow - Output to physical port#
     [Documentation]    Push a flow through REST-API
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139    headers=${HEADERS_XML}    data=${BODY2}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Put Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139    headers=${HEADERS_XML}    data=${BODY2}
+    Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify after modifying flow config - Output to physical port#
     [Documentation]    Verify the flow
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.text}    10.0.20.1
 
 Verify after modifying flow operational - Output to physical port#
     [Documentation]    Verify the flow
     ${elements}=    Create List    10.0.20.1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/2/flow/139    ${elements}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig    ${elements}
 
 Remove a flow - Output to physical port#
     [Documentation]    Remove a flow
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139
-    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139
+    Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify after deleting flow config - Output to physical port#
     [Documentation]    Verify the flow
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/2
+    ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Not Contain    ${resp.text}    139
 
 Verify after deleting flow operational - Output to physical port#
     [Documentation]    Verify the flow
     ${elements}=    Create List    10.0.20.1
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/2    ${elements}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=nonconfig    ${elements}
index a28ceedf3c2a57f64cbac16543f6d8cd387b55f5..8e645e4f7cbff98c24abaa881b80b6c9515daaa9 100644 (file)
@@ -6,8 +6,9 @@ Library           OperatingSystem
 Library           XML
 Library           Process
 Library           RequestsLibrary
-Resource          ../../../libraries/Utils.robot
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${switches}       25
@@ -43,7 +44,7 @@ Start Http Session
 Are Switches Connected
     [Arguments]    ${switches}
     [Documentation]    Checks Topology Contains a fix number ${switches} of switces.
-    ${resp}=    RequestsLibrary.Get Request    tcsession    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    RequestsLibrary.Get Request    tcsession    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    XML.Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${switches}
index 236518561a3fd2f31867ee04e6e22473531431f8..9a39245b3ef66fd39c8718af9ff9ded79773b76d 100644 (file)
@@ -6,18 +6,17 @@ Library           OperatingSystem
 Library           Collections
 Library           XML
 Library           SSHLibrary
-Variables         ../../../../csit/variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../../csit/libraries/Common.py
 Library           ../../../../csit/libraries/ScaleClient.py
+Variables         ../../../../csit/variables/Variables.py
+Resource          ../../../../csit/variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           17
 ${flnr}           17000
 ${swspread}       gauss
 ${tabspread}      gauss
-${topourl}        /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl}         /restconf/operational/opendaylight-inventory:nodes
 @{cntls}          ${ODL_SYSTEM_IP}
 
 *** Test Cases ***
@@ -63,7 +62,7 @@ Stop Switches
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index 48d052720924964b5a8bbe41550e0b5d9f6654b9..2bd670568af421edd4a50bd4cd18b4f4d5835209 100644 (file)
@@ -6,18 +6,17 @@ Library           OperatingSystem
 Library           Collections
 Library           XML
 Library           SSHLibrary
-Variables         ../../../../csit/variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../../csit/libraries/Common.py
 Library           ../../../../csit/libraries/ScaleClient.py
+Variables         ../../../../csit/variables/Variables.py
+Resource          ../../../../csit/variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           17
 ${flnr}           17000
 ${swspread}       linear
 ${tabspread}      linear
-${topourl}        /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl}         /restconf/operational/opendaylight-inventory:nodes
 @{cntls}          ${ODL_SYSTEM_IP}
 
 *** Test Cases ***
@@ -63,7 +62,7 @@ Stop Switches
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index f03ce3c7d42e1af36dd5872b8848fe86f5e9b30d..559f4114963d8ea68de3f9421cc0de7b0eecbae3 100644 (file)
@@ -6,18 +6,17 @@ Library           OperatingSystem
 Library           Collections
 Library           XML
 Library           SSHLibrary
-Variables         ../../../../csit/variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../../csit/libraries/Common.py
 Library           ../../../../csit/libraries/ScaleClient.py
+Variables         ../../../../csit/variables/Variables.py
+Resource          ../../../../csit/variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           17
 ${flnr}           17000
 ${swspread}       first
 ${tabspread}      first
-${topourl}        /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl}         /restconf/operational/opendaylight-inventory:nodes
 @{cntls}          ${ODL_SYSTEM_IP}
 
 *** Test Cases ***
@@ -63,7 +62,7 @@ Stop Switches
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index 6a08d09496e33b253890ee2281755409a2c7fdf5..9b5db1e656a011a50c093692a4ab7ea81fd0e92b 100644 (file)
@@ -6,18 +6,17 @@ Library           OperatingSystem
 Library           Collections
 Library           XML
 Library           SSHLibrary
-Variables         ../../../../csit/variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../../csit/libraries/Common.py
 Library           ../../../../csit/libraries/ScaleClient.py
+Variables         ../../../../csit/variables/Variables.py
+Resource          ../../../../csit/variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           17
 ${flnr}           17000
 ${swspread}       linear
 ${tabspread}      first
-${topourl}        /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl}         /restconf/operational/opendaylight-inventory:nodes
 @{cntls}          ${ODL_SYSTEM_IP}
 
 *** Test Cases ***
@@ -63,7 +62,7 @@ Stop Switches
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index aaacad29d0b5bc319ccc0218a627b5c833b188eb..df4d87aeea42f33d993f3bb204ed17dba4feef54 100644 (file)
@@ -10,6 +10,7 @@ Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/ScaleClient.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           16
@@ -111,7 +112,7 @@ Delete Http Session
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    ${OPERATIONAL_TOPO_API}/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
@@ -122,6 +123,6 @@ Check Flows Inventory
     Should Be True    ${res}
 
 Check No Switches Inventory
-    ${resp}=    Get Request    session    ${OPERATIONAL_NODES_API}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_NODES_API}
     Log    ${resp.content}
     Should Be Equal As Strings    '${resp.content}'    '{"nodes":{}}'
index 0e3394667162e64602afcd6af3df56f22c8df9a3..a300307a7bb3008330717d77917c0131b5eb2bc3 100644 (file)
@@ -11,6 +11,7 @@ Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/ScaleClient.py
 Resource          ../../../libraries/WaitForFailure.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           32
@@ -44,8 +45,8 @@ Configure Flows
     ${res}=    Configure Flows Bulk    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
     Log    ${res}
     Set Suite Variable    ${flows}
-    ${http204ok}=    Create List    ${204}
-    ${validation}=    Validate Responses    ${res}    ${http204ok}
+    ${http201ok}=    Create List    ${201}
+    ${validation}=    Validate Responses    ${res}    ${http201ok}
     Should Be True    ${validation}
     [Teardown]    Save Setup Time    setuptime    ${starttime}
 
@@ -78,8 +79,8 @@ Check Flows Are Operational Again
 
 Deconfigure Flows
     [Documentation]    Flows deconfiguration
-    ${resp}=    Delete Request    session    ${CONFIG_NODES_API}
-    Should Be Equal As Numbers    ${resp.status_code}    200
+    ${resp}=    Delete Request    session    ${RFC8040_NODES_API}
+    Should Be Equal As Numbers    ${resp.status_code}    204
 
 Check No Flows In Operational Last
     [Documentation]    Operational datastore to be without any flows
@@ -130,7 +131,7 @@ Delete Http Session And Store Plot Data
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    ${OPERATIONAL_TOPO_API}/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index 8a979e5e2f245bda295d46bddd15d4eca420ca9e..e9c5056cc29a734f553b895440c68203ebd1386e 100644 (file)
@@ -5,10 +5,11 @@ Suite Teardown    Delete Http Session And Store Plot Data
 Library           OperatingSystem
 Library           XML
 Library           SSHLibrary
-Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/ScaleClient.py
+Variables         ../../../variables/Variables.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${swnr}           63
@@ -99,7 +100,7 @@ Delete Http Session And Store Plot Data
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
-    ${resp}=    Get Request    session    ${OPERATIONAL_TOPO_API}/topology/flow:1    headers=${ACCEPT_XML}
+    ${resp}=    Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
     Log    ${resp.content}
     ${count}=    Get Element Count    ${resp.content}    xpath=node
     Should Be Equal As Numbers    ${count}    ${swnr}
index bd4f339020704ee62a7612b8e63e3bdd8ecbeacd..a6cfc444ccb8bf3620e2ff815b3cfa489333fe00 100644 (file)
@@ -8,6 +8,7 @@ Library           ../../../libraries/ScaleClient.py
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/ClusterOpenFlow.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
@@ -86,7 +87,7 @@ Stop Mininet And Verify
 Delete All Flows
     [Documentation]    100K Flows deleted and verify.
     ${config_datastore_delete_start_time}=    DateTime.Get Current Date    result_format=timestamp
-    ClusterManagement.Delete From Member    ${CONFIG_NODES_API}    1
+    ClusterManagement.Delete From Member    ${RFC8040_NODES_API}    1
     ${config_datastore_delete_end_time}=    Get Current Date    result_format=timestamp
     ${config_datastore_delete_time}=    Subtract Date From Date    ${config_datastore_delete_end_time}    ${config_datastore_delete_start_time}
     ${config_datastore_delete_rate}=    Evaluate    ${flow_count} / ${config_datastore_delete_time}
index 998b14fe9b96a2827319b758d8030c93d667fffe..53e54426463b16b5b34c289a60c59475c6080143 100644 (file)
@@ -101,7 +101,7 @@ Stop Mininet Connected To Follower Node1 After Reconcilliation
 Delete All Flows From Follower Node2
     [Documentation]    100K Flows deleted via Follower Node2 and verify it gets applied in all instances.
     ${config_datastore_delete_start_time}=    Get Current Date    result_format=timestamp
-    ClusterManagement.Delete From Member    ${CONFIG_NODES_API}    ${Follower_Node_2}
+    ClusterManagement.Delete From Member    ${RFC8040_NODES_API}    ${Follower_Node_2}
     ${config_datastore_delete_end_time}=    Get Current Date    result_format=timestamp
     ${config_datastore_delete_time}=    Subtract Date From Date    ${config_datastore_delete_end_time}    ${config_datastore_delete_start_time}
     ${config_datastore_delete_rate}=    Evaluate    ${flow_count} / ${config_datastore_delete_time}
index 434d107f5549c48c295535755c14d40a132dcdb4..137882772f969f58c1e5011f9a1c9eac11e85140 100644 (file)
@@ -9,6 +9,7 @@ Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${SWITCHES}       3
@@ -73,9 +74,9 @@ Check Linear Topology After Mininet Reconnects
 Remove Flows And Groups After Mininet Reconnects
     [Documentation]    Remove some groups and flows while network is down.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
-        RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
-        RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+        RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=1
+        RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1
+        RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1000
     END
 
 Check Flows In Operational DS After Mininet Reconnects
@@ -147,7 +148,7 @@ Final Phase
     [Documentation]    Delete all sessions.
     ${command} =    BuiltIn.Set Variable    sudo iptables -v -F
     Utils.Run Command On Controller    cmd=${command}
-    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
+    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
     RequestsLibrary.Delete All Sessions
 
 Disconnect Controller Mininet
index 1e726f0127cf576ca4847cbb1d82f9d276a65021..47be84e00b91f536bee4f75f307d71d6ce067b4b 100644 (file)
@@ -9,6 +9,7 @@ Library           ../../../libraries/XmlComparator.py
 Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${switch_idx}     1
@@ -48,25 +49,25 @@ Logging Initial Cluster Information
 Add Flow 1 To Controller1
     Init Flow Variables    1    1    1
     Log    ${data}
-    ${resp}=    Put Request    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    ${resp}=    Put Request    session1    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}    data=${data}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Add Flow 2 To Controller2
     Init Flow Variables    1    2    2
     Log    ${data}
-    ${resp}=    Put Request    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    ${resp}=    Put Request    session2    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}    data=${data}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Add Flow 3 To Controller3
     Init Flow Variables    1    3    3
     Log    ${data}
-    ${resp}=    Put Request    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    ${resp}=    Put Request    session3    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}    data=${data}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Show Switch Content After Add
@@ -78,7 +79,7 @@ Show Switch Content After Add
 
 Check Flow 1 Configured On Controller1
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -87,7 +88,7 @@ Check Flow 1 Configured On Controller1
 
 Check Flow 1 Operational On Controller1
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -96,7 +97,7 @@ Check Flow 1 Operational On Controller1
 
 Check Flow 1 Configured On Controller2
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -105,7 +106,7 @@ Check Flow 1 Configured On Controller2
 
 Check Flow 1 Operational On Controller2
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -114,7 +115,7 @@ Check Flow 1 Operational On Controller2
 
 Check Flow 1 Configured On Controller3
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -123,7 +124,7 @@ Check Flow 1 Configured On Controller3
 
 Check Flow 1 Operational On Controller3
     Init Flow Variables    1    1    1
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -132,7 +133,7 @@ Check Flow 1 Operational On Controller3
 
 Check Flow 2 Configured On Controller1
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -141,7 +142,7 @@ Check Flow 2 Configured On Controller1
 
 Check Flow 2 Operational On Controller1
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -150,7 +151,7 @@ Check Flow 2 Operational On Controller1
 
 Check Flow 2 Configured On Controller2
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -159,7 +160,7 @@ Check Flow 2 Configured On Controller2
 
 Check Flow 2 Operational On Controller2
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -168,7 +169,7 @@ Check Flow 2 Operational On Controller2
 
 Check Flow 2 Configured On Controller3
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -177,7 +178,7 @@ Check Flow 2 Configured On Controller3
 
 Check Flow 2 Operational On Controller3
     Init Flow Variables    1    2    2
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -186,7 +187,7 @@ Check Flow 2 Operational On Controller3
 
 Check Flow 3 Configured On Controller1
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -195,7 +196,7 @@ Check Flow 3 Configured On Controller1
 
 Check Flow 3 Operational On Controller1
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -204,7 +205,7 @@ Check Flow 3 Operational On Controller1
 
 Check Flow 3 Configured On Controller2
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -213,7 +214,7 @@ Check Flow 3 Configured On Controller2
 
 Check Flow 3 Operational On Controller2
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -222,7 +223,7 @@ Check Flow 3 Operational On Controller2
 
 Check Flow 3 Configured On Controller3
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
@@ -231,7 +232,7 @@ Check Flow 3 Configured On Controller3
 
 Check Flow 3 Operational On Controller3
     Init Flow Variables    1    3    3
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -240,23 +241,23 @@ Check Flow 3 Operational On Controller3
 
 Delete Flow 1 On Controller1
     Init Flow Variables    1    1    1
-    ${resp}=    Delete Request    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${resp}=    Delete Request    session1    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Delete Flow 2 On Controller2
     Init Flow Variables    1    2    2
-    ${resp}=    Delete Request    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${resp}=    Delete Request    session2    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Delete Flow 3 On Controller3
     Init Flow Variables    1    3    3
-    ${resp}=    Delete Request    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${resp}=    Delete Request    session3    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
     Log    ${resp.content}
-    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    ${msg}=    Set Variable    Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
 Show Switch Content After Delete
@@ -265,12 +266,12 @@ Show Switch Content After Delete
     Read Until    mininet>
 
 Check Flow 1 Not Configured On Controller1
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 1 Not Operational On Controller1
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -278,12 +279,12 @@ Check Flow 1 Not Operational On Controller1
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 1 Not Configured On Controller2
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 1 Not Operational On Controller2
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -291,12 +292,12 @@ Check Flow 1 Not Operational On Controller2
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 1 Not Configured On Controller3
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 1 Not Operational On Controller3
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -304,12 +305,12 @@ Check Flow 1 Not Operational On Controller3
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 2 Not Configured On Controller1
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 2 Not Operational On Controller1
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -317,12 +318,12 @@ Check Flow 2 Not Operational On Controller1
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 2 Not Configured On Controller2
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 2 Not Operational On Controller2
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -330,12 +331,12 @@ Check Flow 2 Not Operational On Controller2
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 2 Not Configured On Controller3
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 2 Not Operational On Controller3
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -343,12 +344,12 @@ Check Flow 2 Not Operational On Controller3
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 3 Not Configured On Controller1
-    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 3 Not Operational On Controller1
-    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session1    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -356,12 +357,12 @@ Check Flow 3 Not Operational On Controller1
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 3 Not Configured On Controller2
-    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 3 Not Operational On Controller2
-    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session2    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
@@ -369,12 +370,12 @@ Check Flow 3 Not Operational On Controller2
     Should Be Equal    ${False}    ${pres}    msg=${msg}
 
 Check Flow 3 Not Configured On Controller3
-    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Check Flow 3 Not Operational On Controller3
-    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    ${resp}=    Get Controller Response    session3    ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
index 408ffca0c0929ca1102de9ef6fc33bb392eb8c40..ba63894d93031deecdebed47194eaaaa148860cd 100644 (file)
@@ -5,19 +5,20 @@ Suite Teardown    Switch Qualification Suite Teardown
 Test Timeout      5m
 Library           Collections
 Library           OperatingSystem
-Resource          ../../../libraries/SwitchUtils.robot
-Resource          ../../../libraries/Utils.robot
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/SwitchUtils.robot
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${SWITCH_CLASS}    Ovs
 ${SWITCH_IP}      ${TOOLS_SYSTEM_IP}
 ${SWITCH_PROMPT}    ${TOOLS_SYSTEM_PROMPT}
 ${ODL_SYSTEM_IP}    null
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+${REST_CONTEXT}    ${RFC8040_NODES_API}
 
 *** Test Cases ***
 OF1.3 Connection Between Switch and Controller
index dc4450cce4845eb172076b8d4a2dd991443edb41..73ffa98fb4a921b8be12bbf5fcb56675154df49f 100644 (file)
@@ -93,10 +93,10 @@ Create And Remove Flow
     Call Method    ${test_switch}    create_flow_match_elements    ${flow.xml}
     Log    ${test_switch.flow_validations}
     ${dpid_id}=    Get Switch Datapath ID    ${test_switch}
-    Wait Until Keyword Succeeds    3s    1s    Add Flow To Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}
+    Wait Until Keyword Succeeds    3s    1s    Add Flow To Controller And Verify    ${flow.xml}    openflow%3A${dpid_id}    ${flow.table_id}
     ...    ${flow.id}
     Wait Until Keyword Succeeds    3s    1s    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
-    Wait Until Keyword Succeeds    3s    1s    Remove Flow From Controller And Verify    openflow:${dpid_id}    ${flow.table_id}    ${flow.id}
+    Wait Until Keyword Succeeds    3s    1s    Remove Flow From Controller And Verify    openflow%3A${dpid_id}    ${flow.table_id}    ${flow.id}
     Wait Until Keyword Succeeds    3s    1s    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
     ...    false
 
index c5ba23c22ea8250f635bd39dfda58b9ea611e0df..9f519658f0413b16fb6d6f85244a403c3a3e9bea 100644 (file)
@@ -192,7 +192,10 @@ PASSWORD = "EMPTY"
 AUTH = [u"admin", u"admin"]
 SCOPE = "sdn"
 HEADERS = {"Content-Type": "application/json"}
-HEADERS_YANG_JSON = {"Content-Type": "application/yang.data+json"}
+# FIXME: keep it as 'application/json' to make it work for both Bierman02
+#  and RFC8040 URLs. Change it to RFC8040 media type once RFC8040 migration
+#  is completed.
+HEADERS_YANG_JSON = {"Content-Type": "application/json"}
 HEADERS_XML = {"Content-Type": "application/xml"}
 ACCEPT_XML = {"Accept": "application/xml"}
 ACCEPT_JSON = {"Accept": "application/json"}
index 8e4ddd3f822598a3380656aecf9ac724d8b44226..7f4621416c2747986463366c2336fd972218aff7 100644 (file)
@@ -91,7 +91,7 @@ ${GET_CONFIGURATION_URI}    /restconf/operational/configuration:configurationRec
 ${GET_DASHBOARDRECORD}    /restconf/operational/dashboardrule:dashboardRecord/    # FIXME: Move to a separate Centinel-related Resource and add description.
 ${GET_INTENTS_URI}    /retconf/config/intent:intents    # FIXME: Move to a separate Nemo-related Resource and add description.
 &{HEADERS}        Content-Type=application/json    # Deprecated. Sometimes conflicts with argument name. TODO: Migrate most suites to TemplatedRequests, then chose a more descriptive name.
-&{HEADERS_YANG_JSON}    Content-Type=application/yang.data+json    # Content type for JSON data, used to work around Requests auto-serialization. TODO: Hide into more specific Resource if possible.
+&{HEADERS_YANG_JSON}    Content-Type=application/json    # Content type for JSON data, used to work around Requests auto-serialization. FIXME: keep it as 'application/json' to make it work for both Bierman02 & RFC8040 URLs. Change it to RFC8040 media type once RFC8040 migration is completed.
 &{HEADERS_YANG_RFC8040_JSON}    Content-Type=application/yang-data+json
 &{HEADERS_XML}    Content-Type=application/xml    # Content type for XML data. TODO: Hide into more specific Resource if possible.
 ${KARAF_PROMPT_LOGIN}    opendaylight-user    # This is used for karaf console login.
diff --git a/csit/variables/openflowplugin/Variables.robot b/csit/variables/openflowplugin/Variables.robot
new file mode 100644 (file)
index 0000000..fbbd90c
--- /dev/null
@@ -0,0 +1,14 @@
+*** Settings ***
+Documentation     Resource file containing OpenFlow Plugin variables.
+
+*** Variables ***
+${RFC8040_RESTCONF_ROOT}    /rests
+${RFC8040_DATA_RESOURCE}    ${RFC8040_RESTCONF_ROOT}/data
+${RFC8040_CONFIG_CONTENT}    content=config
+${RFC8040_OPERATIONAL_CONTENT}    content=nonconfig
+${RFC8040_NODES_API}    ${RFC8040_DATA_RESOURCE}/opendaylight-inventory:nodes
+${RFC8040_CONFIG_NODES_API}    ${RFC8040_NODES_API}?${RFC8040_CONFIG_CONTENT}
+${RFC8040_OPERATIONAL_NODES_API}    ${RFC8040_NODES_API}?${RFC8040_OPERATIONAL_CONTENT}
+${RFC8040_TOPO_API}    ${RFC8040_DATA_RESOURCE}/network-topology:network-topology
+${RFC8040_OPERATIONAL_TOPO_API}    ${RFC8040_TOPO_API}?${RFC8040_OPERATIONAL_CONTENT}
+${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    ${RFC8040_TOPO_API}/topology=flow%3A1?${RFC8040_OPERATIONAL_CONTENT}