forked from awslabs/aws-iam-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·43 lines (35 loc) · 893 Bytes
/
test.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
#!/bin/bash
set -ex
TESTDIR=test_output_templates
assert_templates_exist() {
[ -f "${TESTDIR}/central(123456678910)-IAM.template" ]
[ -f "${TESTDIR}/dev1(109876543210)-IAM.template" ]
[ -f "${TESTDIR}/dev2(309876543210)-IAM.template" ]
[ -f "${TESTDIR}/prod(209876543210)-IAM.template" ]
}
cleanup() {
rm -f ${TESTDIR}/*
}
test_json() {
cleanup
./build.py \
--config sample_configs/config-complex.yaml \
--format json \
--output-path test_output_templates \
--policy-path sample_policy
assert_templates_exist
}
test_yaml() {
cleanup
./build.py \
--config sample_configs/config-complex.yaml \
--format yaml \
--output-path test_output_templates \
--policy-path sample_policy_yaml
assert_templates_exist
}
mkdir -p ${TESTDIR}
test_json
test_yaml
cleanup
echo 'All tests passed!'