diff --git a/tests/sys/fs/tmpfs/Makefile b/tests/sys/fs/tmpfs/Makefile --- a/tests/sys/fs/tmpfs/Makefile +++ b/tests/sys/fs/tmpfs/Makefile @@ -7,6 +7,9 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs/${FILESYSTEM} +ATF_TESTS_SH+= fsx_test +TEST_METADATA.fsx_test+= required_programs="fsx" + # XXX: uses /dev/MAKEDEV to create pseudo /dev/{null,zero} character devices #NETBSD_ATF_TESTS_SH+= devices_test NETBSD_ATF_TESTS_SH+= create_test diff --git a/tests/sys/fs/tmpfs/fsx_test.sh b/tests/sys/fs/tmpfs/fsx_test.sh new file mode 100644 --- /dev/null +++ b/tests/sys/fs/tmpfs/fsx_test.sh @@ -0,0 +1,56 @@ +# Stress tests based on fsx + +# General stress test of all supported operations. This test case uses a +# random seed. If it ever fails, find the seed in the test output, and create +# a new test case using that fixed seed. +atf_test_case stress +stress_head() +{ + atf_set "descr" "General stress test based on all FSX operations" + atf_set "require.user" "root" +} +stress_body() +{ + test_mount + + cat > ../fsx.toml << HERE +flen = 1048576 +nomsyncafterwrite = true +nosizechecks = false +blockmode = false + +[opsize] +max = 262144 +min = 0 +align = 1 + +[weights] +close_open = 1 +read = 5 +write = 5 +mapread = 5 +mapwrite = 5 +invalidate = 1 +truncate = 1 +fsync = 1 +fdatasync = 1 +posix_fallocate = 1 +punch_hole = 1 +sendfile = 1 +posix_fadvise = 1 +copy_file_range = 1 +HERE + fsx -f ../fsx.toml -N 1024 testfile + atf_check_equal 0 $? + rm ../fsx.toml + + test_unmount +} + +atf_init_test_cases() +{ + . $(atf_get_srcdir)/../h_funcs.subr + . $(atf_get_srcdir)/h_funcs.subr + + atf_add_test_case stress +}