-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·37 lines (28 loc) · 1.05 KB
/
test.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.05 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
#This file contains the test cases for the APIs
if [ -n "$1" ]
then
echo "Getting your api gateway url..........."
echo -e "${API_URL}\n"
echo
echo "Getting your API authorization key..............."
API_KEY=$(aws ssm get-parameter \
--name API_KEY \
--with-decryption \
--query 'Parameter.[Value]'\
--output text)
echo -e "${API_KEY}\n"
echo -e "1.Testing Root endpoint....................\n"
echo -e "${API_URL}/ \n"
curl ${API_URL}/ -H "x-api-key: ${API_KEY}"
echo -e "\n \n"
echo -e "2.Testing health endpoint....................\n"
echo -e "${API_URL}/health \n"
curl -v ${API_URL}/health -H "x-api-key: ${API_KEY}"
echo -e "\n \n"
echo -e "3.Testing metadata endpoint....................\n"
echo -e "${API_URL}/metadata \n"
curl ${API_URL}/metadata -H "x-api-key: ${API_KEY}"
echo -e "\n \n"
else
echo -e "API_URL is empty, Run using make targets 'make deploy' and 'make test'"
fi