Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hello2mao committed Feb 27, 2019
1 parent 579c32f commit cf6b4cf
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/create-and-delete/create-and-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand Down
57 changes: 57 additions & 0 deletions test/feature-test/run.sh
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 2 additions & 1 deletion test/test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

./create-and-delete/create-and-delete.sh
./test/feature-test/run.sh
./test/create-and-delete/create-and-delete.sh

0 comments on commit cf6b4cf

Please sign in to comment.