Skip to content

Commit

Permalink
Update used xfstests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Aug 16, 2023
1 parent b896fe3 commit ba3210a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 63 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ run-xfstests: s3proxy.jar xfstests
./test/run-xfstests.sh

xfstests:
git clone --depth=1 -b v2023.01.01 https://github.com/kdave/xfstests
git clone --depth=1 https://github.com/kdave/xfstests
cd xfstests && patch -p1 -l < ../test/xfstests.diff

s3proxy.jar:
Expand Down
17 changes: 4 additions & 13 deletions test/run-xfstests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,14 @@ sudo apt-get -y install s3cmd
s3cmd --signature-v2 --no-ssl --host-bucket= --access_key=foo --secret_key=bar --host=http://localhost:$PROXY_PORT mb s3://testbucket
s3cmd --signature-v2 --no-ssl --host-bucket= --access_key=foo --secret_key=bar --host=http://localhost:$PROXY_PORT mb s3://testbucket2

cat >xfstests/local.config <<EOF
FSTYP=fuse.geesefs
TEST_DIR=/tmp/geesefs
TEST_DEV=testbucket:
TEST_FS_MOUNT_OPTS="-o allow_other -o--retry-interval=5s -o--log-file=/tmp/geesefs.log -o--endpoint=http://localhost:$PROXY_PORT"
MOUNT_OPTIONS="-o allow_other -o--retry-interval=5s -o--log-file=/tmp/geesefs.log -o--endpoint=http://localhost:$PROXY_PORT"
SCRATCH_DEV=testbucket2:
SCRATCH_MNT=/tmp/geesefs2
UMOUNT_PROG=$(pwd)/xfstests/sync_unmount.py
EOF

cp `dirname $0`/sync_unmount.py xfstests/
sed 's/\/home\/geesefs/$(pwd)/' <test/xfstests.config >xfstests/local.config

cp test/sync_unmount.py xfstests/

cd xfstests
sudo apt-get -y install xfslibs-dev uuid-dev libtool-bin \
e2fsprogs automake gcc libuuid1 quota attr make \
libacl1-dev libaio-dev xfsprogs libgdbm-dev gawk fio dbench \
uuid-runtime python3 sqlite3 libcap-dev
make -j8
sudo -E ./check generic/001 generic/005 generic/006 generic/007 generic/011 generic/013 generic/014
sudo -E ./check -fuse generic/001 generic/005 generic/006 generic/007 generic/011 generic/013 generic/014
18 changes: 9 additions & 9 deletions test/xfstests.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# local.config example for xfstests
FSTYP=fuse.geesefs
TEST_DIR=/home/testdir
TEST_DEV=testbucket:
TEST_FS_MOUNT_OPTS="-o allow_other -o--debug_fuse -o--retry-interval=5s -o--log-file=/root/xfstests/geesefs.log"
MOUNT_OPTIONS="-o allow_other -o--debug_fuse -o--retry-interval=5s -o--log-file=/root/xfstests/geesefs.log"
SCRATCH_DEV=testbucket2:
SCRATCH_MNT=/home/testdir2
UMOUNT_PROG=/root/xfstests/sync_unmount
export TEST_DEV=testbucket
export TEST_DIR=/tmp/geesefs
export SCRATCH_DEV=testbucket2
export SCRATCH_MNT=/tmp/geesefs2
export FSTYP=fuse
export FUSE_SUBTYP=.geesefs
export MOUNT_OPTIONS="-o allow_other -o--retry-interval=5s -o--log-file=/tmp/geesefs.log -o--endpoint=http://localhost:8080"
export TEST_FS_MOUNT_OPTS="-o allow_other -o--retry-interval=5s -o--log-file=/tmp/geesefs.log -o--endpoint=http://localhost:8080"
export UMOUNT_PROG=/home/geesefs/xfstests/sync_unmount.py
51 changes: 11 additions & 40 deletions test/xfstests.diff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/common/config b/common/config
index 164381b7..88ae95b6 100644
index 936ac22..0872664 100644
--- a/common/config
+++ b/common/config
@@ -120,8 +120,11 @@ export MKFS_PROG="$(type -P mkfs)"
@@ -122,8 +122,11 @@ export MKFS_PROG="$(type -P mkfs)"
export MOUNT_PROG="$(type -P mount)"
[ "$MOUNT_PROG" = "" ] && _fatal "mount not found"

Expand All @@ -17,44 +17,15 @@ index 164381b7..88ae95b6 100644
export FSSTRESS_PROG="./ltp/fsstress"
[ ! -x $FSSTRESS_PROG ] && _fatal "fsstress not found or executable"
diff --git a/common/rc b/common/rc
index 154bc2dd..588ed598 100644
index 5c4429e..21f0718 100644
--- a/common/rc
+++ b/common/rc
@@ -774,7 +774,7 @@ _scratch_mkfs()
local mkfs_status
@@ -4545,7 +4545,7 @@ init_rc()

case $FSTYP in
- nfs*|cifs|ceph|overlay|glusterfs|pvfs2|9p|virtiofs)
+ nfs*|cifs|ceph|fuse.geesefs|overlay|glusterfs|pvfs2|9p|virtiofs)
# unable to re-create this fstyp, just remove all files in
# $SCRATCH_MNT to avoid EEXIST caused by the leftover files
# created in previous runs
@@ -1601,6 +1601,15 @@ _require_scratch_nocheck()
_notrun "this test requires a valid \$SCRATCH_MNT"
fi
;;
+ fuse.geesefs)
+ echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
+ if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
+ _notrun "this test requires a valid \$SCRATCH_DEV"
+ fi
+ if [ ! -d "$SCRATCH_MNT" ]; then
+ _notrun "this test requires a valid \$SCRATCH_MNT"
+ fi
+ ;;
pvfs2)
echo $SCRATCH_DEV | grep -q "://" > /dev/null 2>&1
if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
@@ -1798,6 +1807,12 @@ _require_test()
_notrun "this test requires a valid \$TEST_DIR"
fi
;;
+ fuse*)
+ if [ ! -d "$TEST_DIR" ]
+ then
+ _notrun "this test requires a valid \$TEST_DIR"
+ fi
+ ;;
*)
if [ -z "$TEST_DEV" ] || [ "`_is_block_dev "$TEST_DEV"`" = "" ]
then
# Sanity check that TEST partition is not mounted at another mount point
# or as another fs type
- _check_mounted_on TEST_DEV $TEST_DEV TEST_DIR $TEST_DIR $FSTYP || exit 1
+ _check_mounted_on TEST_DEV $TEST_DEV TEST_DIR $TEST_DIR $FSTYP$FUSE_SUBTYP || exit 1
if [ -n "$SCRATCH_DEV" ]; then
# Sanity check that SCRATCH partition is not mounted at another
# mount point, because it is about to be unmounted and formatted.

0 comments on commit ba3210a

Please sign in to comment.