Add initial codes
[it/test.git] / ric_robot_suite / robot / resources / e2sim / e2sim_tools.robot
diff --git a/ric_robot_suite/robot/resources/e2sim/e2sim_tools.robot b/ric_robot_suite/robot/resources/e2sim/e2sim_tools.robot
new file mode 100644 (file)
index 0000000..ecfad8e
--- /dev/null
@@ -0,0 +1,33 @@
+*** Settings ***
+Documentation     Routines for managing interactions with the E2 Simulator
+
+Resource          ../global_properties.robot
+
+Library           KubernetesEntity  ${NAMESPACE}
+Library           E2SimUtils        ${DBHOST}     ${DBPORT}
+
+
+*** Variables ***
+${DBHOST}         ${GLOBAL_INJECTED_DBAAS_IP_ADDR}
+${DBPORT}         ${GLOBAL_DBAAS_SERVER_PORT}
+${NAMESPACE}      %{RICPLT_NAMESPACE}
+${PFX}            %{RICPLT_RELEASE_NAME}
+
+*** Keywords ***
+Generate RAN Name
+     [Documentation]    Generate a new RAN name suitable for use with E2
+     [Arguments]        ${ran_name_prefix}=${EMPTY}
+     ${resp} =          randomRANName   ${ran_name_prefix}
+     [Return]           ${resp}
+
+Delete RAN Database Entry
+     [Documentation]                Delete the RNIB record for a specific RAN Name
+     [Arguments]                    ${ran_name}
+     ${gnbs} =                      gNodeBDelete    ${ran_name}
+     Dictionary Should Contain Key  ${gnbs}         ${ran_name}
+
+Restart E2 Simulator
+     [Documentation]                Restart all E2Sim pods
+     [Arguments]                    ${deployment}=${PFX}-e2sim
+     ${resp} =                      Redeploy        ${deployment}
+     [Return]                       ${resp}