forked from flant/negentropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-e2e-tests.sh
executable file
·55 lines (46 loc) · 1.59 KB
/
run-e2e-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
#!/bin/bash
set -e
cd e2e
vault_counts=$(docker ps --format '{{.Names}}' | grep vault | wc -l)
if (( $vault_counts < 2 )); then
echo "DEBUG: found single vault instance"
export ROOT_VAULT_TOKEN=$(cat /tmp/vault_single_token)
export AUTH_VAULT_TOKEN=$(cat /tmp/vault_single_token)
export ROOT_VAULT_URL=https://localhost:8200
export AUTH_VAULT_URL=https://localhost:8200
export ROOT_VAULT_INTERNAL_URL=https://vault:8200
export AUTH_VAULT_INTERNAL_URL=https://vault:8200
else
echo "DEBUG: found two separate vaults"
export ROOT_VAULT_TOKEN=$(cat /tmp/vault_root_token)
export AUTH_VAULT_TOKEN=$(cat /tmp/vault_auth_token)
export ROOT_VAULT_URL=https://localhost:8300
export AUTH_VAULT_URL=https://localhost:8200
export ROOT_VAULT_INTERNAL_URL=https://vault-root:8300
export AUTH_VAULT_INTERNAL_URL=https://vault-auth:8200
fi
echo DEBUG: ROOT_VAULT_TOKEN is $ROOT_VAULT_TOKEN
echo DEBUG: AUTH_VAULT_TOKEN is $AUTH_VAULT_TOKEN
echo DEBUG: ROOT_VAULT_URL is $ROOT_VAULT_URL
echo DEBUG: AUTH_VAULT_URL is $AUTH_VAULT_URL
echo DEBUG: ROOT_VAULT_INTERNAL_URL is $ROOT_VAULT_INTERNAL_URL
echo DEBUG: AUTH_VAULT_INTERNAL_URL is $AUTH_VAULT_INTERNAL_URL
go mod download
# run watcher
go run tests/lib/item_watcher/watcher.go &> /dev/null &
sleep 30 # wait reading
go run github.com/onsi/ginkgo/ginkgo run ./...
sleep 30 # wait reading
# watcher output & shutdown
echo
echo items:
curl localhost:3333/report
echo
echo cleaning:
curl localhost:3333/clean/auth_source.root
curl localhost:3333/clean/auth_source.auth
echo
echo items after cleaning
curl localhost:3333/report
echo
curl localhost:3333/shutdown