Whamcloud - gitweb
tests: add basic test case for e2scan v1.42.3-lustre
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 13 Apr 2012 19:24:30 +0000 (13:24 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 29 May 2012 08:09:28 +0000 (02:09 -0600)
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 <adilger@whamcloud.com>
tests/s_basic_scan/image.gz [new file with mode: 0644]
tests/s_basic_scan/name [new file with mode: 0644]
tests/s_basic_scan/oklist [new file with mode: 0644]
tests/s_basic_scan/script [new file with mode: 0644]
tests/test_config

diff --git a/tests/s_basic_scan/image.gz b/tests/s_basic_scan/image.gz
new file mode 100644 (file)
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 (file)
index 0000000..6a7fa9e
--- /dev/null
@@ -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 (file)
index 0000000..233b76a
--- /dev/null
@@ -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 (file)
index 0000000..1d7e29f
--- /dev/null
@@ -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 $TMPFILE -N "2007-11-24 05:55:00" -o $test_dir/list -C . 2>/dev/null
+
+echo compare found list with the correct one >> $OUT
+diff -u $test_dir/oklist $test_dir/list >> $OUT
+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
index 7c59766..fd7e190 100644 (file)
@@ -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