]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Allow passing more arguments to vm-run.sh
authorJohannes Berg <johannes.berg@intel.com>
Mon, 30 Nov 2015 10:59:09 +0000 (11:59 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 30 Nov 2015 12:03:28 +0000 (14:03 +0200)
The script is currently limited by the maximum kernel command line
length and if that's exceeded the kernel panics at boot. Fix this by
writing the arguments to a file and reading it in the VM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
tests/hwsim/vm/inside.sh
tests/hwsim/vm/vm-run.sh

index 60398081317cb1045817ec52d9fdfbec221460cd..3cbfe10810f2c6dea71ff01e6eba4f9b270c4b52 100755 (executable)
@@ -22,7 +22,7 @@ sysctl kernel.panic=1
 TESTDIR=$(sed 's/.*testdir=\([^ ]*\) .*/\1/' /proc/cmdline)
 TIMEWARP=$(sed 's/.*timewarp=\([^ ]*\) .*/\1/' /proc/cmdline)
 EPATH=$(sed 's/.*EPATH=\([^ ]*\) .*/\1/' /proc/cmdline)
-ARGS=$(sed 's/.*ARGS=//' /proc/cmdline)
+ARGS=$(sed 's/.*ARGS=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
 
 # create /dev entries we need
 mknod -m 660 /dev/ttyS0 c 4 64
@@ -78,6 +78,10 @@ ip link set lo up
 mkdir /tmp/logs
 mount -t 9p -o trans=virtio,rw logshare /tmp/logs
 
+# allow access to any outside directory (e.g. /tmp) we also have
+mkdir /tmp/host
+mount --bind / /tmp/host
+
 if [ "$TIMEWARP" = "1" ] ; then
     (
         while sleep 1 ; do
@@ -107,7 +111,7 @@ else
        dbus-daemon --config-file=$TESTDIR/vm/dbus.conf --fork
 
        cd $TESTDIR
-       ./run-all.sh $ARGS </dev/ttyS0 >/dev/ttyS0 2>&1
+       ./run-all.sh $(cat /tmp/host$ARGS) </dev/ttyS0 >/dev/ttyS0 2>&1
        if test -d /sys/kernel/debug/gcov ; then
                cp -ar /sys/kernel/debug/gcov /tmp/logs/
                # these are broken as they're updated while being read ...
index ab4df4c100be45fdd31ec3393239db5e255b7c77..c0ef5b0fe4f9518dae7c4a69167aab233d68d00b 100755 (executable)
@@ -113,6 +113,17 @@ for kvmprog in kvm qemu-kvm; do
     fi
 done
 
+argsfile=$(mktemp)
+if [ $? -ne 0 ] ; then
+       exit 2
+fi
+function finish {
+       rm -f $argsfile
+}
+trap finish EXIT
+
+echo "$RUN_TEST_ARGS" > $argsfile
+
 $KVM \
        -kernel $KERNEL -smp 4 \
        $KVMARGS -m $MEMORY -nographic \
@@ -121,7 +132,7 @@ $KVM \
        -fsdev local,security_model=none,id=fsdev-logs,path="$LOGDIR",writeout=immediate \
        -device virtio-9p-pci,id=fs-logs,fsdev=fsdev-logs,mount_tag=logshare \
        -monitor null -serial stdio -serial file:$LOGDIR/console \
-       -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"
+       -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"
 
 if [ $CODECOV = "yes" ]; then
     echo "Preparing code coverage reports"