-
Notifications
You must be signed in to change notification settings - Fork 2
/
reset-test-data.sh
executable file
·58 lines (49 loc) · 1.35 KB
/
reset-test-data.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
#!/usr/bin/env bash
set -eu
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
ENVIRONMENT=${2:-build}
source ./scripts/database.sh
source ./scripts/reset-test-users.sh
source ./scripts/reset-account-interventions.sh
source ./scripts/re-authentication.sh
source ./scripts/2hr-lockout-period.sh
source ./scripts/reset-account-management.sh
LOCAL=0
while getopts "lr" opt; do
case ${opt} in
l)
LOCAL=1
;;
r)
LOCAL=0
;;
*)
usage
exit 1
;;
esac
done
echo -e "Resetting di-authentication-acceptance-tests test data in ${ENVIRONMENT}..."
export ENVIRONMENT_NAME="${ENVIRONMENT}"
if [ "${LOCAL}" == "1" ]; then
# shellcheck source=/dev/null
set -o allexport && source .env && set +o allexport
echo "reset-test-data ENVIRONMENT: ${ENVIRONMENT}"
if [ "${ENVIRONMENT}" == "staging" ]; then
export AWS_PROFILE="di-auth-staging-admin"
else
if [ "${ENVIRONMENT}" == "authdev1" ] || [ "${ENVIRONMENT}" == "authdev2" ] || [ "${ENVIRONMENT}" == "dev" ]; then
export AWS_PROFILE="di-auth-development-admin"
else
export AWS_PROFILE="gds-di-development-admin"
fi
fi
# shellcheck source=./scripts/export_aws_creds.sh
source "${DIR}/scripts/export_aws_creds.sh"
fi
resetTestUsers &
resetAccountInterventions &
#reAuthentication &
2hrLockoutPeriod &
resetAccountManagement &
wait