5 if [ -z "$TESTDIR" ] ; then
9 if [ -n "$HWSIM_TEST_LOG_DIR" ] ; then
10 LOGS="$HWSIM_TEST_LOG_DIR"
12 LOGS=/tmp/hwsim-test-logs
15 # increase the memory size if you want to run with valgrind, 512 MB works
18 # Some ubuntu systems (notably 12.04) have issues with this - since the guest
19 # mounts as read-only it should be safe to not specify ,readonly. Override in
20 # vm-config if needed (see below)
23 # set this to ttyS0 to see kvm messages (if something doesn't work)
26 # you can set EPATH if you need anything extra in $PATH inside the VM
29 # extra KVM arguments, e.g., -s for gdbserver
32 # number of channels each hwsim device supports
35 test -f vm-config && . vm-config
36 test -f ~/.wpas-vm-config && . ~/.wpas-vm-config
38 if [ -z "$KERNEL" ] && [ -z "$KERNELDIR" ] ; then
39 echo "You need to set a KERNEL or KERNELDIR (in the environment or vm-config)"
42 if [ -z "$KERNEL" ] ; then
43 KERNEL=$KERNELDIR/arch/x86_64/boot/bzImage
47 CMD=$TESTDIR/vm/inside.sh
56 while [ "$1" != "" ]; do
81 RUN_TEST_ARGS="$RUN_TEST_ARGS$1 "
90 if [ -n "$CODECOV_DIR" ]; then
91 cp -a $CODECOV_DIR/alt-wpa_supplicant $LOGDIR
92 cp -a $CODECOV_DIR/alt-hostapd $LOGDIR
93 cp -a $CODECOV_DIR/alt-hostapd-as $LOGDIR
94 cp -a $CODECOV_DIR/alt-hlr_auc_gw $LOGDIR
95 elif [ $CODECOV = "yes" ]; then
96 ./build-codecov.sh $LOGDIR || exit 1
101 if [ $DELAY -gt 0 ]; then
102 echo "Wait $DELAY seconds before starting VM"
106 echo "Starting test run in a virtual machine"
109 for kvmprog in kvm qemu-kvm; do
110 if $kvmprog --version &> /dev/null; then
117 if [ $? -ne 0 ] ; then
125 echo "$RUN_TEST_ARGS" > $argsfile
128 -kernel $KERNEL -smp 4 \
129 $KVMARGS -m $MEMORY -nographic \
130 -fsdev local,security_model=none,id=fsdev-root,path=/$ROTAG \
131 -device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \
132 -fsdev local,security_model=none,id=fsdev-logs,path="$LOGDIR",writeout=immediate \
133 -device virtio-9p-pci,id=fs-logs,fsdev=fsdev-logs,mount_tag=logshare \
134 -monitor null -serial stdio -serial file:$LOGDIR/console \
135 -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=$argsfile"
137 if [ $CODECOV = "yes" ]; then
138 echo "Preparing code coverage reports"
139 ./process-codecov.sh $LOGDIR "" restore
140 ./combine-codecov.sh $LOGDIR lcov
144 echo "Test run completed"
145 echo "Logfiles are at $LOGDIR"
146 if [ $CODECOV = "yes" ]; then
147 echo "Code coverage report:"
148 echo "file://$LOGDIR/lcov/index.html"