From: Lionel Sambuc Date: Fri, 8 Mar 2013 16:02:27 +0000 (+0100) Subject: Installing posix tests in /usr/tests/minix-posix X-Git-Tag: v3.3.0~1093 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F395%2F3;p=minix.git Installing posix tests in /usr/tests/minix-posix The goal is to enable anyone to simply run our current test suite. Change-Id: I27d8856cb82a4be2baa5dc5273526383b7f4fc2c --- diff --git a/Makefile b/Makefile index dce1cde8f..02ffe19b0 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,7 @@ _SUBDIR= tools lib .WAIT include gnu external crypto/external bin games _SUBDIR+= libexec sbin usr.bin _SUBDIR+= commands man _SUBDIR+= common drivers kernel servers -_SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress +_SUBDIR+= usr.sbin share rescue sys etc test compat .WAIT distrib regress .if defined(__MINIX) _SUBDIR+= benchmarks diff --git a/distrib/sets/lists/minix/md.i386 b/distrib/sets/lists/minix/md.i386 index b220c1c8f..e64397bd7 100644 --- a/distrib/sets/lists/minix/md.i386 +++ b/distrib/sets/lists/minix/md.i386 @@ -170,3 +170,9 @@ ./usr/sbin/ti1225 minix-sys ./usr/sbin/vbox minix-sys ./usr/sbin/virtio_net minix-sys +./usr/tests/minix-posix/mod minix-sys +./usr/tests/minix-posix/test47 minix-sys +./usr/tests/minix-posix/test51 minix-sys +./usr/tests/minix-posix/test57 minix-sys +./usr/tests/minix-posix/test62 minix-sys +./usr/tests/minix-posix/test63 minix-sys diff --git a/distrib/sets/lists/minix/mi b/distrib/sets/lists/minix/mi index c820f9778..89c61c46d 100644 --- a/distrib/sets/lists/minix/mi +++ b/distrib/sets/lists/minix/mi @@ -4520,6 +4520,90 @@ ./usr/spool/mail minix-sys ./usr/spool minix-sys ./usr/src minix-sys +./usr/tests minix-sys +./usr/tests/minix-posix minix-sys +./usr/tests/minix-posix/run minix-sys +./usr/tests/minix-posix/t10a minix-sys +./usr/tests/minix-posix/t11a minix-sys +./usr/tests/minix-posix/t11b minix-sys +./usr/tests/minix-posix/t40a minix-sys +./usr/tests/minix-posix/t40b minix-sys +./usr/tests/minix-posix/t40c minix-sys +./usr/tests/minix-posix/t40d minix-sys +./usr/tests/minix-posix/t40e minix-sys +./usr/tests/minix-posix/t40f minix-sys +./usr/tests/minix-posix/t60a minix-sys +./usr/tests/minix-posix/t60b minix-sys +./usr/tests/minix-posix/t67a minix-sys +./usr/tests/minix-posix/t67b minix-sys +./usr/tests/minix-posix/t68a minix-sys +./usr/tests/minix-posix/t68b minix-sys +./usr/tests/minix-posix/test1 minix-sys +./usr/tests/minix-posix/test10 minix-sys +./usr/tests/minix-posix/test11 minix-sys +./usr/tests/minix-posix/test12 minix-sys +./usr/tests/minix-posix/test13 minix-sys +./usr/tests/minix-posix/test14 minix-sys +./usr/tests/minix-posix/test15 minix-sys +./usr/tests/minix-posix/test16 minix-sys +./usr/tests/minix-posix/test17 minix-sys +./usr/tests/minix-posix/test18 minix-sys +./usr/tests/minix-posix/test19 minix-sys +./usr/tests/minix-posix/test2 minix-sys +./usr/tests/minix-posix/test20 minix-sys +./usr/tests/minix-posix/test21 minix-sys +./usr/tests/minix-posix/test22 minix-sys +./usr/tests/minix-posix/test23 minix-sys +./usr/tests/minix-posix/test24 minix-sys +./usr/tests/minix-posix/test25 minix-sys +./usr/tests/minix-posix/test26 minix-sys +./usr/tests/minix-posix/test27 minix-sys +./usr/tests/minix-posix/test28 minix-sys +./usr/tests/minix-posix/test29 minix-sys +./usr/tests/minix-posix/test3 minix-sys +./usr/tests/minix-posix/test30 minix-sys +./usr/tests/minix-posix/test31 minix-sys +./usr/tests/minix-posix/test32 minix-sys +./usr/tests/minix-posix/test33 minix-sys +./usr/tests/minix-posix/test34 minix-sys +./usr/tests/minix-posix/test35 minix-sys +./usr/tests/minix-posix/test36 minix-sys +./usr/tests/minix-posix/test37 minix-sys +./usr/tests/minix-posix/test38 minix-sys +./usr/tests/minix-posix/test39 minix-sys +./usr/tests/minix-posix/test4 minix-sys +./usr/tests/minix-posix/test40 minix-sys +./usr/tests/minix-posix/test41 minix-sys +./usr/tests/minix-posix/test42 minix-sys +./usr/tests/minix-posix/test43 minix-sys +./usr/tests/minix-posix/test44 minix-sys +./usr/tests/minix-posix/test45 minix-sys +./usr/tests/minix-posix/test46 minix-sys +./usr/tests/minix-posix/test48 minix-sys +./usr/tests/minix-posix/test49 minix-sys +./usr/tests/minix-posix/test5 minix-sys +./usr/tests/minix-posix/test50 minix-sys +./usr/tests/minix-posix/test52 minix-sys +./usr/tests/minix-posix/test53 minix-sys +./usr/tests/minix-posix/test54 minix-sys +./usr/tests/minix-posix/test55 minix-sys +./usr/tests/minix-posix/test56 minix-sys +./usr/tests/minix-posix/test58 minix-sys +./usr/tests/minix-posix/test59 minix-sys +./usr/tests/minix-posix/test6 minix-sys +./usr/tests/minix-posix/test60 minix-sys +./usr/tests/minix-posix/test61 minix-sys +./usr/tests/minix-posix/test64 minix-sys +./usr/tests/minix-posix/test65 minix-sys +./usr/tests/minix-posix/test66 minix-sys +./usr/tests/minix-posix/test67 minix-sys +./usr/tests/minix-posix/test68 minix-sys +./usr/tests/minix-posix/test7 minix-sys +./usr/tests/minix-posix/test8 minix-sys +./usr/tests/minix-posix/test9 minix-sys +./usr/tests/minix-posix/testinterp minix-sys +./usr/tests/minix-posix/testsh1 minix-sys +./usr/tests/minix-posix/testsh2 minix-sys ./usr/tmp minix-sys ./usr/var/db minix-sys ./usr/var/db/pkg minix-sys diff --git a/etc/mtree/NetBSD.dist.base b/etc/mtree/NetBSD.dist.base index 698efdf27..664be6ac0 100644 --- a/etc/mtree/NetBSD.dist.base +++ b/etc/mtree/NetBSD.dist.base @@ -132,6 +132,8 @@ ./usr/spool/lpd ./usr/spool/mail ./usr/src +./usr/tests +./usr/tests/minix-posix ./usr/var ./usr/var/db ./usr/var/db/pkg diff --git a/releasetools/arm_sdimage.sh b/releasetools/arm_sdimage.sh index 9f4acd6ad..86a5b9e2a 100755 --- a/releasetools/arm_sdimage.sh +++ b/releasetools/arm_sdimage.sh @@ -2,74 +2,75 @@ set -e if [ `id -u` -ne 0 ] -then - echo "This script should be running as root calling sudo" +then echo "This script should be running as root calling sudo" sudo $0 exit 1 fi -MP_MINIX=/tmp/minix -MP_BOOT=/tmp/minixboot - : ${ARCH=evbearm-el} : ${OBJ=../obj.${ARCH}} : ${CROSS_TOOLS=${OBJ}/"tooldir.`uname -s`-`uname -r`-`uname -m`"/bin} : ${CROSS_PREFIX=${CROSS_TOOLS}/arm-elf32-minix-} +: ${JOBS=-j4} : ${DESTDIR=${OBJ}/destdir.$ARCH} -: ${FSTAB=$DESTDIR/etc/fstab} +: ${FSTAB=${DESTDIR}/etc/fstab} + +: ${MP_MINIX=/tmp/minix} +: ${MP_BOOT=/tmp/minixboot} + : ${LOOP=/dev/loop0} : ${EMPTYIMG=minix_arm_sd_empty.img} : ${IMG=minix_arm_sd.img} BUILDSH=build.sh -if [ ! -f $BUILDSH ] -then echo "Please invoke me from the root source dir, where $BUILDSH is." +if [ ! -f ${BUILDSH} ] +then echo "Please invoke me from the root source dir, where ${BUILDSH} is." exit 1 fi if [ ! -f ${EMPTYIMG}.bz2 ] -then echo Retrieving $EMPTYIMG +then echo Retrieving ${EMPTYIMG} wget http://www.minix3.org/arm/${EMPTYIMG}.bz2 fi if [ ! -f $IMG ] -then echo decompressing $EMPTYIMG onto $IMG +then echo decompressing ${EMPTYIMG} onto ${IMG} bzip2 -d -k ${EMPTYIMG}.bz2 - mv $EMPTYIMG $IMG + mv ${EMPTYIMG} ${IMG} fi # remove fstab and generated pw db -rm -rf $DESTDIR/etc +rm -rf ${DESTDIR}/etc -sh build.sh -j4 -m$ARCH -O $OBJ -D $DESTDIR -u distribution +sh build.sh ${JOBS} -m ${ARCH} -O ${OBJ} -D ${DESTDIR} -u distribution -cat >$FSTAB <${FSTAB} < # Some have special flags compiling -CFLAGS.test51=-mhard-float -CFLAGS.test52=-mhard-float +.if ${MACHINE_ARCH} == "i386" +# LSC FIXME: Compilation error for now on ARM with that! +COPTS.test51.c= -mhard-float +COPTS.test52.c= -mhard-float +.endif + +COPTS.test9.c= -O0 +COPTS.test37.c= -O0 +COPTS.test53.c= -O0 +COPTS.test68.c= -O0 # Some have special libraries -LDADD.test59= -lmthread -LDFLAGS.mod= -shared # make shared object +LDADD.test59= -lmthread +LDFLAGS.mod= -shared # make shared object # Some have an extra file -OBJS.test57=test57loop.o +OBJS.test57= test57loop.o -.for t in \ +# Tests to compile, For every architecture +MINIX_TESTS= \ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \ 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \ -41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \ -61 62 64 65 66 67 68 -PROG+= test$(t) +41 42 43 44 45 46 48 49 50 52 53 54 55 56 58 59 60 \ +61 64 65 66 67 68 + +.if ${MACHINE_ARCH} == "i386" +MINIX_TESTS+= \ + 47 51 57 \ + 62 +.endif # ${MACHINE_ARCH} == "i386" + +.if ${MACHINE_ARCH} == "earm" +# LSC Not yet supported on ARM +MKPIC:= no +LDSTATIC:= -static +.endif + +.for t in ${MINIX_TESTS} +PROGS+= test${t} .endfor -PROG+= t10a t11a t11b t40a t40b t40c t40d t40e t40f t60a t60b \ +PROGS+= t10a t11a t11b t40a t40b t40c t40d t40e t40f t60a t60b \ t67a t67b t68a t68b -.include +SCRIPTS+= run testinterp.sh testsh1.sh testsh2.sh -.if $(MKPIC) == "yes" +.if ${MKPIC} == "yes" # Build them as dynamic executables by default if shared libraries # are available; so that the building and executing of dynamic # executables is tested @@ -40,19 +67,12 @@ LDSTATIC= -dynamic # Add test that must be linked dynamically, and its dynamically loaded # module -PROG+= test63 mod +PROGS+= test63 mod .endif -.include - -# Some are suid-root -all: - chmod 4755 test11 test33 test43 test44 test46 test56 test60 test61 \ - test65 - +# LSC Make sure there is not leftover after a failed testrun clean: .PHONY .MAKE $(MAKE) -C select clean - rm -rf *.o *.s *.bak test? test?? t10a t11a t11b \ - t40a t40b t40c t40d t40e t40f \ - t60a t60b t67a t67b t68a t68b \ - DIR* + rm -rf DIR* + +.include diff --git a/test/run b/test/run index 4c81951a4..4d3cc8fd8 100755 --- a/test/run +++ b/test/run @@ -11,6 +11,9 @@ skipped=`expr 0` # count number of tests that were skipped total=`expr 0` # total number of tests tried badones= # list of tests that failed +# Tests which require setuid +setuids="test11 test33 test43 test44 test46 test56 test60 test61 test65" + tests=" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \ 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \ 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \ @@ -21,6 +24,10 @@ tests_no=`expr 0` # Directory must be owned by bin [ "$USER" != root ] || chown bin . +# If root, make sure the setuid tests have the correct permissions +[ "$USER" = root ] && chown root ${setuids} +[ "$USER" = root ] && chmod 4755 ${setuids} + # Count tests for i in `echo $tests`; do if [ -x ./test$i ]; then diff --git a/test/test48.c b/test/test48.c old mode 100755 new mode 100644 diff --git a/test/test49.c b/test/test49.c old mode 100755 new mode 100644