From: Dmitry V. Levin Date: Thu, 15 Jan 2015 17:01:32 +0000 (+0000) Subject: qemu_multiarch_testing: update X-Git-Tag: v4.10~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=868a66659c74c9f214024e0c7cc80207110db023;p=strace qemu_multiarch_testing: update * qemu_multiarch_testing/.gitignore: New file. * qemu_multiarch_testing/README: Update statistics. * qemu_multiarch_testing/hdc.dir/init2: Run "make check". * qemu_multiarch_testing/make-hdc-img.sh: Robustify, automatically calculate hdc image size. * qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce hdb image size. Report completion of each parallelized task. --- diff --git a/qemu_multiarch_testing/.gitignore b/qemu_multiarch_testing/.gitignore new file mode 100644 index 00000000..9ba3a0a9 --- /dev/null +++ b/qemu_multiarch_testing/.gitignore @@ -0,0 +1,2 @@ +hdc.dir/strace +hdc.img diff --git a/qemu_multiarch_testing/README b/qemu_multiarch_testing/README index 756da24e..271c4615 100644 --- a/qemu_multiarch_testing/README +++ b/qemu_multiarch_testing/README @@ -21,31 +21,21 @@ This runs a strace build in several qemu virtual machines in parallel. There is no automated detection of errors for now: you need to examine logs yourself. -For me, the following system images worked: -system-image-armv4l -system-image-armv4tl -system-image-armv5l -system-image-armv6l -system-image-i686 (had to s/qemu-system-i386/qemu/ in run-emulator.sh) -system-image-mipsel -system-image-mips -system-image-x86_64 -system-image-sparc - needed small edit in native-build.sh: - # Getting this early: - # Unhandled Exception 0x00000007 - # PC = 0xffd07cec NPC = 0xffd07cf0 - # Stopping execution - # and it looks like it's triggered just by too long kernel cmdline, - # not by specific options. - #export KERNEL_EXTRA="FTP_SERVER=$FTP_SERVER FTP_PORT=$FTP_PORT NATIVE_BUILD=$NATIVE_BUILD $KERNEL_EXTRA" - # This works: - export KERNEL_EXTRA="NATIVE_BUILD=$NATIVE_BUILD $KERNEL_EXTRA" +For me, the following system images worked (tests passed/skipped/failed): +system-image-armv4l - 14/14/1 (failed: stat32-v.test - wrong stat decoding) +system-image-armv4tl - 15/14/0 +system-image-armv5l - 15/14/0 +system-image-armv6l - 15/14/0 +system-image-i486 - 14/14/1 (failed: count.test - grep segfault) +system-image-i586 - 14/14/1 (failed: count.test - grep segfault) +system-image-i686 - 14/14/1 (failed: count.test - grep segfault) +system-image-mips - 15/14/0 +system-image-mipsel - 15/14/0 +system-image-powerpc - 13/14/2 (failed: ptrace_setoptions.test - grep segfault, ipc_sem.test - ipc_sem segfault) +system-image-sparc - 13/14/2 (failed: ipc_sem.test - ipc_sem segfault, sigaction.test - wrong rt_sigaction decoding) +system-image-x86_64 - 14/15/0 And these did not: -system-image-armv4eb - VFS: Cannot open root device "sda" or unknown-block(0,0) -system-image-m68k - run-emulator.sh has no call of qemu-system-* (not supported yet??) -system-image-mips64 - - need to run ./native-build.sh ../hdc.img by hand; - copying in /mnt/init fails (segv?) -system-image-powerpc - QEMU stuck very early +system-image-m68k - qemu-system-m68k: -M q800: Unsupported machine type +system-image-mips64 - init dies before reaching /mnt/init system-image-sh4 - hdc does not mount (no support for 2 disks) diff --git a/qemu_multiarch_testing/hdc.dir/init2 b/qemu_multiarch_testing/hdc.dir/init2 index f1a9dee4..8c0200af 100755 --- a/qemu_multiarch_testing/hdc.dir/init2 +++ b/qemu_multiarch_testing/hdc.dir/init2 @@ -1,19 +1,16 @@ #!/bin/sh umount /mnt # optional -echo "Building" ( - cd strace && - ./configure && - make && - echo "Build: SUCCESS" + set -e -x + cd strace + ./configure + make size strace - ./strace - # strace may segfault, let's see exit code - echo "Exit code: $?" - ./strace /bin/true - echo "Exit code: $?" - ftpput -P "$FTP_PORT" "$FTP_SERVER" strace + make check VERBOSE=1 && + cat tests/test-suite.log ||: + test "x$FTP_PORT" = x || + ftpput -P "$FTP_PORT" "$FTP_SERVER" strace ) 2>&1 | tee strace_build.log mount -o remount,ro /home sync diff --git a/qemu_multiarch_testing/make-hdc-img.sh b/qemu_multiarch_testing/make-hdc-img.sh index 93d2a77b..3c35f4ea 100755 --- a/qemu_multiarch_testing/make-hdc-img.sh +++ b/qemu_multiarch_testing/make-hdc-img.sh @@ -1,17 +1,30 @@ -#!/bin/sh +#!/bin/sh -ex -export HDCMEGS=128 +mountpoint -q / +[ ! -e hdc.img.dir ] -rm hdc.img 2>/dev/null -umount -d hdc.img.dir 2>/dev/null -rm -rf hdc.img.dir 2>/dev/null +cleanup() +{ + trap - EXIT + if mountpoint -q hdc.img.dir; then + umount -d hdc.img.dir + fi + mountpoint -q hdc.img.dir || + rm -rf hdc.img.dir + exit $@ +} -dd if=/dev/zero of=hdc.img bs=1024 seek=$((HDCMEGS*1024-1)) count=1 && -mke2fs -q -b 1024 -F -i 4096 hdc.img && -tune2fs -j -c 0 -i 0 hdc.img && -mkdir hdc.img.dir && -mount -o loop hdc.img hdc.img.dir && -cp -a hdc.dir/* hdc.img.dir && -umount -d hdc.img.dir && -rm -rf hdc.img.dir && -true +trap 'cleanup $?' EXIT +trap 'cleanup 1' HUP PIPE INT QUIT TERM + +size=$(du -ks hdc.dir | sed -rn 's/^([0-9]+).*/\1/p') +[ "$size" -gt 0 ] + +rm -f hdc.img +dd if=/dev/zero of=hdc.img count=1 bs=1024 seek=$(($size*2)) +mkfs.ext3 -q -F -b 1024 -i 4096 hdc.img +tune2fs -c 0 -i 0 hdc.img +mkdir hdc.img.dir +mount -o loop hdc.img hdc.img.dir +cp -a hdc.dir/* hdc.img.dir/ +umount -d hdc.img.dir diff --git a/qemu_multiarch_testing/parallel-build-hdc-img.sh b/qemu_multiarch_testing/parallel-build-hdc-img.sh index cbfe42fb..d98f954c 100755 --- a/qemu_multiarch_testing/parallel-build-hdc-img.sh +++ b/qemu_multiarch_testing/parallel-build-hdc-img.sh @@ -1,13 +1,14 @@ #!/bin/sh -export HDBMEGS=128 +export HDBMEGS=64 build_in_dir() { cd "$1" || exit 1 - rm -f hdb.img 2>/dev/null - nice -n10 ./native-build.sh ../hdc.img - rm -f hdb.img 2>/dev/null + rm -f hdb.img + nice -n10 time ./native-build.sh ../hdc.img + rm -f hdb.img + echo >&3 "Finished: $1" } started=false @@ -15,7 +16,7 @@ for dir; do test -d "$dir" || continue test -e "$dir/native-build.sh" || continue echo "Starting: $dir" - build_in_dir "$dir" "$dir.log" 2>&1 & + build_in_dir "$dir" 3>&1 "$dir.log" 2>&1 & started=true done