diff options
author | Theodore Ts'o <tytso@mit.edu> | 2024-02-09 01:27:52 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-04-11 18:01:23 -0400 |
commit | fda9d3c3d440d7761be0b7e1a10a3cda6f72803f (patch) | |
tree | 29e66c4faa63a604d414818bf7ecd6aa28c13265 | |
parent | ff934652c6f773015db396c9720d85751be763f3 (diff) | |
download | xfstests-bld-fda9d3c3d440d7761be0b7e1a10a3cda6f72803f.tar.gz |
test-appliance: add initial support for optionally building ltp
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fstests-bld/.gitignore | 2 | ||||
-rwxr-xr-x | fstests-bld/build-all | 17 | ||||
-rw-r--r-- | fstests-bld/config | 1 | ||||
-rwxr-xr-x | fstests-bld/gen-tarball | 13 | ||||
-rwxr-xr-x | fstests-bld/get-all | 1 | ||||
-rwxr-xr-x | fstests-bld/get-versions | 7 | ||||
-rwxr-xr-x | test-appliance/files/root/runltptests.sh | 88 |
7 files changed, 128 insertions, 1 deletions
diff --git a/fstests-bld/.gitignore b/fstests-bld/.gitignore index 391b536e..45985ad2 100644 --- a/fstests-bld/.gitignore +++ b/fstests-bld/.gitignore @@ -54,6 +54,8 @@ /keyutils/ /libaio/ /libinih/libinih.a +/ltp +/ltp-dev /nvme-cli /popt/.deps/ /popt/Doxyfile diff --git a/fstests-bld/build-all b/fstests-bld/build-all index 2a453fdc..6422af2d 100755 --- a/fstests-bld/build-all +++ b/fstests-bld/build-all @@ -81,6 +81,7 @@ function set_skip_all () { SKIP_SYZKALLER=yes SKIP_BLKTESTS=yes SKIP_NVME_CLI=yes + SKIP_LTP=yes } # Optional components @@ -91,6 +92,7 @@ function set_skip_all () { [ -d go/src/github.com/google/syzkaller ] || SKIP_SYZKALLER=yes [ -d blktests ] || SKIP_BLKTESTS=yes [ -d nvme-cli ] || SKIP_NVME_CLI=yes +[ -d ltp-dev ] || SKIP_LTP=yes MAKE_CLEAN=":" @@ -178,6 +180,10 @@ while [ "$1" != "" ]; do set_skip_all unset SKIP_NVME_CLI ;; + --ltp-only) + set_skip_all + unset SKIP_LTP + ;; --clean-first) MAKE_CLEAN="make clean" ;; @@ -489,6 +495,17 @@ if test -z "$SKIP_BLKTESTS"; then ver=$(git describe --always --dirty); echo "blktests $ver ($(git log -1 --pretty=%cD))" > ../blktests.ver) fi +if test -z "$SKIP_LTP" ; then + build_start "ltp-dev" + (cd ltp-dev ; \ + ver=$(git describe --always --dirty); echo "ltp $ver ($(git log -1 --pretty=%cD))" > ../ltm.ver ; \ + make autotools; \ + CFLAGS="$LCF -I$DESTDIR/include" \ + LDFLAGS="$LLF $EXEC_LDFLAGS -L$DESTDIR/lib" \ + ./configure $cross --prefix=/ltp ; $MAKE_CLEAN ; \ + make $J all ) +fi + if test -z "$SKIP_NVME_CLI"; then build_start "nvme-cli" (cd nvme-cli ; \ diff --git a/fstests-bld/config b/fstests-bld/config index 7093d2ae..61296bd8 100644 --- a/fstests-bld/config +++ b/fstests-bld/config @@ -18,6 +18,7 @@ BLKTESTS_GIT=https://github.com/osandov/blktests.git # UTIL_LINUX_GIT=https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git # SYZKALLER_GIT=https://github.com/google/syzkaller # NVME_CLI_GIT=https://github.com/linux-nvme/nvme-cli +# LTP_GIT=https://github.com/linux-test-project/ltp FIO_COMMIT=fio-3.28 LIBAIO_COMMIT=libaio-0.3.113 diff --git a/fstests-bld/gen-tarball b/fstests-bld/gen-tarball index 55314fcd..220857ba 100755 --- a/fstests-bld/gen-tarball +++ b/fstests-bld/gen-tarball @@ -52,6 +52,17 @@ if test -z "$SOURCE_DATE_EPOCH" ; then export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) fi +LTP_DIR= +rm -rf ltp +if test -d ltp-dev ; then + LTP_DIR=ltp + echo "GEN ltp" + (D=$(pwd) ; cd ltp-dev ; make DESTDIR=$D SKIP_IDCHECK=1 install) + echo "STRIP ltp/*" + find ltp -mindepth 2 -type f -perm /0111 | xargs -n 50 $STRIP 2> /dev/null \ + || true +fi + echo "GEN xfstests" rm -rf xfstests if test "$fast" = "yes" @@ -108,7 +119,7 @@ then echo "$ARCH" > xfstests/build-arch fi rm -f xfstests.tar.gz -find xfstests blktests -path blktests/.git -prune -o -print0 | \ +find xfstests blktests $LTP_DIR -path blktests/.git -prune -o -print0 | \ LC_ALL=C sort -z | \ tar c --owner=0 --group=0 --numeric-owner --mtime="@${SOURCE_DATE_EPOCH}" \ --mode=go+u-w --null --no-recursion -T - | $GZIP > xfstests.tar.gz diff --git a/fstests-bld/get-all b/fstests-bld/get-all index c94bd398..f07a2902 100755 --- a/fstests-bld/get-all +++ b/fstests-bld/get-all @@ -153,3 +153,4 @@ setup_repo stress-ng STRESS_NG_GIT STRESS_NG_COMMIT false setup_repo util-linux UTIL_LINUX_GIT UTIL_LINUX_COMMIT false setup_repo go/src/github.com/google/syzkaller SYZKALLER_GIT SYZKALLER_COMMIT false setup_repo nvme-cli NVME_CLI_GIT NVME_CLI_COMMIT false +setup_repo ltp-dev LTP_GIT LTP_COMMIT false diff --git a/fstests-bld/get-versions b/fstests-bld/get-versions index 0c05e3be..9f509e1b 100755 --- a/fstests-bld/get-versions +++ b/fstests-bld/get-versions @@ -85,6 +85,13 @@ then cp ../test-appliance/debs/*.ver $TMPDIR fi +if test -d ltp-dev +then + cd ltp-dev + ver=$(git describe --always --dirty); echo "ltp $ver ($(git log -1 --pretty=%cD))" > ../$TMPDIR/ltp.ver + cd .. +fi + cat $TMPDIR/*.ver | sort rm -rf $TMPDIR exit 0 diff --git a/test-appliance/files/root/runltptests.sh b/test-appliance/files/root/runltptests.sh new file mode 100755 index 00000000..e107b491 --- /dev/null +++ b/test-appliance/files/root/runltptests.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +API_MAJOR=1 +API_MINOR=5 +. /root/test-config +. /root/runtests_utils + +RESULTS=/results +RUNSTATS="$RESULTS/run-stats" + +runtests_setup + +if test -n "$FSTESTOPT" ; then + set $FSTESTOPT +else + set "" +fi + +RPT_COUNT=1 + +while [ "$1" != "" ]; do + case "$1" in + aex) + DO_AEX=t + ;; + ltptests) + ;; + count) shift + RPT_COUNT=$1 + ;; + extra_opt) shift + EXTRA_OPT="$EXTRA_OPT $1" + ;; + *) + echo " " + echo "Unrecognized option $1" + echo " " + esac + shift +done + +if test ! -f /.dockerenv ; then + dmesg -n 5 +fi +cd /root/ltp + +if test -n "$FSTESTEXC" ; then + echo $FSTESTEXC | tr , \\n > /tmp/exclude-tests +else + rm -f /tmp/exclude-tests +fi +if test -n "$DO_AEX" ; then + if test -f "/root/ltptests.exclude" ; then + sed -e 's/#.*//' -e 's/[ \t]*$//' -e '/^$/d' \ + < "/root/ltptests.exclude" >> /tmp/exclude-tests + fi +fi + +if test -f /tmp/exclude-tests ; then + EXCLUDE=$(tr "\\n" " " < /tmp/exclude-tests) + echo "EXCLUDE=( $EXCLUDE )" >> /root/ltp/config +fi +cp /root/ltp/config /results + +touch "$RESULTS/fstest-completed" + +runtests_before_tests + +mkdir -p /results/ltp /root/ltp/results +set -vx +mount --bind /results/ltp /root/ltp/results + +cp config "$RESULTS/config" +echo -n "BEGIN LTP " ; date +logger "BEGIN LTP" + +./runltp + +free -m + +echo -n "END LTP " ; date +logger "END TEST $i: $TESTNAME " + +umount /root/ltp/results + +runtests_after_tests + +runtests_save_results_tar |