From: Andreas Dilger Date: Fri, 13 Apr 2012 19:24:30 +0000 (-0600) Subject: tests: add basic test case for e2scan X-Git-Tag: v1.42.13.wc6~28 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b5477ef6f8fb42a91388e0ed4b1ce90e6d2c17ad;p=tools%2Fe2fsprogs.git tests: add basic test case for e2scan Add a simple test to verify that e2scan is detecting the correct files in the filesystem based on the modification time. Signed-off-by: Andreas Dilger --- diff --git a/tests/s_basic_scan/image.gz b/tests/s_basic_scan/image.gz new file mode 100644 index 0000000..bf69dda Binary files /dev/null and b/tests/s_basic_scan/image.gz differ diff --git a/tests/s_basic_scan/name b/tests/s_basic_scan/name new file mode 100644 index 0000000..6a7fa9e --- /dev/null +++ b/tests/s_basic_scan/name @@ -0,0 +1 @@ +e2scan quick test \ No newline at end of file diff --git a/tests/s_basic_scan/oklist b/tests/s_basic_scan/oklist new file mode 100644 index 0000000..233b76a --- /dev/null +++ b/tests/s_basic_scan/oklist @@ -0,0 +1,3 @@ +./2/usr/src/packages/SOURCES/e2fsprogs-1.38/po/de.po +./2/usr/src/packages/SOURCES/e2fsprogs-1.38/po/cs.po +./2/usr/src/packages/SOURCES/e2fsprogs-1.38/po/es.po diff --git a/tests/s_basic_scan/script b/tests/s_basic_scan/script new file mode 100644 index 0000000..f5bab61 --- /dev/null +++ b/tests/s_basic_scan/script @@ -0,0 +1,23 @@ +OUT=$test_name.log + +echo e2scan quick test: > $OUT + +echo unzip test image >> $OUT +gunzip < $test_dir/image.gz > $TMPFILE + +echo "find files newer than 5:55:00 MDT Nov 24, 2007" >> $OUT +$E2SCAN -l -N "2007-11-24 05:55:00" -o $test_dir/list -C . $TMPFILE 2> $OUT + +echo compare found list with the correct one >> $OUT +diff -u $test_dir/oklist $test_dir/list >> $OUT 2>&1 +if [ $? -eq 0 ]; then + echo lists match, ok >> $OUT + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo list mismatch, test failed >> $OUT + diff -u $test_dir/list $test_dir/oklist >> $OUT + echo "$test_name: $test_description: failed" + diff -u $test_dir/oklist $test_dir/list > $test_name.failed +fi +rm -f $test_dir/list diff --git a/tests/test_config b/tests/test_config index dbc36fe..56dee97 100644 --- a/tests/test_config +++ b/tests/test_config @@ -16,6 +16,7 @@ DEBUGFS_EXE="../debugfs/debugfs" TEST_BITS="../debugfs/debugfs" RESIZE2FS_EXE="../resize/resize2fs" RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE" +E2SCAN="$USE_VALGRIND ../e2scan/e2scan" E2UNDO_EXE="../misc/e2undo" TEST_REL=../tests/progs/test_rel TEST_ICOUNT=../tests/progs/test_icount