diff options
author | 2018-03-06 16:26:11 -0800 | |
---|---|---|
committer | 2018-03-07 04:02:25 +0000 | |
commit | 361878db0deea8e42cbeabf576c6fa4aa858f35e (patch) | |
tree | 43528ed2fd26fcb997f66b582680c0305d492b9f /sms-service | |
parent | 6125e317c3d61c87eaa9ea4d05c2687ca117325f (diff) |
Adding endpoint test scripts
Adding endpoint tests that use curl and some dummy data
to exercise the various endpoints that are deployed
Issue-ID: AAF-161
Change-Id: I522216ac790db10a68f4d2af8e845d7526b9fa48
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'sms-service')
-rw-r--r-- | sms-service/src/sms/test/loop_test.sh | 57 | ||||
-rw-r--r-- | sms-service/src/sms/test/test_create_domain.json | 3 | ||||
-rw-r--r-- | sms-service/src/sms/test/test_create_secret1.json | 12 | ||||
-rw-r--r-- | sms-service/src/sms/test/test_create_secret2.json | 9 | ||||
-rw-r--r-- | sms-service/src/sms/test/test_create_secret3.json | 9 |
5 files changed, 90 insertions, 0 deletions
diff --git a/sms-service/src/sms/test/loop_test.sh b/sms-service/src/sms/test/loop_test.sh new file mode 100644 index 0000000..449d625 --- /dev/null +++ b/sms-service/src/sms/test/loop_test.sh @@ -0,0 +1,57 @@ +#!/bin/bash +RED='\033[0;31m' +NC='\033[0m' +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 --cert auth/client.cert --key auth/client.key -X GET \ + https://localhost:10443/v1/sms/status + + echo -e "${RED}----------------BEGIN CREATE SECRET DOMAIN------${NC}" + curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem --cert auth/client.cert --key auth/client.key -X POST \ + -d @test/test_create_domain.json https://localhost:10443/v1/sms/domain + + echo -e "${RED}----------------BEGIN CREATE SECRET 1-----------${NC}" + curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem --cert auth/client.cert --key auth/client.key -X POST \ + -d @test/test_create_secret1.json https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X POST \ + -d @test/test_create_secret2.json https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X POST \ + -d @test/test_create_secret3.json https://localhost:10443/v1/sms/domain/curltestdomain/secret + + echo -e "${RED}----------------BEGIN LIST SECRET---------------${NC}" + curl -i -w "\n" -H "Accept: application/json" --cacert auth/selfsignedca.pem --cert auth/client.cert --key auth/client.key -X GET \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X GET \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X GET \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X GET \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X DELETE \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X DELETE \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X DELETE \ + https://localhost:10443/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 --cert auth/client.cert --key auth/client.key -X DELETE \ + https://localhost:10443/v1/sms/domain/curltestdomain +done diff --git a/sms-service/src/sms/test/test_create_domain.json b/sms-service/src/sms/test/test_create_domain.json new file mode 100644 index 0000000..176f444 --- /dev/null +++ b/sms-service/src/sms/test/test_create_domain.json @@ -0,0 +1,3 @@ +{ + "name": "curltestdomain" +} diff --git a/sms-service/src/sms/test/test_create_secret1.json b/sms-service/src/sms/test/test_create_secret1.json new file mode 100644 index 0000000..d99f4e2 --- /dev/null +++ b/sms-service/src/sms/test/test_create_secret1.json @@ -0,0 +1,12 @@ +{ + "name": "curltestsecret1", + "values": { + "name":"rah", + "age":35, + "map":{ + "mapkey1": "mapvalue1", + "mapkey2": "mapvalue2" + }, + "array":["golang","c++","java","python"] + } +} diff --git a/sms-service/src/sms/test/test_create_secret2.json b/sms-service/src/sms/test/test_create_secret2.json new file mode 100644 index 0000000..2d81bb3 --- /dev/null +++ b/sms-service/src/sms/test/test_create_secret2.json @@ -0,0 +1,9 @@ +{ + "name": "curltestsecret2", + "values": { + "name":"abcdeffgasd", + "age":2000, + "isadmin":true, + "secretphrase":"this is my secret" + } +} diff --git a/sms-service/src/sms/test/test_create_secret3.json b/sms-service/src/sms/test/test_create_secret3.json new file mode 100644 index 0000000..67cb147 --- /dev/null +++ b/sms-service/src/sms/test/test_create_secret3.json @@ -0,0 +1,9 @@ +{ + "name": "curltestsecret3", + "values": { + "string": "asdhjkahsdjkhasd", + "bool": true, + "int": 20, + "float":2.4 + } +} |