Merge pull request #810 from cmorty/pull/sky_energest
sky: Initialize energest as early as possible / make regression testing more tolerant
This commit is contained in:
commit
7c55290c32
|
@ -78,7 +78,7 @@ after_script:
|
||||||
- "[ ${BUILD_CATEGORY:-sim} = sim ] && tail regression-tests/??-$BUILD_TYPE/*.testlog"
|
- "[ ${BUILD_CATEGORY:-sim} = sim ] && tail regression-tests/??-$BUILD_TYPE/*.testlog"
|
||||||
## Print a basic summary
|
## Print a basic summary
|
||||||
- "echo 'Summary:'; cat regression-tests/??-$BUILD_TYPE/summary"
|
- "echo 'Summary:'; cat regression-tests/??-$BUILD_TYPE/summary"
|
||||||
- "FAILS=`grep -c -i 'fail' regression-tests/??-$BUILD_TYPE/summary`"
|
- "FAILS=`grep -c ' FAIL ' regression-tests/??-$BUILD_TYPE/summary`"
|
||||||
## This will detect whether the build should pass or fail
|
## This will detect whether the build should pass or fail
|
||||||
- "test $FAILS -eq 0; exit $?"
|
- "test $FAILS -eq 0; exit $?"
|
||||||
|
|
||||||
|
|
|
@ -283,6 +283,10 @@ main(int argc, char **argv)
|
||||||
* Hardware initialization done!
|
* Hardware initialization done!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Initialize energest first (but after rtimer)
|
||||||
|
*/
|
||||||
|
energest_init();
|
||||||
|
ENERGEST_ON(ENERGEST_TYPE_CPU);
|
||||||
|
|
||||||
#if WITH_TINYOS_AUTO_IDS
|
#if WITH_TINYOS_AUTO_IDS
|
||||||
node_id = TOS_NODE_ID;
|
node_id = TOS_NODE_ID;
|
||||||
|
@ -418,9 +422,6 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif /* WITH_UIP */
|
#endif /* WITH_UIP */
|
||||||
|
|
||||||
energest_init();
|
|
||||||
ENERGEST_ON(ENERGEST_TYPE_CPU);
|
|
||||||
|
|
||||||
watchdog_start();
|
watchdog_start();
|
||||||
|
|
||||||
NETSTACK_LLSEC.bootstrap(start_network_layer);
|
NETSTACK_LLSEC.bootstrap(start_network_layer);
|
||||||
|
|
|
@ -30,8 +30,8 @@ TESTS=$(wildcard ??-*.csc)
|
||||||
TESTLOGS=$(patsubst %.csc,%.testlog,$(TESTS))
|
TESTLOGS=$(patsubst %.csc,%.testlog,$(TESTS))
|
||||||
LOGS=$(patsubst %.csc,%.log,$(TESTS))
|
LOGS=$(patsubst %.csc,%.log,$(TESTS))
|
||||||
FAILLOGS=$(patsubst %.csc,%.faillog,$(TESTS))
|
FAILLOGS=$(patsubst %.csc,%.faillog,$(TESTS))
|
||||||
#Set random seed to create reproduceable results.
|
#Set random seeds to create reproduceable results.
|
||||||
RANDOMSEED=1
|
RANDOMSEED=1 5
|
||||||
|
|
||||||
CONTIKI=../..
|
CONTIKI=../..
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ RUNALL=false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.testlog: %.csc cooja
|
%.testlog: %.csc cooja
|
||||||
@$(CONTIKI)/regression-tests/simexec.sh "$(RUNALL)" "$<" "$(CONTIKI)" "$(basename $@)" "$(RANDOMSEED)"
|
@$(CONTIKI)/regression-tests/simexec.sh "$(RUNALL)" "$<" "$(CONTIKI)" "$(basename $@)" $(RANDOMSEED)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(TESTLOGS) $(LOGS) $(FAILLOGS) COOJA.log COOJA.testlog \
|
@rm -f $(TESTLOGS) $(LOGS) $(FAILLOGS) COOJA.log COOJA.testlog \
|
||||||
|
|
|
@ -1,66 +1,82 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Do not return an error
|
||||||
RUNALL=$1
|
RUNALL=$1
|
||||||
CSC=$2
|
shift
|
||||||
CONTIKI=$3
|
# The simulation to run
|
||||||
BASENAME=$4
|
CSC=$1
|
||||||
RANDOMSEED=$5
|
shift
|
||||||
|
#Contiki directory
|
||||||
|
CONTIKI=$1
|
||||||
|
shift
|
||||||
|
#The basename of the experiment
|
||||||
|
BASENAME=$1
|
||||||
|
shift
|
||||||
|
# The test will end on the first successfull run
|
||||||
|
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
echo -n "Running test $BASENAME "
|
while (( "$#" )); do
|
||||||
|
RANDOMSEED=$1
|
||||||
|
echo -n "Running test $BASENAME with random Seed $RANDOMSEED: "
|
||||||
|
|
||||||
java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$CSC -contiki=$CONTIKI -random-seed=$RANDOMSEED > $BASENAME.log &
|
java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$CSC -contiki=$CONTIKI -random-seed=$RANDOMSEED > $BASENAME.log &
|
||||||
JPID=$!
|
JPID=$!
|
||||||
|
|
||||||
# Copy the log and only print "." if it changed
|
# Copy the log and only print "." if it changed
|
||||||
touch $BASENAME.log.prog
|
touch $BASENAME.log.prog
|
||||||
while kill -0 $JPID 2> /dev/null
|
while kill -0 $JPID 2> /dev/null
|
||||||
do
|
do
|
||||||
sleep 1
|
sleep 1
|
||||||
diff $BASENAME.log $BASENAME.log.prog > /dev/null
|
diff $BASENAME.log $BASENAME.log.prog > /dev/null
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
echo -n "."
|
echo -n "."
|
||||||
cp $BASENAME.log $BASENAME.log.prog
|
cp $BASENAME.log $BASENAME.log.prog
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
rm $BASENAME.log.prog
|
||||||
|
|
||||||
|
|
||||||
|
wait $JPID
|
||||||
|
JRV=$?
|
||||||
|
|
||||||
|
if [ $JRV -eq 0 ] ; then
|
||||||
|
touch COOJA.testlog;
|
||||||
|
mv COOJA.testlog $BASENAME.testlog
|
||||||
|
echo " OK"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# In case of failure
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Verbose output when using CI
|
||||||
|
if [ "$CI" = "true" ]; then
|
||||||
|
echo "==== COOJA.log ====" ; cat COOJA.log;
|
||||||
|
echo "==== COOJA.testlog ====" ; cat COOJA.testlog;
|
||||||
|
else
|
||||||
|
tail -50 COOJA.log ;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
mv COOJA.testlog $BASENAME.$RANDOMSEED.faillog
|
||||||
|
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
rm $BASENAME.log.prog
|
|
||||||
|
|
||||||
|
#All seeds failed
|
||||||
wait $JPID
|
echo " FAIL ಠ_ಠ" | tee -a $BASENAME.$RANDOMSEED.faillog;
|
||||||
JRV=$?
|
|
||||||
|
|
||||||
if [ $JRV -eq 0 ] ; then
|
|
||||||
touch COOJA.testlog;
|
|
||||||
mv COOJA.testlog $BASENAME.testlog
|
|
||||||
echo " OK"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# In case of failure
|
|
||||||
|
|
||||||
echo " FAIL ಠ_ಠ" | tee -a COOJA.testlog;
|
|
||||||
|
|
||||||
#Verbose output when using CI
|
|
||||||
if [ "$CI" = "true" ]; then
|
|
||||||
echo "==== COOJA.log ====" ; cat COOJA.log;
|
|
||||||
echo "==== COOJA.testlog ====" ; cat COOJA.testlog;
|
|
||||||
else
|
|
||||||
tail -50 COOJA.log ;
|
|
||||||
fi;
|
|
||||||
|
|
||||||
mv COOJA.testlog $BASENAME.faillog
|
|
||||||
|
|
||||||
# We do not want Make to stop -> Return 0
|
# We do not want Make to stop -> Return 0
|
||||||
if [ "$RUNALL" = "true" ] ; then
|
if [ "$RUNALL" = "true" ] ; then
|
||||||
touch COOJA.testlog;
|
touch COOJA.testlog;
|
||||||
mv COOJA.testlog $BASENAME.testlog;
|
mv COOJA.testlog $BASENAME.testlog;
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#This is a failure
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue