[haiku-commits] haiku: hrev53473 - src/tests/add-ons/kernel/file_systems/ext2

  • From: Jérôme Duval <jerome.duval@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 11 Sep 2019 01:43:19 -0400 (EDT)

hrev53473 adds 1 changeset to branch 'master'
old head: 0c82f64bf608fbec4e2637162cc34e562e2343a5
new head: afbf0848e11e468e7d1d21eeec7d57d9995071dd
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=afbf0848e11e+%5E0c82f64bf608

----------------------------------------------------------------------------

afbf0848e11e: ext2: add test script for ext2 filesystem.
  
  based on a test script from FreeBSD.
  this uses fsx and fstorture to exercise the fs, mkfs.ext3 to initialize,
  e2fsck to check the integrity. single-threaded test is OK, multi-threaded is 
not.
  the following blocksizes and features are tested: 1K, 2K and 4K; huge_file,
  dir_nlink, extent, 64bit, metadata_csum.
  
  Change-Id: I948672194bfae0132341183efa4f4af962e2de02
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1843
  Reviewed-by: Rene Gollent <rene@xxxxxxxxxxx>

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53473
Commit:      afbf0848e11e468e7d1d21eeec7d57d9995071dd
URL:         https://git.haiku-os.org/haiku/commit/?id=afbf0848e11e
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Tue Sep 10 16:16:07 2019 UTC

----------------------------------------------------------------------------

1 file changed, 139 insertions(+)
.../kernel/file_systems/ext2/extents_test.sh     | 139 +++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/src/tests/add-ons/kernel/file_systems/ext2/extents_test.sh 
b/src/tests/add-ons/kernel/file_systems/ext2/extents_test.sh
new file mode 100644
index 0000000000..ffabe125d3
--- /dev/null
+++ b/src/tests/add-ons/kernel/file_systems/ext2/extents_test.sh
@@ -0,0 +1,139 @@
+#!/bin/sh
+
+# This test require specially hacked fsx and fstorture binaries from here:
+# https://github.com/thedrgreenthumb/fstools
+
+TEST_DEV="/dev/disk/ata/1/master/raw"
+TEST_MP="/mount"
+
+MY_PATH=${PWD}
+
+run_fstorture() # ${1} => block size ${2} => features list
+{
+       echo "Run test with bs=${1} and features ${2} ..."
+
+       mkfs.ext3 -b ${1} ${2} -F ${TEST_DEV}
+       dumpe2fs ${TEST_DEV} | grep 'Filesystem features'
+
+       mkdir -p ${TEST_MP}
+       mount -t ext2 ${TEST_DEV} ${TEST_MP}
+
+       if [ ! -f /bin/fstorture ]; then
+               echo "Can not find test binary in ${PWD}"
+               exit 1
+       fi
+
+       cp /bin/fstorture ${TEST_MP}/fstorture
+
+       mkdir ${TEST_MP}/root0 ${TEST_MP}/root1
+       cd ${TEST_MP} && ./fstorture root0 root1 1 -c 1000 nosoftlinks
+
+       cd ${MY_PATH}
+
+       sleep 5
+
+       unmount ${TEST_MP}
+       if [ "$?" -ne "0" ]; then
+               echo "Can not unmount..."
+               exit 1
+       fi
+
+       e2fsck -f -n ${TEST_DEV}
+       if [ "$?" -ne "0" ]; then
+               echo "e2fsck fail"
+               exit 1
+       fi
+}
+
+run_fsx() # ${1} => block size ${2} => features list
+{
+       echo "Run run_fsx_combined_parallel with bs=${1} and features ${2} ..."
+
+       mkfs.ext3 -b ${1} ${2} -F ${TEST_DEV}
+       dumpe2fs ${TEST_DEV} | grep 'Filesystem features'
+
+       mkdir -p ${TEST_MP}
+       mount -t ext2 ${TEST_DEV} ${TEST_MP}
+
+       if [ ! -f /bin/fsx ]; then
+               echo "Can not find test binary in ${PWD}"
+               exit 1
+       fi
+
+       cp /bin/fsx ${TEST_MP}/fsx
+
+       cd ${TEST_MP}
+
+       NUM_OPS=2000
+       SEED=0
+       ./fsx -S ${SEED} -N ${NUM_OPS}                       ./TEST_FILE0 &
+       ./fsx -S ${SEED} -l 5234123 -o 5156343 -N ${NUM_OPS} ./TEST_FILE1 &
+       ./fsx -S ${SEED} -l 2311244 -o 2311200 -N ${NUM_OPS} ./TEST_FILE2 &
+       ./fsx -S ${SEED} -l 8773121 -o 863672  -N ${NUM_OPS} ./TEST_FILE3 &
+       ./fsx -S ${SEED} -l 234521 -o 234521   -N ${NUM_OPS} ./TEST_FILE4 &
+       ./fsx -S ${SEED} -l 454321 -o 33       -N ${NUM_OPS} ./TEST_FILE5 &
+       ./fsx -S ${SEED} -l 7234125 -o 7876728 -N ${NUM_OPS} ./TEST_FILE6 &
+       ./fsx -S ${SEED} -l 5646463 -o 4626734 -N ${NUM_OPS} ./TEST_FILE7 &
+
+       for job in `jobs -p`
+       do
+               wait $job
+       done
+
+       cd ${MY_PATH}
+
+       sleep 5
+
+       unmount ${TEST_MP}
+       if [ "$?" -ne "0" ]; then
+               echo "Can not unmount..."
+               exit 1
+       fi
+
+       e2fsck -f -n ${TEST_DEV}
+       if [ "$?" -ne "0" ]; then
+               echo "e2fsck fail"
+               exit 1
+       fi
+}
+
+# main()
+pkgman install -y cmd:fstorture cmd:fsx cmd:e2fsck
+
+FEATURES="-O huge_file -O dir_nlink -O extent"
+run_fsx "1024" "$FEATURES"
+run_fstorture "1024" "$FEATURES"
+
+run_fsx "2048" "$FEATURES"
+run_fstorture "2048" "$FEATURES"
+
+run_fsx "4096" "$FEATURES"
+run_fstorture "4096" "$FEATURES"
+
+#run_fsx "64k" "-O huge_file -O dir_nlink -O extent"
+#run_fstorture "64k" "-O huge_file -O dir_nlink -O extent"
+
+FEATURES="$FEATURES -O 64bit"
+
+run_fsx "1024" "$FEATURES"
+run_fstorture "1024" "$FEATURES"
+
+run_fsx "2048" "$FEATURES"
+run_fstorture "2048" "$FEATURES"
+
+run_fsx "4096" "$FEATURES"
+run_fstorture "4096" "$FEATURES"
+
+FEATURES="$FEATURES -O metadata_csum"
+
+run_fsx "1024" "$FEATURES"
+run_fstorture "1024" "$FEATURES"
+
+run_fsx "2048" "$FEATURES"
+run_fstorture "2048" "$FEATURES"
+
+run_fsx "4096" "$FEATURES"
+run_fstorture "4096" "$FEATURES"
+
+echo PASSED
+


Other related posts:

  • » [haiku-commits] haiku: hrev53473 - src/tests/add-ons/kernel/file_systems/ext2 - Jérôme Duval