aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/run_tests_for_component.sh
blob: 6c6a0330f7447d2f5a39394a7653b66d29a17735 (plain)
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
#!/usr/bin/env bash

CUR_PWD=$(pwd)
INPUT_FILE=../tools/moon_kubernetes/templates/moon_functest.yaml
OUTPUT_FILE=tests/functional_pod/moon_functest.yaml

echo current working directory: ${CUR_PWD}

cat ${INPUT_FILE} | sed "s|{{PATH}}|${CUR_PWD}|" > ${OUTPUT_FILE}

kubectl create -f ${OUTPUT_FILE}

sleep 5
kubectl get -n moon jobs
echo OUTPUT is $?
if [ "$?" -ne 0 ]
then
    sleep 5
    kubectl get -n moon jobs
fi

echo "waiting for FuncTests (it may takes time)..."
echo -e "\033[35m"
sed '/<END OF JOB>/q' <(kubectl logs -n moon jobs/functest -f)
echo -e "\033[m"

kubectl delete -f ${OUTPUT_FILE}