1.1 --- a/conf/dstest_test.cfg Sun Aug 01 22:10:19 2021 +0200
1.2 +++ b/conf/dstest_test.cfg Sun Aug 01 22:10:26 2021 +0200
1.3 @@ -12,12 +12,20 @@
1.4 },
1.5 log = { "server", "r" },
1.6 },
1.7 - "rom/dstest_test_server", "20");
1.8 + "rom/dstest_test_server", "40");
1.9
1.10 l:start({
1.11 caps = {
1.12 server = server,
1.13 },
1.14 - log = { "client", "g" },
1.15 + log = { "client1", "g" },
1.16 },
1.17 "rom/dstest_test_client");
1.18 +
1.19 +l:start({
1.20 + caps = {
1.21 + server = server,
1.22 + },
1.23 + log = { "client2", "b" },
1.24 + },
1.25 + "rom/dstest_test_client");
2.1 --- a/tests/Makefile Sun Aug 01 22:10:19 2021 +0200
2.2 +++ b/tests/Makefile Sun Aug 01 22:10:26 2021 +0200
2.3 @@ -8,6 +8,7 @@
2.4 dstest_host_client \
2.5 dstest_pipe_client \
2.6 dstest_test_client \
2.7 + $(PKGDIR)/../conf/e2test.fs
2.8
2.9 MODE = static
2.10
2.11 @@ -28,3 +29,8 @@
2.12 REQUIRES_LIBS = l4re_c-util libfsclient libmem libipc libstdc++ libsystypes libe2access_blockserver
2.13
2.14 include $(L4DIR)/mk/prog.mk
2.15 +
2.16 +# Special rule to build the test filesystem.
2.17 +
2.18 +$(PKGDIR)/../conf/e2test.fs:
2.19 + $(PKGDIR)/mk_e2test.sh $(PKGDIR) $(L4DIR)/e2access $@
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tests/mk_e2test.sh Sun Aug 01 22:10:26 2021 +0200
3.3 @@ -0,0 +1,72 @@
3.4 +#!/bin/sh
3.5 +
3.6 +THIS_DIR=$(realpath $(dirname "$0"))
3.7 +
3.8 +PKGDIR=$1
3.9 +E2ACCESS_DIR=$2
3.10 +TARGET=$3
3.11 +
3.12 +if [ ! -e "$PKGDIR" ] || [ ! -e "$E2ACCESS_DIR" ] || [ ! "$TARGET" ] ; then
3.13 + echo "Usage: $0 <package directory> <e2access directory> <target>" 1>&2
3.14 + exit 1
3.15 +fi
3.16 +
3.17 +TARGET=`realpath "$TARGET"`
3.18 +
3.19 +# Initialise the program details and environment.
3.20 +
3.21 +E2ACCESS="$E2ACCESS_DIR"/e2access
3.22 +export LD_LIBRARY_PATH="$E2ACCESS_DIR"
3.23 +
3.24 +# Make a filesystem for the example.
3.25 +
3.26 +mkdir tmp_e2test
3.27 +cd tmp_e2test
3.28 +mkdir -p home/paulb/many
3.29 +cd home/paulb/many
3.30 +
3.31 +# Populate the directory with plenty of files.
3.32 +
3.33 +for N in `seq 1 400`; do
3.34 + echo "Contents of #$N." > "file-$N".txt
3.35 +done
3.36 +
3.37 +cd ..
3.38 +
3.39 +# Put a file in the directory above.
3.40 +
3.41 +cp "$PKGDIR/../docs/LICENCE.txt" .
3.42 +
3.43 +# Leave the filesystem root.
3.44 +
3.45 +cd ../..
3.46 +
3.47 +# Create a filesystem image.
3.48 +
3.49 +EXTRA=2000
3.50 +SIZE=$(du -s -k home | cut -f 1)
3.51 +TOTAL=$(($SIZE + $EXTRA))
3.52 +
3.53 +dd if=/dev/zero of="$TARGET" bs=1024 count=$TOTAL
3.54 +
3.55 +if ! $(/sbin/mkfs.ext2 -q "$TARGET") ; then
3.56 + exit 1
3.57 +fi
3.58 +
3.59 +# Add the directory and files to the image.
3.60 +
3.61 +"$E2ACCESS" "$TARGET" --make-dirs home/paulb/many
3.62 +
3.63 +"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb/many -maxdepth 1 -type f | sort) home/paulb/many
3.64 +"$E2ACCESS" "$TARGET" --copy-in $(find home/paulb -maxdepth 1 -type f | sort) home/paulb
3.65 +
3.66 +# Leave the root of the filesystem.
3.67 +
3.68 +cd ..
3.69 +
3.70 +"$E2ACCESS" "$TARGET" --list-dirs ''
3.71 +"$E2ACCESS" "$TARGET" --list-dirs 'home'
3.72 +"$E2ACCESS" "$TARGET" --list-dirs 'home/paulb'
3.73 +"$E2ACCESS" "$TARGET" --list-dirs 'home/paulb/many'
3.74 +
3.75 +rm -r tmp_e2test