X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fbpa-restapi-agent%2Fe2e_test.sh;h=4742bdb812f10aaf85f56a88c918ce8541f77501;hb=7b08cb3771bb25a9263e57b20f80b73bacaefbe0;hp=cc41f21ca1779d701cbc4037d45b295be23e1435;hpb=eda032105bcd4f912f65adfbeb31116a65527783;p=icn.git diff --git a/cmd/bpa-restapi-agent/e2e_test.sh b/cmd/bpa-restapi-agent/e2e_test.sh index cc41f21..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 @@ -44,6 +46,7 @@ while [[ $cur_status != "Running" ]]; do 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 fi @@ -53,6 +56,7 @@ while [[ $cur_status != "Running" ]]; do sleep 10 done +sleep 30 #Get CLusterIP IP=$(kubectl get services | grep bpa-api-service | awk '{print $3}') @@ -68,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