1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test_files/Control Sun Aug 01 22:48:12 2021 +0200
1.3 @@ -0,0 +1,2 @@
1.4 +provides: fstest_files
1.5 +maintainer: paul@boddie.org.uk
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/test_files/Makefile Sun Aug 01 22:48:12 2021 +0200
2.3 @@ -0,0 +1,13 @@
2.4 +PKGDIR ?= .
2.5 +L4DIR ?= $(PKGDIR)/../../..
2.6 +
2.7 +TARGET = $(PKGDIR)/../conf/e2test.fs
2.8 +
2.9 +include $(L4DIR)/mk/Makeconf
2.10 +
2.11 +# Special rules to build the test filesystem.
2.12 +
2.13 +all:: $(TARGET)
2.14 +
2.15 +$(TARGET):
2.16 + $(PKGDIR)/mk_e2test.sh -q $(PKGDIR) $(L4DIR)/e2access $@
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/test_files/mk_e2test.sh Sun Aug 01 22:48:12 2021 +0200
3.3 @@ -0,0 +1,83 @@
3.4 +#!/bin/sh
3.5 +
3.6 +THIS_DIR=$(realpath $(dirname "$0"))
3.7 +
3.8 +if [ "$1" = '-q' ] ; then
3.9 + QUIET=$1
3.10 + shift 1
3.11 +else
3.12 + QUIET=
3.13 +fi
3.14 +
3.15 +PKGDIR=$1
3.16 +E2ACCESS_DIR=$2
3.17 +TARGET=$3
3.18 +
3.19 +if [ ! -e "$PKGDIR" ] || [ ! -e "$E2ACCESS_DIR" ] || [ ! "$TARGET" ] ; then
3.20 + echo "Usage: $0 [ -q ] <package directory> <e2access directory> <target>" 1>&2
3.21 + exit 1
3.22 +fi
3.23 +
3.24 +PKGDIR=`realpath "$PKGDIR"`
3.25 +E2ACCESS_DIR=`realpath "$E2ACCESS_DIR"`
3.26 +TARGET=`realpath "$TARGET"`
3.27 +
3.28 +# Initialise the program details and environment.
3.29 +
3.30 +E2ACCESS="$E2ACCESS_DIR"/e2access
3.31 +export LD_LIBRARY_PATH="$E2ACCESS_DIR"
3.32 +
3.33 +# Make a filesystem for the example.
3.34 +
3.35 +mkdir tmp_e2test
3.36 +cd tmp_e2test
3.37 +mkdir -p home/paulb/many
3.38 +cd home/paulb/many
3.39 +
3.40 +# Populate the directory with plenty of files.
3.41 +
3.42 +for N in `seq 1 400`; do
3.43 + echo "Contents of #$N." > "file-$N".txt
3.44 +done
3.45 +
3.46 +cd ..
3.47 +
3.48 +# Put a file in the directory above.
3.49 +
3.50 +cp "$PKGDIR/../docs/LICENCE.txt" .
3.51 +
3.52 +# Leave the filesystem root.
3.53 +
3.54 +cd ../..
3.55 +
3.56 +# Create a filesystem image.
3.57 +
3.58 +EXTRA=2000
3.59 +SIZE=$(du -s -k home | cut -f 1)
3.60 +TOTAL=$(($SIZE + $EXTRA))
3.61 +
3.62 +dd if=/dev/zero of="$TARGET" bs=1024 count=$TOTAL
3.63 +
3.64 +if ! $(/sbin/mkfs.ext2 -q "$TARGET") ; then
3.65 + exit 1
3.66 +fi
3.67 +
3.68 +# Add the directory and files to the image.
3.69 +
3.70 +"$E2ACCESS" "$TARGET" --make-dirs home/paulb/many
3.71 +
3.72 +"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb/many -maxdepth 1 -type f | sort) home/paulb/many
3.73 +"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb -maxdepth 1 -type f | sort) home/paulb
3.74 +
3.75 +# Leave the root of the filesystem.
3.76 +
3.77 +cd ..
3.78 +
3.79 +if [ ! "$QUIET" ] ; then
3.80 + "$E2ACCESS" "$TARGET" --list-dirs ''
3.81 + "$E2ACCESS" "$TARGET" --list-dirs 'home'
3.82 + "$E2ACCESS" "$TARGET" --list-dirs 'home/paulb'
3.83 + "$E2ACCESS" "$TARGET" --list-dirs 'home/paulb/many'
3.84 +fi
3.85 +
3.86 +rm -r tmp_e2test
4.1 --- a/tests/Control Sun Aug 01 22:10:26 2021 +0200
4.2 +++ b/tests/Control Sun Aug 01 22:48:12 2021 +0200
4.3 @@ -1,3 +1,3 @@
4.4 -requires: libstdc++ libc libipc libfsclient libmem libext2fs libext2fs_blockserver libe2access_blockserver
4.5 +requires: libstdc++ libc libipc libfsclient libmem libext2fs libext2fs_blockserver libe2access_blockserver fstest_files
4.6 provides: fstests
4.7 maintainer: paul@boddie.org.uk
5.1 --- a/tests/Makefile Sun Aug 01 22:10:26 2021 +0200
5.2 +++ b/tests/Makefile Sun Aug 01 22:48:12 2021 +0200
5.3 @@ -7,8 +7,7 @@
5.4 dstest_file_client \
5.5 dstest_host_client \
5.6 dstest_pipe_client \
5.7 - dstest_test_client \
5.8 - $(PKGDIR)/../conf/e2test.fs
5.9 + dstest_test_client
5.10
5.11 MODE = static
5.12
5.13 @@ -29,8 +28,3 @@
5.14 REQUIRES_LIBS = l4re_c-util libfsclient libmem libipc libstdc++ libsystypes libe2access_blockserver
5.15
5.16 include $(L4DIR)/mk/prog.mk
5.17 -
5.18 -# Special rule to build the test filesystem.
5.19 -
5.20 -$(PKGDIR)/../conf/e2test.fs:
5.21 - $(PKGDIR)/mk_e2test.sh $(PKGDIR) $(L4DIR)/e2access $@
6.1 --- a/tests/mk_e2test.sh Sun Aug 01 22:10:26 2021 +0200
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,72 +0,0 @@
6.4 -#!/bin/sh
6.5 -
6.6 -THIS_DIR=$(realpath $(dirname "$0"))
6.7 -
6.8 -PKGDIR=$1
6.9 -E2ACCESS_DIR=$2
6.10 -TARGET=$3
6.11 -
6.12 -if [ ! -e "$PKGDIR" ] || [ ! -e "$E2ACCESS_DIR" ] || [ ! "$TARGET" ] ; then
6.13 - echo "Usage: $0 <package directory> <e2access directory> <target>" 1>&2
6.14 - exit 1
6.15 -fi
6.16 -
6.17 -TARGET=`realpath "$TARGET"`
6.18 -
6.19 -# Initialise the program details and environment.
6.20 -
6.21 -E2ACCESS="$E2ACCESS_DIR"/e2access
6.22 -export LD_LIBRARY_PATH="$E2ACCESS_DIR"
6.23 -
6.24 -# Make a filesystem for the example.
6.25 -
6.26 -mkdir tmp_e2test
6.27 -cd tmp_e2test
6.28 -mkdir -p home/paulb/many
6.29 -cd home/paulb/many
6.30 -
6.31 -# Populate the directory with plenty of files.
6.32 -
6.33 -for N in `seq 1 400`; do
6.34 - echo "Contents of #$N." > "file-$N".txt
6.35 -done
6.36 -
6.37 -cd ..
6.38 -
6.39 -# Put a file in the directory above.
6.40 -
6.41 -cp "$PKGDIR/../docs/LICENCE.txt" .
6.42 -
6.43 -# Leave the filesystem root.
6.44 -
6.45 -cd ../..
6.46 -
6.47 -# Create a filesystem image.
6.48 -
6.49 -EXTRA=2000
6.50 -SIZE=$(du -s -k home | cut -f 1)
6.51 -TOTAL=$(($SIZE + $EXTRA))
6.52 -
6.53 -dd if=/dev/zero of="$TARGET" bs=1024 count=$TOTAL
6.54 -
6.55 -if ! $(/sbin/mkfs.ext2 -q "$TARGET") ; then
6.56 - exit 1
6.57 -fi
6.58 -
6.59 -# Add the directory and files to the image.
6.60 -
6.61 -"$E2ACCESS" "$TARGET" --make-dirs home/paulb/many
6.62 -
6.63 -"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb/many -maxdepth 1 -type f | sort) home/paulb/many
6.64 -"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb -maxdepth 1 -type f | sort) home/paulb
6.65 -
6.66 -# Leave the root of the filesystem.
6.67 -
6.68 -cd ..
6.69 -
6.70 -"$E2ACCESS" "$TARGET" --list-dirs ''
6.71 -"$E2ACCESS" "$TARGET" --list-dirs 'home'
6.72 -"$E2ACCESS" "$TARGET" --list-dirs 'home/paulb'
6.73 -"$E2ACCESS" "$TARGET" --list-dirs 'home/paulb/many'
6.74 -
6.75 -rm -r tmp_e2test