diff --git a/test/create-and-delete/create-and-delete.sh b/test/create-and-delete/create-and-delete.sh index 476f95d..5f8c87e 100755 --- a/test/create-and-delete/create-and-delete.sh +++ b/test/create-and-delete/create-and-delete.sh @@ -5,7 +5,7 @@ startTime_s=`date +%s` for i in `seq 1 2`; do - kubectl create -f nginx.yaml + kubectl create -f ./test/create-and-delete/nginx.yaml status="Check: " while true do @@ -16,7 +16,7 @@ do status=$status"." echo $status done - kubectl delete -f nginx.yaml + kubectl delete -f ./test/create-and-delete/nginx.yaml done endTime=`date +%Y%m%d-%H:%M` diff --git a/test/feature-test/run.sh b/test/feature-test/run.sh new file mode 100755 index 0000000..977a799 --- /dev/null +++ b/test/feature-test/run.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +startTime=`date +%Y%m%d-%H:%M` +startTime_s=`date +%s` + +echo "Test Nginx" +kubectl create -f ./docs/controllers/service/examples/nginx.yaml +status="Check: " +while true +do + if [ `kubectl get service |grep "nginx-service"|grep -v "pending"|wc -l` -eq 1 ]; then + break + fi + sleep 10 + status=$status"." + echo $status +done +kubectl delete -f ./docs/controllers/service/examples/nginx.yaml +echo "Test Nginx success" +echo "" + +echo "Test BLB allocate vip" +kubectl create -f ./docs/controllers/service/examples/nginx-BLB-allocate-vip.yaml +status="Check: " +while true +do + if [ `kubectl get service |grep "nginx-service-blb-allocate-vip"|grep -v "pending"|wc -l` -eq 1 ]; then + break + fi + sleep 10 + status=$status"." + echo $status +done +kubectl delete -f ./docs/controllers/service/examples/nginx-BLB-allocate-vip.yaml +echo "Test BLB allocate vip success" +echo "" + +echo "Test BLB support internal vpc" +kubectl create -f ./docs/controllers/service/examples/nginx-BLB-support-internal-vpc.yaml +status="Check: " +while true +do + if [ `kubectl get service |grep "nginx-service-blb-internal-vpc"|grep -v "pending"|wc -l` -eq 1 ]; then + break + fi + sleep 10 + status=$status"." + echo $status +done +kubectl delete -f ./docs/controllers/service/examples/nginx-BLB-support-internal-vpc.yaml +echo "Test BLB support internal vpc success" +echo "" + +endTime=`date +%Y%m%d-%H:%M` +endTime_s=`date +%s` +sumTime=$[ $endTime_s - $startTime_s ] +echo "Test Finish: feature-test" "$startTime ---> $endTime" "Total: $sumTime s" \ No newline at end of file diff --git a/test/test.sh b/test/test.sh old mode 100644 new mode 100755 index a7e0acc..b3ecdfb --- a/test/test.sh +++ b/test/test.sh @@ -1,3 +1,4 @@ #!/bin/sh -./create-and-delete/create-and-delete.sh \ No newline at end of file +./test/feature-test/run.sh +./test/create-and-delete/create-and-delete.sh \ No newline at end of file