5 if [ -z "$TESTDIR" ] ; then
9 LOGS=/tmp/hwsim-test-logs
11 # increase the memory size if you want to run with valgrind, 512 MB works
14 # Some ubuntu systems (notably 12.04) have issues with this - since the guest
15 # mounts as read-only it should be safe to not specify ,readonly. Override in
16 # vm-config if needed (see below)
19 # set this to ttyS0 to see kvm messages (if something doesn't work)
22 # you can set EPATH if you need anything extra in $PATH inside the VM
25 # extra KVM arguments, e.g., -s for gdbserver
28 # number of channels each hwsim device supports
31 test -f vm-config && . vm-config
32 test -f ~/.wpas-vm-config && . ~/.wpas-vm-config
34 if [ -z "$KERNEL" ] && [ -z "$KERNELDIR" ] ; then
35 echo "You need to set a KERNEL or KERNELDIR (in the environment or vm-config)"
38 if [ -z "$KERNEL" ] ; then
39 KERNEL=$KERNELDIR/arch/x86_64/boot/bzImage
43 CMD=$TESTDIR/vm/inside.sh
52 while [ "$1" != "" ]; do
77 RUN_TEST_ARGS="$RUN_TEST_ARGS$1 "
86 if [ -n "$CODECOV_DIR" ]; then
87 cp -a $CODECOV_DIR/alt-wpa_supplicant $LOGDIR
88 cp -a $CODECOV_DIR/alt-hostapd $LOGDIR
89 cp -a $CODECOV_DIR/alt-hostapd-as $LOGDIR
90 cp -a $CODECOV_DIR/alt-hlr_auc_gw $LOGDIR
91 elif [ $CODECOV = "yes" ]; then
92 ./build-codecov.sh $LOGDIR || exit 1
97 if [ $DELAY -gt 0 ]; then
98 echo "Wait $DELAY seconds before starting VM"
102 echo "Starting test run in a virtual machine"
105 -kernel $KERNEL -smp 4 \
106 $KVMARGS -m $MEMORY -nographic \
107 -fsdev local,security_model=none,id=fsdev-root,path=/$ROTAG \
108 -device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \
109 -fsdev local,security_model=none,id=fsdev-logs,path="$LOGDIR",writeout=immediate \
110 -device virtio-9p-pci,id=fs-logs,fsdev=fsdev-logs,mount_tag=logshare \
111 -monitor null -serial stdio -serial file:$LOGDIR/console \
112 -append "mac80211_hwsim.support_p2p_device=0 mac80211_hwsim.channels=$CHANNELS mac80211_hwsim.radios=7 init=$CMD testdir=$TESTDIR timewarp=$TIMEWARP console=$KVMOUT root=/dev/root rootflags=trans=virtio,version=9p2000.u ro rootfstype=9p EPATH=$EPATH ARGS=$RUN_TEST_ARGS"
114 if [ $CODECOV = "yes" ]; then
115 echo "Preparing code coverage reports"
116 ./process-codecov.sh $LOGDIR "" restore
117 ./combine-codecov.sh $LOGDIR lcov
121 echo "Test run completed"
122 echo "Logfiles are at $LOGDIR"
123 if [ $CODECOV = "yes" ]; then
124 echo "Code coverage report:"
125 echo "file://$LOGDIR/lcov/index.html"