X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fbpa-restapi-agent%2Fe2e_test.sh;h=4742bdb812f10aaf85f56a88c918ce8541f77501;hb=05c811aa5aeaf4c7e630ff0c46be2240478235a0;hp=09c45822be5a646b4cde6490df3291237b569f6a;hpb=149466f046765ee3851a155be749ec0e27f35b30;p=icn.git diff --git a/cmd/bpa-restapi-agent/e2e_test.sh b/cmd/bpa-restapi-agent/e2e_test.sh index 09c4582..4742bdb 100755 --- a/cmd/bpa-restapi-agent/e2e_test.sh +++ b/cmd/bpa-restapi-agent/e2e_test.sh @@ -1,8 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash +set -eu -o pipefail ICN_DIR=$(dirname "$(dirname "$PWD")") source "$ICN_DIR/env/lib/common.sh" +source "$ICN_DIR/deploy/kud-plugin-addons/minio/lib/minio.sh" #create sample image if true ; then @@ -36,24 +38,25 @@ if true ; then EOF fi -curr_status="" +cur_status="" -while [[ $curr_status != "Running" ]]; do +while [[ $cur_status != "Running" ]]; do + + cur_status=$(kubectl get pods | grep bpa-api-deployment | awk '{print $3}') + if [[ $cur_status != "Running" ]]; then + echo "$(date +%H:%M:%S) - BPA-RESTful-API Pod status: $cur_status" + else + echo "$(date +%H:%M:%S) - BPA-RESTful-API Pod status: $cur_status" + break - new_status=$(kubectl get pods | grep bpa-api-deployment | awk '{print $3}') - if [[ $new_status != $curr_status ]]; then - echo "$(date +%H:%M:%S) - BPA-RESTful-API Pod status: $new_status" - curr_status=$new_status - if [[ $new_status == "Running" ]]; then - break - fi fi - if [[ $new_status == "Err"* ]]; then + if [[ $cur_status == "Err"* ]]; then exit 1 fi sleep 10 done +sleep 30 #Get CLusterIP IP=$(kubectl get services | grep bpa-api-service | awk '{print $3}') @@ -69,5 +72,13 @@ call_api --request PATCH --data-binary "@/tmp/sample_image" \ http://$IP:9015/v1/baremetalcluster/alpha/beta/container_images/qwerty123 \ --header "Upload-Offset: 0" --header "Expect:" -i +MINIO_IP=$(kubectl get services | grep minio-service | awk '{print $3}') +setup_mc $MINIO_IP +obj_size=$(get_object_size container qwerty123) +echo "Got obj size: $obj_size" +if [[ $obj_size != $IMAGE_SIZE ]]; then + exit 1 +fi + call_api -i -X DELETE \ http://$IP:9015/v1/baremetalcluster/alpha/beta/container_images/qwerty123