aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests
diff options
context:
space:
mode:
authorEric Debeau <eric.debeau@orange.com>2018-04-17 07:11:57 +0000
committerEric Debeau <eric.debeau@orange.com>2018-04-17 07:15:28 +0000
commit2ed7febc2e78e61ace37db9f1dab56333756d1da (patch)
tree34d24411d21b0c45c342bca4f6d7eb44568b7151 /test/csit/tests
parentbab2f61a120f2cd15fe1ee6887a4e6d8ca3d8d5f (diff)
Add scripts for CSIT NBI
Create directory test/csit/tests/externalapi-nbi Create setup.sh, teardown.sh scripts Create testplan.txt Create directory test/csit/plans/externalapi-nbi Create heathcheck.robot Change-Id: I485e739bca48aecb62ed9b1b1e5fd910775735a8 Issue-ID: EXTAPI-76 Signed-off-by: Eric Debeau <eric.debeau@orange.com>
Diffstat (limited to 'test/csit/tests')
-rw-r--r--test/csit/tests/externalapi-nbi/healthcheck/__init__.robot2
-rw-r--r--test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot29
2 files changed, 31 insertions, 0 deletions
diff --git a/test/csit/tests/externalapi-nbi/healthcheck/__init__.robot b/test/csit/tests/externalapi-nbi/healthcheck/__init__.robot
new file mode 100644
index 000000000..826350785
--- /dev/null
+++ b/test/csit/tests/externalapi-nbi/healthcheck/__init__.robot
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation ExternalAPI-NBI - healthcheck
diff --git a/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot
new file mode 100644
index 000000000..eb5a5bb4f
--- /dev/null
+++ b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot
@@ -0,0 +1,29 @@
+*** Settings ***
+Documentation The main interface for interacting with External API/NBI
+Library RequestsLibrary
+
+*** Variables ***
+${GLOBAL_NBI_SERVER_PROTOCOL} http
+${GLOBAL_INJECTED_NBI_IP_ADDR} localhost
+${GLOBAL_NBI_SERVER_PORT} 8080
+${NBI_HEALTH_CHECK_PATH} /nbi/api/v1/status
+${NBI_ENDPOINT} ${GLOBAL_NBI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_NBI_IP_ADDR}:${GLOBAL_NBI_SERVER_PORT}
+
+
+*** Keywords ***
+Run NBI Health Check
+ [Documentation] Runs NBI Health check
+ ${resp}= Run NBI Get Request ${NBI_HEALTH_CHECK_PATH}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+Run NBI Get Request
+ [Documentation] Runs NBI Get request
+ [Arguments] ${data_path}
+ ${session}= Create Session session ${NBI_ENDPOINT}
+ ${resp}= Get Request session ${data_path}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Log Received response from NBI ${resp.text}
+ ${json}= Set Variable ${resp.json()}
+ ${status}= Get From Dictionary ${json} status
+ Should Be Equal ${status} ok
+ [Return] ${resp} \ No newline at end of file