#! @testdir@/xeno-test-run
|
|
usage()
|
{
|
cat <<EOF
|
xeno-test -h or xeno-test --help
|
|
This help text.
|
|
|
xeno-test [ -l "load command" ] [ -k ] [ -r ] [ -- ] [ latency test options ]
|
|
Run a basic test/benchmark of Xenomai on your platform, by first starting a
|
few unit tests, then running the latency test under the load generated by
|
"load-command".
|
|
By default, the load command is "dohell 900", which will generate load during
|
15 minutes. To generate a more realistic load see dohell help.
|
|
This script accepts the -k option to tell the unit test loop to keep
|
going upon a failing test. Otherwise xeno-test stops immediately.
|
|
If the script is passed the -r option, real-time stress is added to the test,
|
with the help of the "switchtest" test. But beware: the latency test figures are
|
then no longer meaningful.
|
|
For running test in a virtual machine use the --vm option. This option relaxes
|
some of the timing thresholds.
|
|
Any other option passed on the command line is passed to the latency test.
|
|
Example:
|
xeno-test -l "dohell -s 192.168.0.5 -m /mnt -l /ltp" -t 2
|
|
Will generate load including network load using the server at IP address
|
192.168.0.5, some I/O under the moint point /mnt, and the LTP testsuite
|
installed under the /ltp directory, and use the latency test by measuring the
|
timer irq latency.
|
EOF
|
}
|
|
start_timesyncd()
|
{
|
if $timesyncd_was_running; then
|
systemctl start systemd-timesyncd
|
timesyncd_was_running=false
|
fi
|
}
|
trap start_timesyncd EXIT
|
|
keep_going=
|
run_on_vm=
|
rt_load=false
|
timesyncd_was_running=false
|
|
while :; do
|
case "$1" in
|
-h|--help)
|
usage
|
exit 0
|
;;
|
|
-k)
|
keep_going=--keep-going
|
shift
|
;;
|
|
--vm)
|
run_on_vm=--vm
|
shift
|
;;
|
|
-r)
|
rt_load=true
|
shift
|
;;
|
|
--)
|
shift
|
break
|
;;
|
|
""|*)
|
break
|
;;
|
esac
|
done
|
|
set -ex
|
|
echo 0 > /proc/xenomai/latency || :
|
|
testdir=@testdir@
|
|
if which systemctl > /dev/null && systemctl is-active --quiet systemd-timesyncd; then
|
timesyncd_was_running=true
|
systemctl stop systemd-timesyncd
|
fi
|
|
$testdir/smokey --run $run_on_vm $keep_going random_alloc_rounds=64 pattern_check_rounds=64
|
|
start_timesyncd
|
|
$testdir/clocktest -D -T 30 -C CLOCK_HOST_REALTIME || $testdir/clocktest -T 30
|
$testdir/switchtest -T 30
|
|
start_load
|
|
if $rt_load; then
|
check_alive $testdir/switchtest
|
check_alive $testdir/switchtest -s 1000
|
fi
|
|
check_alive $testdir/latency ${1+"$@"}
|
|
wait_load
|