-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathacceptanceTest.sh
executable file
·80 lines (70 loc) · 1.89 KB
/
acceptanceTest.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
fold_begin () {
echo -en "travis_fold:start:${1}\r"
if [ -z "$2" ]; then
echo "${1}: "
else
echo "${2}: "
fi
}
fold_end () {
echo -en "travis_fold:end:${1}\r"
}
PWD=$(pwd)
#TARGET=$(mktemp -d 2>/dev/null || mktemp -d -t "fiteagle")
TARGET="${PWD}/build"
echo "using TARGET: ${TARGET} HOME: ${HOME} PWD: ${PWD}"
rm -rf ${TARGET}
mkdir -p ${TARGET}
mkdir -p ${HOME}/.fiteagle
cd ${TARGET}
export WILDFLY_HOME="${TARGET}/server/wildfly"
curl -sSL https://github.com/FITeagle/bootstrap/raw/master/fiteagle.sh -o fiteagle.sh
chmod +x ${TARGET}/fiteagle.sh
fold_begin init Init
${TARGET}/fiteagle.sh init
cp ${TARGET}/../conf/MotorGarage.properties ${HOME}/.fiteagle/
cp ${TARGET}/../conf/NetworkingAdapter.properties ${HOME}/.fiteagle/
fold_end init
fold_begin deploy "deployFT2binary deployFT2sfaBinary"
${TARGET}/fiteagle.sh startJ2EE sleep-20 deployFT2binary deployFT2sfaBinary
fold_end deploy
fold_begin test1 "1st jFed test"
cd ${PWD}
pwd
## HACK
cd ..
echo "waiting for server to be ready (by polling sfa/GetVersion via xmlrpc)..."
CNT=0
while [[ ! $(./xmlrpc-client.sh -t https://localhost:8443/sfa/api/am/v3 GetVersion) ]]; do
echo sleep 15
sleep 15
CNT=$((${CNT}+1))
if [ ${CNT} -gt "20" ]; then
echo "cnt:" ${CNT}
echo timeout !
${TARGET}/fiteagle.sh stopJ2EE
screen -S wildfly -X kill
fold_end test1
exit 1
fi
done
./runJfed_local.sh
RET=$?
echo "RET: ${RET}"
fold_end test1
if [ $RET -gt 0 ]; then
fold_begin test2 "2nd jFed test"
echo "retry failed test...."
echo "touching .war files.."
[ -f ${WILDFLY_HOME}/standalone/deployments/motor.war ] && touch ${WILDFLY_HOME}/standalone/deployments/motor.war
[ -f ${WILDFLY_HOME}/standalone/deployments/sshService.war ] && touch ${WILDFLY_HOME}/standalone/deployments/sshService.war
sleep 30
./runJfed_local.sh
RET=$?
echo "RET: ${RET}"
fold_end test2
fi
${TARGET}/fiteagle.sh stopJ2EE
#rm -rf ${TARGET}
exit $RET