-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathduraboss-rest-tests.sh
61 lines (49 loc) · 2.2 KB
/
duraboss-rest-tests.sh
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
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
source setup.sh
shopt -s expand_aliases
alias enter="read -p ' Press enter to continue: '; echo"
# GET Latest Storage Report
echo "--- GET Latest Storage Report ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/storage
echo -e "\nVerify latest storage report is printed"
enter
# GET Storage Report List
echo "--- GET Storage Report List ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/storage/list
echo -e "\nVerify storage report list is printed"
enter
# GET Storage Report Info
echo "--- GET Storage Report Info ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/storage/info
echo -e "\nVerify stoarge report info is printed"
enter
# Start Storage Report
echo "--- Start Storage Report ---"
curl $ca -v -u ${rootUsername}:${rootPassword} -X POST ${protocol}://${host}/duraboss/report/storage
echo -e "\nVerify successful http response (200)"
enter
echo "--- Stop Storage Report ---"
curl $ca -v -u ${rootUsername}:${rootPassword} -X DELETE ${protocol}://${host}/duraboss/report/storage
echo -e "\nVerify succcessful http response"
enter
echo "--- Schedule Storage Report (to begin one minute in the future and repeat every 10 min) ---"
epochTime=$(((`date +%s`)*1000 + 60000))
curl $ca -v -u ${rootUsername}:${rootPassword} -X POST ${protocol}://${host}/duraboss/report/storage/schedule?startTime=${epochTime}\&frequency=600000
echo -e "\nVerify successful httpcode (200)"
enter
echo "--- Cancel Storage Report Schedule ---"
curl $ca -v -u ${rootUsername}:${rootPassword} -X DELETE ${protocol}://${host}/duraboss/report/storage/schedule
echo -e "\nVerify successful http response code"
enter
echo "--- GET Deployed Services Report ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/service/deployed
echo -e "\nVerify deployed services report printed."
enter
echo "--- GET Completed Services Report ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/service
echo -e "\nVerify completed services report printed."
enter
echo "--- GET Services Report List ---"
curl $ca -u ${user}:${pword} ${protocol}://${host}/duraboss/report/service/list
echo -e "\nVerify services report list printed"
enter