Skip to content

Commit

Permalink
move filesystem tests to tests/fs; regularize naming
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
  • Loading branch information
Kent Overstreet committed Jul 11, 2024
1 parent bd32ae7 commit 909aa3f
Show file tree
Hide file tree
Showing 133 changed files with 105 additions and 70 deletions.
5 changes: 0 additions & 5 deletions tests/bcachefs/xfstests-nocow.ktest

This file was deleted.

File renamed without changes.
22 changes: 0 additions & 22 deletions tests/block/discard

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions tests/fs/bcachefs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bcachefs-tools
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ktest_arch=x86

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/bcachefs-test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../bcachefs-test-libs.sh

config-timeout 30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ktest framework.
#

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../test-libs.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../../test-libs.sh

require-git http://evilpiepirate.org/git/bcachefs-tools.git
require-make bcachefs-tools
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/fs/bcachefs/fstests-nocow.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

export MKFS_OPTIONS="--nocow"

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/fstests.ktest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require-make linuxquota

require-git http://evilpiepirate.org/git/xfstests.git ../xfstests

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config BCACHEFS_POSIX_ACL
require-kernel-config BCACHEFS_QUOTA
Expand All @@ -22,7 +22,7 @@ run_test()
bcachefs_antagonist
fi

run_xfstests "$@"
run_fstests "$@"

check_counters ${ktest_scratch_dev[0]}
check_counters ${ktest_scratch_dev[1]}
Expand Down
4 changes: 2 additions & 2 deletions tests/bcachefs/fuse.ktest → tests/fs/bcachefs/fuse.ktest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require-make linuxquota

require-git http://evilpiepirate.org/git/xfstests.git ../xfstests

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config FUSE_FS

Expand All @@ -19,7 +19,7 @@ run_tests()
{
mv /usr/local/sbin/mount.fuse.bcachefs /sbin

run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../test-libs.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../../test-libs.sh

require-git http://evilpiepirate.org/git/bcachefs-tools.git
require-make bcachefs-tools
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-kernel-config PREEMPT
export NO_BCACHEFS_DEBUG=1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-git http://evilpiepirate.org/git/bcachefs-tools.git
require-make bcachefs-tools
Expand Down
2 changes: 1 addition & 1 deletion tests/bcachefs/perf.ktest → tests/fs/bcachefs/perf.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-git http://evilpiepirate.org/git/bcachefs-tools.git
require-make bcachefs-tools
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/btrfs/fstests.ktest → tests/fs/btrfs/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config BTRFS_FS
require-kernel-config BTRFS_FS_POSIX_ACL
Expand All @@ -15,7 +15,7 @@ export MKFS_OPTIONS=

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions tests/ext2.ktest → tests/fs/ext2/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config EXT2_FS
require-kernel-config EXT2_FS_XATTR
require-kernel-config EXT2_FS_POSIX_ACL

export FSTYP=ext2
export MKFS_OPTIONS=

run_tests()
{
export MKFS_OPTIONS=

run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/ext4/fstests.ktest → tests/fs/ext4/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config EXT4_FS
require-kernel-config EXT4_FS_POSIX_ACL
Expand All @@ -12,7 +12,7 @@ export MKFS_OPTIONS=

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/f2fs/fstests.ktest → tests/fs/f2fs/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config F2FS_FS
require-kernel-config F2FS_STAT_FS
Expand All @@ -14,7 +14,7 @@ export MKFS_OPTIONS=

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/xfstests.sh → tests/fs/fstests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# xfstests wrapper:

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/test-libs.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../test-libs.sh

require-git https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git xfstests

Expand Down Expand Up @@ -50,7 +50,7 @@ list_tests()
popd > /dev/null
}

run_xfstests()
run_fstests()
{
if [[ ! -f /xfstests-init-done ]]; then
mkswap ${ktest_scratch_dev[3]}
Expand Down
4 changes: 2 additions & 2 deletions tests/jfs/fstests.ktest → tests/fs/jfs/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config JFS_FS
require-kernel-config JFS_POSIX_ACL
Expand All @@ -12,7 +12,7 @@ export MKFS_OPTIONS=

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/nfs/xfstests.ktest → tests/fs/nfs/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-git http://evilpiepirate.org/git/xfstests.git ../xfstests

Expand Down Expand Up @@ -73,7 +73,7 @@ EOF
touch /xfstests-config-done
fi

run_xfstests "$@"
run_fstests "$@"
}

main "$@"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

config-timeout-multiplier 3

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/nilfs2/fstests.ktest → tests/fs/nilfs2/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config NILFS2_FS

Expand All @@ -9,7 +9,7 @@ export MKFS_OPTIONS=

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
7 changes: 7 additions & 0 deletions tests/fs/nilfs2/gcov-fstests.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/fstests.ktest
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PuzzleFS tests
#

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../test-libs.sh
. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-git https://github.com/project-machine/puzzlefs
require-make puzzlefs
Expand Down
41 changes: 41 additions & 0 deletions tests/fs/squashfs.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../test-libs.sh

require-kernel-config MISC_FILESYSTEMS
require-kernel-config SQUASHFS
require-kernel-config SQUASHFS_ZLIB
require-kernel-config SQUASHFS_LZO
require-kernel-config SQUASHFS_LZ4
require-kernel-config SQUASHFS_XZ
require-kernel-config SQUASHFS_ZSTD

config-timeout $(stress_timeout)

config-image /home/kent/squashfs-test-images/file.sqsh
config-image /home/kent/squashfs-test-images/bcachefs-tools.gzip.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.lz4.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.lzo.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.xz.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.zstd.sqfs

case $1 in
prep)
for c in gzip lzo lz4 xz zstd lzma; do
mksquashfs . bcachefs-tools.$c.sqfs -comp $c
done
;;
esac

test_squashfs()
{
for dev in /dev/vdb; do
echo "testing image $dev"

mount -t squashfs $dev /mnt
find /mnt -type f -print|xargs cat > /dev/null
umount /mnt
done
}

main "$@"
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/xfs/fstests.ktest → tests/fs/xfs/fstests.ktest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../xfstests.sh
. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../fstests.sh

require-kernel-config XFS_FS
require-kernel-config XFS_QUOTA
Expand All @@ -17,7 +17,7 @@ export FSTYP=xfs

run_tests()
{
run_xfstests "$@"
run_fstests "$@"
}

main "$@"
7 changes: 7 additions & 0 deletions tests/fs/xfs/gcov-fstests.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../../test-libs.sh

require-gcov fs/xfs

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/fstests.ktest
3 changes: 3 additions & 0 deletions tests/fs/xfs/kasan-fstests.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../kasan-base.sh
3 changes: 3 additions & 0 deletions tests/fs/xfs/lockdep-fstests.ktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/../lockdep-base.sh
Loading

0 comments on commit 909aa3f

Please sign in to comment.