diff options
author | 2017-08-30 14:50:43 -0500 | |
---|---|---|
committer | 2017-08-30 19:17:56 -0500 | |
commit | e746700a7dfe469bb65a54d04a5d2202d7f56e9e (patch) | |
tree | f20096bfb8f132d9346aaff5baa1f578fae8a639 /bootstrap/vagrant-onap/lib/asserts | |
parent | 2fd432a29edd1117703d464cccb9831a57109449 (diff) |
Create UTs for SDC
This change create a script that contains Unit Tests that covers
functionality of SDC component.
Change-Id: Ie51dac0fe112319da3f9522cdb36ac7de49d523d
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-16
Diffstat (limited to 'bootstrap/vagrant-onap/lib/asserts')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/asserts | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/bootstrap/vagrant-onap/lib/asserts b/bootstrap/vagrant-onap/lib/asserts deleted file mode 100755 index 02c269b4c..000000000 --- a/bootstrap/vagrant-onap/lib/asserts +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -o xtrace - -source /var/onap/commons - -# 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 -} - -# raise_error() - Function that prints and exits the execution -function raise_error { - echo $@ - exit 1 -} |