summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-04-17 14:17:12 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-17 14:17:12 +0000
commit6aa35fea1cd04a94a344369fa86a03002e0d9f71 (patch)
treea06580ef7c749562050c541ae2d9fa270343550c /test
parent5faf6f21782da48fc8514235967aa4e4d8bfe6b1 (diff)
parent2ed7febc2e78e61ace37db9f1dab56333756d1da (diff)
Merge "Add scripts for CSIT NBI"
Diffstat (limited to 'test')
-rw-r--r--test/csit/plans/externalapi-nbi/healthcheck/setup.sh17
-rw-r--r--test/csit/plans/externalapi-nbi/healthcheck/teardown.sh17
-rw-r--r--test/csit/plans/externalapi-nbi/healthcheck/testplan.txt3
-rw-r--r--test/csit/tests/externalapi-nbi/healthcheck/__init__.robot2
-rw-r--r--test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot29
5 files changed, 68 insertions, 0 deletions
diff --git a/test/csit/plans/externalapi-nbi/healthcheck/setup.sh b/test/csit/plans/externalapi-nbi/healthcheck/setup.sh
new file mode 100644
index 000000000..50da7ad6a
--- /dev/null
+++ b/test/csit/plans/externalapi-nbi/healthcheck/setup.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# ========================================================================
+# Copyright (c) 2018 Orange
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========================================================================
+
+source ${WORKSPACE}/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh
diff --git a/test/csit/plans/externalapi-nbi/healthcheck/teardown.sh b/test/csit/plans/externalapi-nbi/healthcheck/teardown.sh
new file mode 100644
index 000000000..83929723b
--- /dev/null
+++ b/test/csit/plans/externalapi-nbi/healthcheck/teardown.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# ========================================================================
+# Copyright (c) 2018 Orange
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========================================================================
+
+source ${WORKSPACE}/test/csit/scripts/externalapi-nbi/delete_nbi_containers.sh \ No newline at end of file
diff --git a/test/csit/plans/externalapi-nbi/healthcheck/testplan.txt b/test/csit/plans/externalapi-nbi/healthcheck/testplan.txt
new file mode 100644
index 000000000..06622ae7b
--- /dev/null
+++ b/test/csit/plans/externalapi-nbi/healthcheck/testplan.txt
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [integration.git]/test/csit/tests/.
+# Place the suites in run order.
+externalapi-nbi/healthcheck
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