set +x
}
+# this was formerly run in the myplc-devel chroot but now is run in the root context,
+# this is so that the .ssh config gets done manually, and once and for all
function runtest () {
set -x
set -e
date
### the URL to the myplc package
- cd /build/RPMS/i386
+ cd /vservers/$BASE/build/RPMS/i386
rpm=$(ls myplc-[0-9]*.rpm)
if [ ${#rpm[@]} != 1 ] ; then
- echo "Cannot locate rpm for testing"
+ echo "$COMMAND: Cannot locate rpm for testing"
exit 1
fi
url=${TESTBUILDURL}${PLDISTRO}/${BASE}/${rpm}
-
- cd /build
- ### checkout the test material
- svn co ${TESTSVNPATH} plctest
+
+ # find the place where the plctest material was checked out
+ cd /build/$BASE/build/CODEBASES/PLCAPI
+ if [ ! -d plctest/ ] ; then
+ echo "$COMMAND : Cannot not locate plctest/ - exiting"
+ exit 1
+ fi
# compute test directory name on test box
- testdir=plctest-${buildname}
+ testdir=plctest-${BASE}
# rsync/push test material onto the test box
ssh ${TESTBOXSSH} mkdir -p ${testdir}
rsync -a -v plctest/ ${TESTBOXSSH}:${testdir}
# invoke test on testbox
ssh ${TESTBOXSSH} python -u ${testdir}/${TESTSCRIPT} ${url}
- #invoke make install from build to the testbox
- make install PLCHOST=${TESTBOX}
+ #invoke make install from build to the testbox
+ # looks suspicious : we'd need this *during* myplc run, not at the end
+ # in addition we are not in the vserver here so running make can have weird effects
+ # make install PLCHOST=${TESTBOX}
if [ "$?" != 0 ] ; then
failure
cp $COMMANDPATH /vservers/${BASE}/build/
# invoke this command in the vserver for building (-T)
- vserver ${BASE} exec /build/$COMMAND -T "${argv[@]}"
+ vserver ${BASE} exec /build/$COMMAND "${argv[@]}"
# if successful (we run in set -e), publish
webpath=$(echo $WEBPATH | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
mkdir $webpath
cp $myplcs $webpath
- # invoke this command again for invoking tests
- vserver ${BASE} exec /build/$COMMAND -B "${argv[@]}"
+ # warning : need ssh in the vserver
+ if [ -n "$DO_TEST" ] ; then
+ runtest
+ fi
success
else
build
fi
- # need ssh in the vserver
- if [ -n "$DO_TEST" ] ; then
- runtest
- fi
-
-
fi
}