forked from litmuschaos/github-chaos-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·46 lines (37 loc) · 1.12 KB
/
entrypoint.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
#!/bin/bash
set -e
TOTAL_CHAOS_DURATION=${TOTAL_CHAOS_DURATION:=60}
TEST_TIMEOUT=$((600 + $TOTAL_CHAOS_DURATION))
PARALLEL_EXECUTION=${PARALLEL_EXECUTION:=1}
##Extract the base64 encoded config data and write this to the KUBECONFIG
mkdir -p ${HOME}/.kube
echo "$KUBE_CONFIG_DATA" | base64 --decode > ${HOME}/.kube/config
export KUBECONFIG=${HOME}/.kube/config
##Setup
mkdir -p $HOME/go/src/github.com/litmuschaos
cd ${GOPATH}/src/github.com/litmuschaos/
dir=${GOPATH}/src/github.com/litmuschaos/chaos-ci-lib
if [ ! -d $dir ]
then
git clone https://github.com/litmuschaos/chaos-ci-lib.git
fi
cd chaos-ci-lib
##Install litmus if it is not already installed
if [ "$INSTALL_LITMUS" == "true" ]
then
go test litmus/install-litmus_test.go -v -count=1
fi
if [ "$EXPERIMENT_NAME" == "all" ]; then
## Run all BDDs
cd tests
ginkgo -nodes=${PARALLEL_EXECUTION}
cd ..
elif [ ! -z "$EXPERIMENT_NAME" ]; then
## Run the selected chaos experiment
go test tests/${EXPERIMENT_NAME}_test.go -v -count=1 -timeout=${TEST_TIMEOUT}s
fi
##litmus cleanup
if [ "$LITMUS_CLEANUP" == "true" ]
then
go test litmus/uninstall-litmus_test.go -v -count=1
fi