-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegrationTesting.sh
More file actions
49 lines (46 loc) · 1.57 KB
/
Copy pathIntegrationTesting.sh
File metadata and controls
49 lines (46 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
if $IsIntegrationTestingTask -eq "true" ; then
echo "start Integration testing..."
curl -XPOST --silent --show-error --user ${TiggerUser}:${TiggerToken} ${TiggerAddress}
fi
GREP_RETURN_CODE=0
sleep 30
for ((i=0; i<=20; i++)); do
curl --silent ${QueryAddress} | grep result\":\"SUCCESS\" > /dev/null
GREP_RETURN_CODE=$?
if [ $GREP_RETURN_CODE -eq "0" ] ; then
echo "Integration testing SUCCESS !"
if $IsIntegrationTestingTask -eq "true" ; then
curl --silent ${QueryAddress} | grep -o '"totalCount[^,]*' >tmp.txt
TOTAL_COUNT=$(<tmp.txt)
curl --silent ${QueryAddress} | grep -o '"duration[^,]*' >tmp.txt
DURATION=$(cut -d ":" -f 2 tmp.txt)
TEST_MIN=$[DURATION / 60 / 1000]
TEST_SEC=$[DURATION /1000 % 60]
echo "$TOTAL_COUNT ,duration:$TEST_MIN min $TEST_SEC sec"
fi
exit 0
fi
curl --silent ${QueryAddress} | grep result\":\"FAILURE\" > /dev/null
GREP_RETURN_CODE=$?
if [ $GREP_RETURN_CODE -eq "0" ] ; then
echo "Integration testing FAILURE !"
if $IsIntegrationTestingTask -eq "true" ; then
curl --silent ${QueryAddress} | grep -o '"totalCount[^,]*' >tmp.txt
TOTAL_COUNT=$(<tmp.txt)
curl --silent ${QueryAddress} | grep -o '"failCount[^,]*' >tmp.txt
FAIL_COUNT=$(<tmp.txt)
curl --silent ${QueryAddress} | grep -o '"duration[^,]*' >tmp.txt
DURATION=$(cut -d ":" -f 2 tmp.txt)
TEST_MIN=$[DURATION / 60 / 1000]
TEST_SEC=$[DURATION /1000 % 60]
echo "$TOTAL_COUNT , $FAIL_COUNT ,duration:$TEST_MIN min $TEST_SEC sec"
fi
exit 1
elif [ $i -eq "19" ] ; then
echo "Integration testing : TIMEOUT"
exit 1
else
echo "wait 60sec."
sleep 60
fi
done