summaryrefslogtreecommitdiffstats
path: root/tests/defaults
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
commit464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/defaults
parentInitial commit. (diff)
downloade2fsprogs-upstream.tar.xz
e2fsprogs-upstream.zip
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/defaults')
-rw-r--r--tests/defaults/e_script47
-rw-r--r--tests/defaults/f_script1
-rw-r--r--tests/defaults/j_script1
3 files changed, 49 insertions, 0 deletions
diff --git a/tests/defaults/e_script b/tests/defaults/e_script
new file mode 100644
index 0000000..8c9cfb6
--- /dev/null
+++ b/tests/defaults/e_script
@@ -0,0 +1,47 @@
+#
+# Default script for testing the relocation library routines
+# (irel -- inode relocation and brel -- block relocation)
+#
+
+if [ -f $test_dir/setup ]; then
+ . $test_dir/setup
+fi
+
+if [ "$class"x = x ]; then
+ class=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\1/'`
+ instance=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\2/'`
+fi
+if [ "$OUT"x = x ]; then
+ OUT=$test_name.log
+fi
+if [ "$EXPECT"x = x ]; then
+ EXPECT=$SRCDIR/progs/test_data/expect.$class
+fi
+
+if [ "$class" = irel ]; then
+ TEST_PROG=$TEST_REL
+elif [ "$class" = brel ]; then
+ TEST_PROG=$TEST_REL
+elif [ "$class" = icount ]; then
+ TEST_PROG=$TEST_ICOUNT
+else
+ TEST_PROG=/bin/cat
+fi
+
+cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \
+ | $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT
+
+cmp -s $EXPECT $OUT
+status=$?
+
+rm -f $test_name.failed $test_name.ok
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXPECT $OUT > $test_name.failed
+fi
+
+unset EXPECT OUT class instance
diff --git a/tests/defaults/f_script b/tests/defaults/f_script
new file mode 100644
index 0000000..7a3b34f
--- /dev/null
+++ b/tests/defaults/f_script
@@ -0,0 +1 @@
+. $cmd_dir/run_e2fsck
diff --git a/tests/defaults/j_script b/tests/defaults/j_script
new file mode 100644
index 0000000..7a3b34f
--- /dev/null
+++ b/tests/defaults/j_script
@@ -0,0 +1 @@
+. $cmd_dir/run_e2fsck