Update mapping for 'Post As Json Templated' 40/98640/2
authorSangwook Ha <sangwook.ha@verizon.com>
Mon, 22 Nov 2021 21:37:50 +0000 (13:37 -0800)
committerSangwook Ha <sangwook.ha@verizon.com>
Mon, 22 Nov 2021 21:41:07 +0000 (13:41 -0800)
Now 'mapping' for the *_As_*_Templated keywords should be
a dictionary and the value of the 'mapping' dictionary is
percent-encoded with an expectation that the value will replace
the value placeholder of the RFC8040 list segment.

Update OpenFlow plugin test cases using the keywords to provide
a dictionary. Also, replace the Bierman02 URL still used in the URL
templates, and change the placeholder to the value of the node list,
instead of just switch ID.

Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Change-Id: I0de33bd5670fdd8f11f464dfdd67b72b792688db

csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot
csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot
csit/variables/openflowplugin/add-flow/location.uri
csit/variables/openflowplugin/add-group-1/location.uri
csit/variables/openflowplugin/add-group-2/location.uri

index 830736df87b6d8b3f30016e5ef61f79c042ceaa8..7dde5d13e92c58a553c479e9f67e711c69a483dd 100644 (file)
@@ -384,9 +384,10 @@ Add Groups And Flows On Member
     [Documentation]    Add ${ITER} groups type 1 & 2 and flows in every switch.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
     FOR    ${switch}    IN RANGE    1    ${switches+1}
     [Documentation]    Add ${ITER} groups type 1 & 2 and flows in every switch.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-1    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-2    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-flow    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
+        &{mapping}    BuiltIn.Create_Dictionary    NODE=openflow:${switch}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-1    mapping=${mapping}    session=${session}    iterations=${iter}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-2    mapping=${mapping}    session=${session}    iterations=${iter}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-flow    mapping=${mapping}    session=${session}    iterations=${iter}
     END
 
 Add Single Group And Flow On Member
     END
 
 Add Single Group And Flow On Member
index 137882772f969f58c1e5011f9a1c9eac11e85140..7f861b85ae4c04be30205307edeb7388beb40d0d 100644 (file)
@@ -20,19 +20,22 @@ ${VAR_DIR}        ${CURDIR}/../../../variables/openflowplugin
 Add Group 1 In Every Switch
     [Documentation]    Add ${ITER} groups of type 1 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
 Add Group 1 In Every Switch
     [Documentation]    Add ${ITER} groups of type 1 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-1    mapping={"SWITCH":"${switch}"}    session=session    iterations=${iter}
+        &{mapping}    BuiltIn.Create_Dictionary    NODE=openflow:${switch}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-1    mapping=${mapping}    session=session    iterations=${iter}
     END
 
 Add Group 2 In Every Switch
     [Documentation]    Add ${ITER} groups of type 2 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
     END
 
 Add Group 2 In Every Switch
     [Documentation]    Add ${ITER} groups of type 2 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-2    mapping={"SWITCH":"${switch}"}    session=session    iterations=${iter}
+        &{mapping}    BuiltIn.Create_Dictionary    NODE=openflow:${switch}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-2    mapping=${mapping}    session=session    iterations=${iter}
     END
 
 Add Flow to Group 2 In Every Switch
     [Documentation]    Add ${ITER} flows to group type 2 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
     END
 
 Add Flow to Group 2 In Every Switch
     [Documentation]    Add ${ITER} flows to group type 2 in every switch.
     FOR    ${switch}    IN RANGE    1    ${switches+1}
-        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-flow    mapping={"SWITCH":"${switch}"}    session=session    iterations=${ITER}
+        &{mapping}    BuiltIn.Create_Dictionary    NODE=openflow:${switch}
+        TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-flow    mapping=${mapping}    session=session    iterations=${ITER}
     END
 
 Start Mininet Linear
     END
 
 Start Mininet Linear
index 4d8d168b989e86d81554d277a1f3da58e0a4805a..6f1070ac164a768fdac531c63e853c090d1a6c58 100644 (file)
@@ -1 +1 @@
-/restconf/config/opendaylight-inventory:nodes/node/openflow:$SWITCH/table/0
+/rests/data/opendaylight-inventory:nodes/node=$NODE/table=0
index 5d259a2b9c263e56d540b3014170acadf52b2b03..9cb383d076505ab777d0cf1fa359791b213c3e63 100644 (file)
@@ -1 +1 @@
-/restconf/config/opendaylight-inventory:nodes/node/openflow:$SWITCH
+/rests/data/opendaylight-inventory:nodes/node=$NODE
index 5d259a2b9c263e56d540b3014170acadf52b2b03..9cb383d076505ab777d0cf1fa359791b213c3e63 100644 (file)
@@ -1 +1 @@
-/restconf/config/opendaylight-inventory:nodes/node/openflow:$SWITCH
+/rests/data/opendaylight-inventory:nodes/node=$NODE