forked from devstructure/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.sh
70 lines (49 loc) · 1.93 KB
/
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
61
62
63
64
65
66
67
68
69
70
BASE="http://127.0.0.1:5000"
CURLARGS="-sv"
SECRET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-"
NAME="test"
SHA="adff242fbc01ba3753abf8c3f9b45eeedec23ec6"
set -ex
cd "$(dirname "$0")"
curl $CURLARGS -X GET "$BASE/secret"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/empty.json" "$BASE/invalid/$NAME"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/empty.json" "$BASE/$SECRET/%20"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/invalid-syntax.json" "$BASE/$SECRET/$NAME"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/invalid-schema.json" "$BASE/$SECRET/$NAME"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/empty.json" "$BASE/$SECRET/$NAME"
curl $CURLARGS -X PUT \
-H "Content-Type: application/x-tar" \
-T "tests/$SHA.tar" "$BASE/$SECRET/$NAME/$SHA.tar"
curl $CURLARGS -X PUT \
-H "Content-Type: application/json" \
-T "tests/sources.json" "$BASE/$SECRET/$NAME"
curl $CURLARGS -X PUT \
-H "Content-Type: application/x-tar" \
-T "tests/$SHA.tar" "$BASE/$SECRET/$NAME/$SHA.tar"
curl $CURLARGS -X PUT \
-H "Content-Type: application/x-tar" \
-T "tests/$SHA.tar" "$BASE/$SECRET/$NAME/invalid.tar"
curl $CURLARGS -X PUT \
-H "Content-Type: application/x-tar" \
-T "tests/$SHA.tar" \
"$BASE/$SECRET/$NAME/0000000000000000000000000000000000000000.tar"
curl $CURLARGS -X GET "$BASE/$SECRET/four-oh-four"
curl $CURLARGS -X GET "$BASE/$SECRET/$NAME"
curl $CURLARGS -X GET "$BASE/$SECRET/four-oh-four/four-oh-four.sh"
curl $CURLARGS -X GET "$BASE/$SECRET/four-oh-four/wrong.sh"
curl $CURLARGS -X GET "$BASE/$SECRET/$NAME/$NAME.sh"
curl $CURLARGS -X GET "$BASE/$SECRET/four-oh-four/user-data.sh"
curl $CURLARGS -X GET "$BASE/$SECRET/$NAME/user-data.sh"
curl $CURLARGS -X GET \
"$BASE/$SECRET/$NAME/0000000000000000000000000000000000000000.tar"
curl $CURLARGS -X GET "$BASE/$SECRET/$NAME/$SHA.tar"