X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Frobot%2Fresources%2Fappmgr%2Fappmgr_interface.robot;h=c346e958a7b628fe3d4010af3a53669e398db767;hb=e41f46a29c4d635ee3f864e36cfd0ac123bac4ec;hp=b8b301e29195a5375ad7aa857209424bf3e862b6;hpb=5162e70ecb4140f217cc6838014967c2fbb19aba;p=it%2Ftest.git diff --git a/ric_robot_suite/robot/resources/appmgr/appmgr_interface.robot b/ric_robot_suite/robot/resources/appmgr/appmgr_interface.robot index b8b301e..c346e95 100644 --- a/ric_robot_suite/robot/resources/appmgr/appmgr_interface.robot +++ b/ric_robot_suite/robot/resources/appmgr/appmgr_interface.robot @@ -5,6 +5,8 @@ Library RequestsLibrary Resource ../global_properties.robot +Resource ../ric/ric_utils.robot + *** Variables *** ${APPMGR_BASE_PATH} /ric/v1/xapps ${APPMGR_ENDPOINT} ${GLOBAL_APPMGR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPMGR_IP_ADDR}:${GLOBAL_APPMGR_SERVER_PORT} @@ -70,7 +72,7 @@ Undeploy XApps Deploy All Available XApps [Documentation] Attempt to deploy any not-currently-deployed XApp @{d} = Get Deployed XApps - @{deployed} = Pluck Name ${d} + @{deployed} = Pluck name ${d} @{available} = Get Deployable XApps @{toDeploy} = Subtract From List ${available} ${deployed} Deploy XApps @{toDeploy} @@ -78,7 +80,7 @@ Deploy All Available XApps Undeploy All Running XApps [Documentation] Undeploy any deployed XApps @{d} = Get Deployed XApps - @{deployed} = Pluck Name ${d} + @{deployed} = Pluck name ${d} Run Keyword If ${deployed} Undeploy XApps @{deployed} Run AppMgr GET Request @@ -104,20 +106,3 @@ Run AppMgr DELETE Request ${headers} = Create Dictionary Accept=application/json Content-Type=application/json ${resp} = Delete Request roboAppmgrDelete ${APPMGR_BASE_PATH}${path} headers=${headers} [Return] ${resp} - - -# a few useful list routines that should probably live elsewhere -Pluck - [Documentation] Get the values of a specific key from a list of dictionaries - [Arguments] ${k} ${l} - @{names} = Evaluate filter(lambda v: v != None, [i.get(${k}, None) for i in ${l}]) - [Return] ${names} - -Subtract From List - [Documentation] Remove the elements of the second argument from the first - [Arguments] ${x} ${y} - ${diff} = Run Keyword If ${y} - ... Evaluate filter(lambda v: v not in ${y}, ${x}) - ... ELSE - ... Set Variable ${x} - [Return] ${diff}