-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-tests.sh
executable file
·59 lines (52 loc) · 1.25 KB
/
run-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
#!/bin/bash
# Test read entire file.
cat <<EOF
### Test reading entire vault. Output should be:
===
hello: world
a: 1
b: 2
===
EOF
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret.yml -view
echo ===
echo
cat <<EOF
### Test listing keys. Output should be:
===
hello
a
b
===
EOF
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret.yml -list
echo ===
echo
# Test getting keys.
cat <<EOF
### Test getting keys. Output should be:
===
hello: world
a: 1
b: 2
===
EOF
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret.yml -get a
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret.yml -get hello
echo ===
echo
# Test modifiying a file.
cat <<EOF
### Test modifying a vault. Output should be:
===
a: "1"
b: "2"
c: "3"
hello: world
===
EOF
cp ./testdata/password_is_secret.yml ./testdata/password_is_secret_modified.yml ;
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret_modified.yml -put c -putval 3
./simple-secret -passwordFile ./testdata/password_file.txt -vaultFile ./testdata/password_is_secret_modified.yml -view
echo ===
echo