forked from iotaledger-archive/iri
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathciglue.sh
More file actions
executable file
·55 lines (43 loc) · 1.23 KB
/
ciglue.sh
File metadata and controls
executable file
·55 lines (43 loc) · 1.23 KB
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
if [ "$#" -ne 1 ]; then
echo "Please specify an image to test"
exit 1
fi
set -x
UUID=$(uuidgen)
ERROR=0
K8S_NAMESPACE=$(kubectl config get-contexts $(kubectl config current-context) | tail -n+2 | awk '{print $5}')
IMAGE=$1
if [ ! -d tiab ]; then
git clone --depth 1 https://github.com/iotaledger/tiab tiab
fi
virtualenv -p python2 venv
source venv/bin/activate
cd tiab
git pull
echo "tiab revision: "; git rev-parse HEAD
pip install -r requirements.txt
cd ..
pip install -e .
for machine_dir in tests/features/machine?; do
python tiab/create_cluster.py -i $IMAGE -t $UUID -n $K8S_NAMESPACE -c $machine_dir/config.yml -o $machine_dir/output.yml -d
if [ $? -ne 0 ]; then
ERROR=1
python <<EOF
import yaml
for (key,value) in yaml.load(open('$machine_dir/output.yml'))['nodes'].iteritems():
if value['status'] == 'Error':
print value['log']
EOF
fi
done
if [ $ERROR -eq 0 ]; then
echo "Starting tests..."
for machine_dir in tests/features/machine?;do
FEATURES=$(find $machine_dir -type f -name "*.feature" -exec basename {} \; | tr "\n" " ")
aloe $FEATURES --verbose --nologcapture --where $machine_dir
done
fi
timeout 10 tiab/teardown_cluster.py -t $UUID -n $K8S_NAMESPACE
deactivate
exit $ERROR