aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/asserts
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-03-13 12:36:55 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-03-15 16:58:22 +0000
commitdf17a7ff9ba569227e8a2b5b1863800bbb8e1806 (patch)
tree749011aaf1b514e17c31edd9c12252a95f0aec18 /bootstrap/vagrant-onap/tests/asserts
parent1393fc2533cae1271126498f1661dec893922dae (diff)
Deprecate vagrant-onap tool
The vagrant-onap tool needs to be moved to its own repo to have better control of versions and autonomy. This change removes the project from integration repository. Change-Id: I90bd4505a9fc7376c31a780aa1b833ee2663af3e Signed-off-by: Victor Morales <victor.morales@intel.com> Depends-On: I79df8c35fccaa266a789217d441a6cf1183bd42a Issue-ID: INT-441
Diffstat (limited to 'bootstrap/vagrant-onap/tests/asserts')
-rwxr-xr-xbootstrap/vagrant-onap/tests/asserts94
1 files changed, 0 insertions, 94 deletions
diff --git a/bootstrap/vagrant-onap/tests/asserts b/bootstrap/vagrant-onap/tests/asserts
deleted file mode 100755
index 441b9f091..000000000
--- a/bootstrap/vagrant-onap/tests/asserts
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-
-source /var/onap/commons
-
-# asserts_http_status_code() - Function that determines if a HTTP status code is retrieved from URL
-function asserts_http_status_code {
- local url=$1
- local expected_code=${2:-"200"}
-
- code=$(curl -I $url | head -n 1 | cut -d$' ' -f2)
- local error_msg=${3:-"The URL $url responded with $code status code"}
- if [[ "$code" != "$expected_code" ]]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_process() - Function that verifies if a specific process is running
-function asserts_process {
- local process=$1
- local error_msg=${2:-"There is no $process running process"}
-
- if [[ "ps -ef | grep $process" == "" ]]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_java_process() - Function that verifies if a specific java process is running
-function asserts_java_process {
- local process=$1
- local error_msg=${2:-"There is no $process java running process"}
-
- install_java
- if [[ "jps | grep $process" == "" ]]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_image_running() - Function that verifies if a specific image is running
-function asserts_image_running {
- local image=$1
- local error_msg=${2:-"There is no process with $image image running"}
-
- asserts_image $image
- if [[ "$(docker ps -q --filter=ancestor=$image 2> /dev/null)" == "" ]]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_image() - Function that verifies if a specific image was created
-function asserts_image {
- local image=$1
- local error_msg=${2:-"There is no $image image"}
-
- install_docker
- if [[ "$(docker images -q $image 2> /dev/null)" == "" ]]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_installed_package() - Function that verifies if a specific package was installed.
-function asserts_installed_package {
- local package=$1
- local error_msg=${2:-"$package wasn't installed"}
-
- if ! is_package_installed $package; then
- raise_error $error_msg
- fi
-}
-
-# asserts_file_exist() - Function that verifies if a specific file exists
-function asserts_file_exist {
- local file=$1
- local error_msg=${2:-"$file doesn't exist"}
-
- if [ ! -f $file ]; then
- raise_error $error_msg
- fi
-}
-
-# asserts_env_set() - Function that verities that an environment variable is set
-function asserts_env_set {
- local variable=$1
- local error_msg=${2:-"$variable wasn't set"}
-
- if [ -z ${variable+x} ]; then
- raise_error $error_msg
- fi
-}
-
-# raise_error() - Function that prints and exits the execution
-function raise_error {
- echo $@
- exit 1
-}