summaryrefslogtreecommitdiffstats
path: root/sms-service/src/sms/test/loop_test.sh
blob: 0af328eb6f75197a74d8ea9f8a693ace28dadb64 (plain)
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
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m'
URL=$1
PORT=$2
for i in `seq 1 2`; 
do
  echo -e "${RED}----------------BEGIN GET STATUS----------------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X GET \
    https://${URL}:${PORT}/v1/sms/quorum/status

  echo -e "${RED}----------------BEGIN CREATE SECRET DOMAIN------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X POST \
    -d @test/test_create_domain.json https://${URL}:${PORT}/v1/sms/domain

  echo -e "${RED}----------------BEGIN CREATE SECRET 1-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X POST \
    -d @test/test_create_secret1.json https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret

  echo -e "${RED}----------------BEGIN CREATE SECRET 2-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X POST \
    -d @test/test_create_secret2.json https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret

  echo -e "${RED}----------------BEGIN CREATE SECRET 3-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X POST \
    -d @test/test_create_secret3.json https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret

  echo -e "${RED}----------------BEGIN LIST SECRET---------------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X GET \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret

  echo -e "${RED}----------------BEGIN GET SECRET 1--------------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X GET \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret1

  echo -e "${RED}----------------BEGIN GET SECRET 2--------------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X GET \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret2

  echo -e "${RED}----------------BEGIN GET SECRET 3--------------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X GET \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret3

  echo -e "${RED}----------------BEGIN DELETE SECRET 1-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X DELETE \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret1

  echo -e "${RED}----------------BEGIN DELETE SECRET 2-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X DELETE \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret2

  echo -e "${RED}----------------BEGIN DELETE SECRET 3-----------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X DELETE \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain/secret/curltestsecret3

  echo -e "${RED}----------------BEGIN DELETE SECRET DOMAIN------${NC}"
  curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem -X DELETE \
    https://${URL}:${PORT}/v1/sms/domain/curltestdomain
done