[haiku-commits] haiku: hrev53493 - src/tests/add-ons/kernel/file_systems/fat

  • From: Jérôme Duval <jerome.duval@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 17 Sep 2019 15:53:44 -0400 (EDT)

hrev53493 adds 1 changeset to branch 'master'
old head: 96e0ae70d496e4c07e58d9c872ae11662e866b2a
new head: 0227e84378aa990d72b38f813de0b558a3d273c5
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=0227e84378aa+%5E96e0ae70d496

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

0227e84378aa: fat: add test script using mkdos, fstorture, fsx.
  
  not fully tested, as fstorture crashes with #15357.
  
  Change-Id: If00368f1287af1d46da38fef4c3943956de1db79
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1867
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

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

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

Revision:    hrev53493
Commit:      0227e84378aa990d72b38f813de0b558a3d273c5
URL:         https://git.haiku-os.org/haiku/commit/?id=0227e84378aa
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sun Sep 15 17:40:05 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/15357

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

1 file changed, 112 insertions(+)
.../add-ons/kernel/file_systems/fat/fat_test.sh  | 112 +++++++++++++++++++

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

diff --git a/src/tests/add-ons/kernel/file_systems/fat/fat_test.sh 
b/src/tests/add-ons/kernel/file_systems/fat/fat_test.sh
new file mode 100644
index 0000000000..d7b779f279
--- /dev/null
+++ b/src/tests/add-ons/kernel/file_systems/fat/fat_test.sh
@@ -0,0 +1,112 @@
+#!/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
+{
+       echo "Run test with bs=${1} ..."
+
+       mkdos --fat 32 ${TEST_DEV}
+
+       mkdir -p ${TEST_MP}
+       mount -t fat ${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
+
+       fsck.fat -f -n ${TEST_DEV}
+       if [ "$?" -ne "0" ]; then
+               echo "fsck.fat fail"
+               exit 1
+       fi
+}
+
+run_fsx() # ${1} => block size ${2} => features list
+{
+       echo "Run run_fsx_combined_parallel with bs=${1}"
+
+       mkdos --fat 32 ${TEST_DEV}
+
+       mkdir -p ${TEST_MP}
+       mount -t fat ${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
+
+       fsck.fat -f -n ${TEST_DEV}
+       if [ "$?" -ne "0" ]; then
+               echo "fsck.fat fail"
+               exit 1
+       fi
+}
+
+# main()
+pkgman install -y cmd:fstorture cmd:fsx cmd:fsck.fat cmd:mkfs.fat
+
+FEATURES=""
+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: hrev53493 - src/tests/add-ons/kernel/file_systems/fat - Jérôme Duval