rename attach_detach_test.sh and attach_detach_test_portworx.sh

This commit is contained in:
umagnus 2023-02-02 02:34:34 +00:00
Родитель 20598cd421
Коммит 8003742d65
4 изменённых файлов: 13 добавлений и 13 удалений

10
test/attach_detach_test.sh Executable file → Normal file
Просмотреть файл

@ -1,5 +1,5 @@
# use sh attach_detach_test.sh 500 default file.txt to test 500 pods with default sc and write results in file.txt.
# attach_detach_test.sh use pod in running state for attach test and pv deletion for detach test.
# attach_detach_test.sh use pod in running state for attach test and volumeattachments in false for detach test.
kubectl create ns test
predate=$(date +"%Y-%m-%d %H:%M:%S")
pvcflag=0
@ -157,26 +157,26 @@ spec:
storage: 1Gi
EOF
kubectl delete pvc -n test --all &
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
while [ $detachnum -ge $((p100-p50+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
done
echo "detach p50: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
while [ $detachnum -ge $((p100-p90+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
done
echo "detach p90: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
while [ $detachnum -ge $((p100-p99+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
done
echo "detach p99: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
kubectl delete ns test

Просмотреть файл

@ -1,5 +1,5 @@
# use sh attach_detach_test_v2.sh 500 default file.txt to test 500 pods with default sc and write results in file.txt.
# attach_detach_test_v2.sh use pod in running state for attach test and volumeattachments in false for detach test.
# use sh attach_detach_test_portworx.sh 500 default file.txt to test 500 pods with default sc and write results in file.txt.
# attach_detach_test_portworx.sh use pod in running state for attach test and pv deletion for detach test.
kubectl create ns test
predate=$(date +"%Y-%m-%d %H:%M:%S")
pvcflag=0
@ -157,26 +157,26 @@ spec:
storage: 1Gi
EOF
kubectl delete pvc -n test --all &
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
while [ $detachnum -ge $((p100-p50+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
done
echo "detach p50: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
while [ $detachnum -ge $((p100-p90+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
done
echo "detach p90: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
while [ $detachnum -ge $((p100-p99+1)) ]
do
sleep 1
date1=$(date +"%Y-%m-%d %H:%M:%S")
detachnum=$(kubectl get volumeattachments -n test | grep true | grep pvc- | awk 'END{print NR}')
detachnum=$(kubectl get pv | grep pvc- | awk 'END{print NR}')
done
echo "detach p99: $(( $(date -d "$date1" "+%s") - $(date -d "$predate" "+%s") ))" >> $3
kubectl delete ns test

Просмотреть файл

@ -3,7 +3,7 @@
for i in $(seq $4)
do
echo "`date` test $i" >> $3
curl -skSL https://raw.githubusercontent.com/Azure/kubernetes-volume-drivers/master/test/attach_detach_test_v2.sh | bash -s $1 $2 $3 --
curl -skSL https://raw.githubusercontent.com/Azure/kubernetes-volume-drivers/master/test/attach_detach_test.sh | bash -s $1 $2 $3 --
echo "sleep 10 minutes ..." >> $3
sleep 10m
done

Просмотреть файл

@ -3,7 +3,7 @@
for i in $(seq $4)
do
echo "`date` test $i" >> $3
curl -skSL https://raw.githubusercontent.com/Azure/kubernetes-volume-drivers/master/test/attach_detach_test.sh | bash -s $1 $2 $3 --
curl -skSL https://raw.githubusercontent.com/Azure/kubernetes-volume-drivers/master/test/attach_detach_test_portworx.sh | bash -s $1 $2 $3 --
echo "sleep 10 minutes ..." >> $3
sleep 10m
done