1.1 --- a/test_files/mk_e2test.sh Mon Feb 14 00:44:19 2022 +0100
1.2 +++ b/test_files/mk_e2test.sh Mon Feb 14 00:46:57 2022 +0100
1.3 @@ -1,7 +1,28 @@
1.4 #!/bin/sh
1.5
1.6 +# Make a test filesystem.
1.7 +#
1.8 +# Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 +#
1.10 +# This program is free software; you can redistribute it and/or
1.11 +# modify it under the terms of the GNU General Public License as
1.12 +# published by the Free Software Foundation; either version 2 of
1.13 +# the License, or (at your option) any later version.
1.14 +#
1.15 +# This program is distributed in the hope that it will be useful,
1.16 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.17 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.18 +# GNU General Public License for more details.
1.19 +#
1.20 +# You should have received a copy of the GNU General Public License
1.21 +# along with this program; if not, write to the Free Software
1.22 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.23 +# Boston, MA 02110-1301, USA
1.24 +
1.25 PROGNAME=$(basename "$0")
1.26
1.27 +# Handle program options.
1.28 +
1.29 if [ "$1" = '-q' ] ; then
1.30 QUIET=$1
1.31 shift 1
1.32 @@ -31,9 +52,11 @@
1.33
1.34 OPTIONS='-u 1000 -g 1000'
1.35
1.36 +# Define a convenience function for e2access invocation.
1.37 +
1.38 e2access()
1.39 {
1.40 - "$E2ACCESS" $OPTIONS $*
1.41 + "$E2ACCESS" $OPTIONS "$TARGET" $*
1.42 }
1.43
1.44 # Make a filesystem for the example.
1.45 @@ -102,8 +125,8 @@
1.46 # Add the directories and files to the image.
1.47
1.48 for DIR in home/paulb/private home/paulb/public home/paulb/shared home/paulb/many home/paulb ; do
1.49 - e2access "$TARGET" make-dirs "$DIR"
1.50 - e2access "$TARGET" copy-in $(find "$DIR" -maxdepth 1 -type f | sort) "$DIR"
1.51 + e2access mkdir "$DIR"
1.52 + e2access copy-in $(find "$DIR" -maxdepth 1 -type f | sort) "$DIR"
1.53 done
1.54
1.55 # Leave the root of the filesystem.
1.56 @@ -111,13 +134,13 @@
1.57 cd ..
1.58
1.59 if [ ! "$QUIET" ] ; then
1.60 - e2access "$TARGET" list-dirs ''
1.61 - e2access "$TARGET" list-dirs 'home'
1.62 - e2access "$TARGET" list-dirs 'home/paulb'
1.63 - e2access "$TARGET" list-dirs 'home/paulb/many'
1.64 - e2access "$TARGET" list-dirs 'home/paulb/private'
1.65 - e2access "$TARGET" list-dirs 'home/paulb/public'
1.66 - e2access "$TARGET" list-dirs 'home/paulb/shared'
1.67 + e2access ls ''
1.68 + e2access ls 'home'
1.69 + e2access ls 'home/paulb'
1.70 + e2access ls 'home/paulb/many'
1.71 + e2access ls 'home/paulb/private'
1.72 + e2access ls 'home/paulb/public'
1.73 + e2access ls 'home/paulb/shared'
1.74 fi
1.75
1.76 rm -r tmp_e2test