diff --git a/Makefile b/Makefile index 4c5f78caa05cc17962ad4723b1234cf786db5f28..65049db11a8c05148985f5c6791b94b4176c01a0 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,32 @@ install: - yum install -y gcc + yum install -y wget zip unzip git gcc if [ -h /usr/local/bin/tone ]; then \ rm -rf /usr/local/bin/tone; \ fi ln -s `pwd`/tone /usr/local/bin/tone - pip3 install -r requirements.txt + if [ ! -f /usr/bin/python ]; then \ + if [ -f /usr/bin/python3 ]; then \ + ln -s /usr/bin/python3 /usr/bin/python; \ + elif [ -f /usr/bin/python2 ]; then \ + ln -s /usr/bin/python2 /usr/bin/python; \ + else \ + echo "Can Not find python in /usr/bin"; \ + exit 1; \ + fi; \ + fi + + if [ ! -f /usr/bin/pip ]; then \ + if [ -f /usr/bin/pip3 ]; then \ + ln -s /usr/bin/pip3 /usr/bin/pip; \ + elif [ -f /usr/bin/pip2 ]; then \ + ln -s /usr/bin/pip2 /usr/bin/pip; \ + else \ + echo "Can Not find pip in /usr/bin"; \ + exit 1; \ + fi; \ + fi + + pip install -r requirements.txt clean: find . -type f -name "*.pyc" | xargs rm -f @@ -15,4 +37,4 @@ clean: uninstall: if [ -h /usr/local/bin/tone ]; then \ rm -rf /usr/local/bin/tone; \ - fi + fi \ No newline at end of file diff --git a/matrics/conf/functional/ltp.conf b/conf/functional/ltp.conf similarity index 100% rename from matrics/conf/functional/ltp.conf rename to conf/functional/ltp.conf diff --git a/conf/functional/perf-test.conf b/conf/functional/perf-test.conf new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/conf/functional/xfstests.conf b/conf/functional/xfstests.conf new file mode 100644 index 0000000000000000000000000000000000000000..4d93e29426be316fd6d12c2dd3228834982b16d0 --- /dev/null +++ b/conf/functional/xfstests.conf @@ -0,0 +1,29 @@ +fs fs2 test mkfsopt +ext4 Na Na Na +ext4 Na quick Na +ext4 Na aio Na +ext4 Na prealloc Na +ext4 Na ioctl Na +ext4 Na dangerous Na +ext4 overlay Na Na +ext4 Na Na bigalloc +ext4 Na quick bigalloc +ext4 nfsv3 Na Na +ext4 nfsv4.0 Na Na +ext4 nfsv4.1 Na Na +ext4 nfsv4.2 Na Na +ext4 dm Na Na +xfs Na Na Na +xfs Na quick Na +xfs Na aio Na +xfs Na prealloc Na +xfs Na ioctl Na +xfs Na dangerous Na +xfs overlay Na Na +xfs Na Na bigalloc +xfs Na quick bigalloc +xfs nfsv3 Na Na +xfs nfsv4.0 Na Na +xfs nfsv4.1 Na Na +xfs nfsv4.2 Na Na +xfs dm Na Na diff --git a/matrics/conf/performance/hackbench.conf b/conf/performance/hackbench.conf similarity index 100% rename from matrics/conf/performance/hackbench.conf rename to conf/performance/hackbench.conf diff --git a/matrics/conf/performance/iperf.conf b/conf/performance/iperf.conf similarity index 100% rename from matrics/conf/performance/iperf.conf rename to conf/performance/iperf.conf diff --git a/matrics/conf/performance/netperf.conf b/conf/performance/netperf.conf similarity index 100% rename from matrics/conf/performance/netperf.conf rename to conf/performance/netperf.conf diff --git a/matrics/conf/performance/sysbench.conf b/conf/performance/sysbench.conf similarity index 100% rename from matrics/conf/performance/sysbench.conf rename to conf/performance/sysbench.conf diff --git a/matrics/conf/performance/unixbench.conf b/conf/performance/unixbench.conf similarity index 100% rename from matrics/conf/performance/unixbench.conf rename to conf/performance/unixbench.conf diff --git a/core/modules/cli/run/List.py b/core/modules/cli/run/List.py index 7f5bd5fa6dd01303ee4119fc82e08c842038ef61..6412984cb87c149cbbdc0ff212908bb6621e08d7 100644 --- a/core/modules/cli/run/List.py +++ b/core/modules/cli/run/List.py @@ -47,14 +47,12 @@ class List(CLI): _, iv, fields = read_conf(testconf.conf_path, suite) logger.debug("Should list {}".format(suite)) output = [] - recorder = ["index"] + recorder = [] recorder.extend([field for field in fields if field != 'testconf']) recorder.append('testconf') output.append(recorder) - fieldwidth = { - 'index': 5 - } - nfields = ['index'] + fieldwidth = {} + nfields = [] for field in fields: fieldwidth[field] = len(field) if field == 'testconf': @@ -65,7 +63,7 @@ class List(CLI): nfields.append('testconf') for index, data in enumerate(iv): - recorder = [index] + recorder = [] for field in fields: if len(data[field]) > fieldwidth[field]: fieldwidth[field] = len(data[field]) @@ -84,8 +82,8 @@ class List(CLI): category = self._check_test_suite_category(config.parser) dirs = os.path.realpath(__file__).split(os.path.sep) rootpath = os.path.join('/', *dirs[:-5]) - confpath = os.path.join(rootpath, 'matrics', 'conf') - testspath = os.path.join(rootpath, 'matrics', 'tests') + confpath = os.path.join(rootpath, 'conf') + testspath = os.path.join(rootpath, 'tests') if category: conffiles = glob.glob( os.path.join(confpath, category, '*')) diff --git a/core/modules/cli/run/Run.py b/core/modules/cli/run/Run.py index f710df0bf8e88b6ba47ceea47c9bf7a50d261880..a2385a9d7d6134decec9c317c1f683fd3f8d875b 100644 --- a/core/modules/cli/run/Run.py +++ b/core/modules/cli/run/Run.py @@ -64,33 +64,14 @@ class Run(CLI): logger.debug(testconf) v, iv, _ = read_conf(testconf.conf_path, suite_name) if conf_index: - if conf_type == '::': - if pattern.match(conf_index): - tlist = self.extend_testconf_index(conf_index) - for i in tlist: - try: - suites.add( - suite_name, iv[i], - runtimes=self.get_runtimes(config.parser)) - except IndexError: - logger.error("{} is out of range: {}".format(i, len(iv))) - except BaseException as e: - logger.error("Unknow error") - logger.error(e) - else: - logger.error("test conf index format error {}".format( - conf_index - )) - else: - try: - suites.add( - suite_name, v[ts], - runtimes=self.get_runtimes(config.parser)) - except KeyError: - logger.error("Can not find {} from {}".format(ts, suite_name)) - except BaseException as e: - logger.error("Unknow error") - logger.error(e) + try: + suites.add(suite_name, v[ts], + runtimes=self.get_runtimes(config.parser)) + except KeyError: + logger.error("Can not find {} from {}".format(ts, suite_name)) + except BaseException as e: + logger.error("Unknow error") + logger.error(e) else: for conf in v: suites.add( diff --git a/core/modules/cli/run/Subcommand.py b/core/modules/cli/run/Subcommand.py index 49e55bc921dcebf6ad18f37ff553aac19246ee46..14006278fe300813f3da7495f67d3e1f22201e90 100644 --- a/core/modules/cli/run/Subcommand.py +++ b/core/modules/cli/run/Subcommand.py @@ -25,7 +25,7 @@ class Subcommand(CLI): group = lparser.add_mutually_exclusive_group() group.add_argument( '--tools', action='store_true', default=True, - help='Archive run tools includes tools, matrics, results') + help='Archive run tools includes tools, tests, results') group.add_argument( '--results', action='store_true', default=False, help='Archive results includes cache build run and result') diff --git a/core/modules/subcommand/run/Archive.py b/core/modules/subcommand/run/Archive.py index 5d8903d159380d3cb7648e9539abbd2a70061fdc..74a822be61c3af3c0ae36cbfcea3b9bd96830347 100644 --- a/core/modules/subcommand/run/Archive.py +++ b/core/modules/subcommand/run/Archive.py @@ -14,33 +14,34 @@ class Archive(TESTMODULE): return print("Archiving .... ") archive_dir = ( - 'test_cache_path', - 'test_run_path', + #'test_cache_path', + #'test_run_path', 'test_result_path', - 'test_build_path', + #'test_build_path', ) try: if not subflow.config.parser['results']: - tarball = "test_tool.zip" + tarball = "test_tool.tar" else: - tarball = "test_result.zip" + tarball = "test_result.tar" tarball = os.path.join( subflow.config.tone_path, tarball ) self.remove_file(tarball) + target_dirs = [] if not subflow.config.parser['results']: for d in subflow.config.frame_tool: target = os.path.join( subflow.config.tone_path, d) print(target) - self.create_tar( - tarball, target) - pass + target_dirs.append(target) for d in archive_dir: print(subflow.config[d]) - self.create_tar(tarball, subflow.config[d]) + target_dirs.append(subflow.config[d]) + target_dirs = [i for i in target_dirs if os.path.exists(i)] + self.create_tar(tarball, target_dirs) print( "Done\n" "Archive file: {}".format(tarball) @@ -55,21 +56,32 @@ class Archive(TESTMODULE): elif os.path.exists(filename): raise Exception("The same target {} exists".format(filename)) - def create_tar(self, tarball, src): - os.chdir(os.path.dirname(src)) - cmd = ["/bin/zip"] - if os.path.exists(tarball): - cmd.append("-urq") - else: - cmd.append("-rq") - cmd.append(tarball) - cmd.append(os.path.basename(src)) - ignore_path = os.path.join( - os.path.basename(src), - '.git' - ) - if os.path.exists(ignore_path): - cmd.append('-x') - cmd.append(os.path.join(ignore_path, '*')) + # def create_tar(self, tarball, src): + # os.chdir(os.path.dirname(src)) + # cmd = ["/bin/zip"] + # if os.path.exists(tarball): + # cmd.append("-urq") + # else: + # cmd.append("-rq") + # cmd.append(tarball) + # cmd.append(os.path.basename(src)) + # ignore_path = os.path.join( + # os.path.basename(src), + # '.git' + # ) + # if os.path.exists(ignore_path): + # cmd.append('-x') + # cmd.append(os.path.join(ignore_path, '*')) + # logger.debug(" ".join(cmd)) + # subprocess.check_call(cmd) + + def create_tar(self, tarball, src_dirs): + if not src_dirs: + logger.debug("Create tarball skipped") + return False + os.chdir(os.path.dirname(src_dirs[0])) + cmd = ["/bin/tar", "-cf", tarball] + for src in src_dirs: + cmd.append(os.path.basename(src)) logger.debug(" ".join(cmd)) subprocess.check_call(cmd) diff --git a/core/utils/configure.py b/core/utils/configure.py index 2eadbbcdbdf130a9df75377242401bc199856a10..08e744233fcb25f125d6599020b161b16ad7dd05 100644 --- a/core/utils/configure.py +++ b/core/utils/configure.py @@ -96,7 +96,6 @@ class AppConfig(BaseConfig): 'etc', 'lib', 'Makefile', - 'matrics', 'README.md', 'scripts', 'tone', @@ -142,9 +141,9 @@ class AppConfig(BaseConfig): self.test_result_path = os.path.join(tone_wrk_root, 'result') self.test_source_path = os.path.join( - self.tone_path, 'matrics', 'tests') - self.test_conf_path = os.path.join(self.tone_path, 'matrics', 'conf') - self.test_yaml_path = os.path.join(self.tone_path, 'matrics', 'yaml') + self.tone_path, 'tests') + self.test_conf_path = os.path.join(self.tone_path, 'conf') + self.test_yaml_path = os.path.join(self.tone_path, 'yaml') if 'TONE_USER' in os.environ: self.git_user = os.environ.get('TONE_USER') diff --git a/core/utils/tests.py b/core/utils/tests.py index 372c17fa64a97e2768b11ebe47427f919a66ebe9..c025c996ddc74bf83892c4dc12f62b4d1668ffb4 100644 --- a/core/utils/tests.py +++ b/core/utils/tests.py @@ -78,9 +78,9 @@ def read_conf(fn, suite='-'): converter[fields[j]].get(tmp[j])) origin_value[fields[j]] = tmp[j] if 'testconf' not in fields: - testconf = suite + ":" + "-".join( - [origin_value[f] for f in fields if - origin_value[f] != "Na"]) + testconf = suite + ":" + \ + ",".join([f + "=" + origin_value[f] + for f in fields if origin_value[f] != "Na"]) if testconf == suite + ':': testconf = suite + ':default' recorder['testconf'] = testconf @@ -603,7 +603,16 @@ class TestEnvInit(object): # pdb.set_trace() # 在result_path后添加scenaria组成新的result_path tmp = self.config.current_scenaria['scenaria'].split(':') - result_path = os.path.join(self.config.result_path, tmp[-1]) + # process the result path + _test_params = [] + for i in tmp[-1].split(","): + if "=" in i: + _test_params.append(i.split("=")[-1]) + else: + _test_params.append(i) + _result_path = "-".join((_test_params)) + + result_path = os.path.join(self.config.result_path, _result_path) maxstep = 0 for p in glob.glob(os.path.join(result_path, '[0-9]*')): name = os.path.basename(p) diff --git a/docs/add-testsuite-zh_CN.md b/docs/add-testsuite-zh_CN.md index 2cab9a3f56e513adc8f699648fa6c7fbc6f2a47d..a3e43d960e99f8eb3ae1441b054517e94c93007e 100644 --- a/docs/add-testsuite-zh_CN.md +++ b/docs/add-testsuite-zh_CN.md @@ -3,11 +3,10 @@ ## 创建文件(目录) ```bash -mkdir /matrics/tests/$benchmark_name/ -touch /matrics/tests/$benchmark_name/install.sh # 用于安装 -touch /matrics/tests/$benchmark_name/run.sh # 用于运行 -touch /matrics/tests/$benchmark_name/README.md # 测试套说明 -touch /matrics/yaml/$benchmark_name.yaml # 生成conf文件,用于后续传参 +mkdir /tests/$benchmark_name/ +touch /tests/$benchmark_name/install.sh # 用于安装 +touch /tests/$benchmark_name/run.sh # 用于运行 +touch /tests/$benchmark_name/README.md # 测试套说明 ``` ## 文件内容填充 @@ -35,7 +34,3 @@ touch /matrics/yaml/$benchmark_name.yaml # 生成conf文件,用于后续传参 - 运行参数说明 - 结果说明 - 手动运行方法 - -### $benchmark.yaml - -- 参数组合:对于拥有多个值的多个参数,会对不同参数的值进行组合后生成conf文件, 使用conf文件给run函数传参 \ No newline at end of file diff --git a/etc/tonerc b/etc/tonerc new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/lib/common.sh b/lib/common.sh index c850f894027cac9a8188ad47f6005e7e73a074a1..210c036e2f62b4a471b46e73a07d034b04bdc13a 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -11,8 +11,8 @@ export TONE_CACHE_DIR=$TONE_ROOT/cache export TONE_BUILD_DIR=$TONE_ROOT/build export TONE_RUN_DIR=$TONE_ROOT/run export TONE_RESULT_DIR=$TONE_ROOT/result -export TONE_SUITE_DIR=$TONE_ROOT/matrics/tests -export TONE_CONF_DIR=$TONE_ROOT/matrics/conf +export TONE_SUITE_DIR=$TONE_ROOT/tests +export TONE_CONF_DIR=$TONE_ROOT/conf if [ -n "$testsuite" ]; then export TONE_BM_CACHE_DIR=$TONE_CACHE_DIR/$testsuite @@ -55,13 +55,14 @@ EOF # GIT_SSH_COMMAND: Set ssh key for git command used for ssh format path security_setting() { + tonerc="$TONE_ROOT/etc/tonerc" cat <&+,]", "", name) + if status.startswith('FAILED'): + status = 'Fail' + elif status.startswith('Skip'): + status = 'Skip' + elif status.startswith('Ok'): + status = 'Pass' + else: + print("Error: unrecognized status at {} {}".format(index, line)) + print(name, status) + sys.exit(1) + print("{}: {}".format(name, status)) diff --git a/tests/perf-test/run.sh b/tests/perf-test/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..d1c59c5aefd3706f24d36baf1a2b9f4ac6526ec9 --- /dev/null +++ b/tests/perf-test/run.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +run() +{ + perf test 2>&1 +} + +parse() +{ + "$TONE_BM_SUITE_DIR"/parse.py +} diff --git a/matrics/tests/sysbench/Readme.md b/tests/sysbench/Readme.md similarity index 100% rename from matrics/tests/sysbench/Readme.md rename to tests/sysbench/Readme.md diff --git a/matrics/tests/sysbench/install.sh b/tests/sysbench/install.sh similarity index 100% rename from matrics/tests/sysbench/install.sh rename to tests/sysbench/install.sh diff --git a/matrics/tests/sysbench/run.sh b/tests/sysbench/run.sh similarity index 100% rename from matrics/tests/sysbench/run.sh rename to tests/sysbench/run.sh diff --git a/matrics/tests/sysbench/sysbench.awk b/tests/sysbench/sysbench.awk similarity index 100% rename from matrics/tests/sysbench/sysbench.awk rename to tests/sysbench/sysbench.awk diff --git a/matrics/tests/unixbench/README.md b/tests/unixbench/README.md similarity index 100% rename from matrics/tests/unixbench/README.md rename to tests/unixbench/README.md diff --git a/matrics/tests/unixbench/install.sh b/tests/unixbench/install.sh similarity index 100% rename from matrics/tests/unixbench/install.sh rename to tests/unixbench/install.sh diff --git a/matrics/tests/unixbench/patches/unixbench.patch b/tests/unixbench/patches/unixbench.patch similarity index 100% rename from matrics/tests/unixbench/patches/unixbench.patch rename to tests/unixbench/patches/unixbench.patch diff --git a/matrics/tests/unixbench/run.sh b/tests/unixbench/run.sh similarity index 100% rename from matrics/tests/unixbench/run.sh rename to tests/unixbench/run.sh diff --git a/tests/xfstests/Readme.md b/tests/xfstests/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..21ca96f63e30a4b8b9984373d79b8eb7e5bfe280 --- /dev/null +++ b/tests/xfstests/Readme.md @@ -0,0 +1,36 @@ +# xfstest +### Description +xfstests is a file system regression test suite which was originally developed by Silicon Graphics (SGI) for the XFS file system. Now xfstests is used as a file system regression test suite for all of Linux major file systems: xfs, ext2, ext4, cifs, btrfs, f2fs, reiserfs, gfs, jfs, udf, nfs, and tmpfs + +### Homepage + +### Version +1.1.0 + +## Category +Functional + +### Parameters +- _disk_type_ : hdd +- _nr_disk_ : 4 2 +- _fs_ : ext4 xfs +- _test_ : add generic-all ext4-all overlay-all shared-all +- _mkfsopt_ : bigalloc +- _timeout_ : 4h + +### Results +generic/236: Pass +generic/237: Pass +generic/238: Conf +generic/239: Pass +generic/240: Pass +generic/241: Pass +generic/242: Conf +generic/243: Conf +generic/244: Pass +generic/245: Pass +generic/246: Pass +generic/247: Failed + +### Manual Run + diff --git a/tests/xfstests/blacklists/ext4-exclude b/tests/xfstests/blacklists/ext4-exclude new file mode 100644 index 0000000000000000000000000000000000000000..0a32f91bdd6550f92f68c703d5b4cbc74611713f --- /dev/null +++ b/tests/xfstests/blacklists/ext4-exclude @@ -0,0 +1,25 @@ +# generic/042 and generic/392 are failing because ext4 forces the +# resolution of all delayed allocation writes before allowing the +# punch operation to proceed. We probably want to see if we can avoid +# this for the future, but what ext4 is doing is legal, so just skip +# the test for now +generic/042 +generic/392 + +# generic/04[456] tests how truncate and delayed allocation works +# ext4 uses the data=ordered to avoid exposing stale data, and +# so it uses a different mechanism than xfs. So these tests will fail +generic/044 +generic/045 +generic/046 + +# generic/223 tests file alignment, which works on ext4 only by +# accident because we're not RAID stripe aware yet, and works at all +# because we have bias towards aligning on power-of-two block numbers. +# It is a flaky test for some configurations, so skip it. +generic/223 + +# The shutdown ioctl will sometimes result in a corrupted file systems +# it really shouldn't, but we probably won't have it fixed for a while. +# So exclude it for now. +generic/388 \ No newline at end of file diff --git a/tests/xfstests/blacklists/nfs-exclude b/tests/xfstests/blacklists/nfs-exclude new file mode 100644 index 0000000000000000000000000000000000000000..259a471ac524a065e68ba6b0b9c0ee97de340a16 --- /dev/null +++ b/tests/xfstests/blacklists/nfs-exclude @@ -0,0 +1,12 @@ +# The following tests are listed as expected failures for NFSv3 and NFSv4 per +# https://wiki.linux-nfs.org/wiki/index.php/Xfstests +generic/035 +generic/423 +generic/465 +generic/467 +generic/477 + +# This test is not listed as an expected failure, but it shows up as +# failing in the expected output of the linux-nfs Wiki page. So we'll +# suppress this failure for now. +generic/294 \ No newline at end of file diff --git a/tests/xfstests/install.sh b/tests/xfstests/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..91ca34cc1a8b38bab7f548c422c7833453bdf4f4 --- /dev/null +++ b/tests/xfstests/install.sh @@ -0,0 +1,78 @@ + +. $TONE_ROOT/lib/disk.sh + +FIO_GIT_URL="https://git.kernel.org/pub/scm/linux/kernel/git/axboe/fio.git" +XFSTESTS_GIT_URL="https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git" + +DEP_PKG_LIST="acl attr gawk bc dump e2fsprogs gawk gcc + libtool lvm2 make psmisc quota sed xfsdump libacl-devel libattr-devel dbench indent + libaio-devel libuuid-devel python36 sqlite libblkid-devel fio xfsprogs xfsprogs-devel" +DEP_PKG_LIST_BAK="btrfs-progs-devel liburing-devel" +FIO_BRANCH="fio-3.19" + +if [ -n "$BRANCH" ]; then + branch="$BRANCH" +else + kver=$(uname -r | cut -d. -f1-2) + branch="master" + [[ $kver =~ 5\.[0-9]+ ]] && branch="kernel-5.10" +fi + +fetch() +{ + echo "\$XFSTESTS_GIT_URL for git clone or update" + git_clone_mirror $XFSTESTS_GIT_URL $TONE_BM_CACHE_DIR/xfstests-dev + echo "\$FIO_GIT_URL for git clone or update" + git_clone_mirror $FIO_GIT_URL $TONE_BM_CACHE_DIR/fio +} + +extract_src() +{ + set_git_clone + + echo "Clone xfstests code to build path" + mkdir $TONE_BM_BUILD_DIR/xfstests-dev + cd "$TONE_BM_BUILD_DIR/xfstests-dev" || exit 1 + git_clone_exec "$TONE_BM_CACHE_DIR/xfstests-dev" "$TONE_BM_BUILD_DIR/xfstests-dev" --branch "$branch" + + # build fio from source code and overwrite system version + fio_ver=$(fio --version 2>/dev/null | sed 's/fio-//g' | cut -d. -f1) + if [ -z "$fio_ver" ] || [ "$fio_ver" -lt 3 ]; then + echo "Clone fio code to build path" + mkdir $TONE_BM_BUILD_DIR/fio + cd "$TONE_BM_BUILD_DIR/fio" || exit 1 + git_clone_exec "$TONE_BM_CACHE_DIR/fio" "$TONE_BM_BUILD_DIR/fio" --branch "$branch" + fi +} + +build_xfstests(){ + cd $TONE_BM_BUILD_DIR/xfstests-dev + make configure || return + ./configure --prefix=$TONE_RUN_DIR/ + make && make install +} + +fio_build_install() +{ + [ -d "$TONE_BM_BUILD_DIR/fio" ] || return + # remove system version fio + rpm -qa | grep -q fio && rpm -e fio + # build fio from source code + cd $TONE_BM_BUILD_DIR/fio + ./configure + make + make install +} + +build() +{ + export CFLAGS="-fcommon" + fio_build_install + build_xfstests || return +} + +install() +{ + : +} + diff --git a/tests/xfstests/parse.awk b/tests/xfstests/parse.awk new file mode 100755 index 0000000000000000000000000000000000000000..3a32364dd563b6114b0766ced4cc51188da3c2a7 --- /dev/null +++ b/tests/xfstests/parse.awk @@ -0,0 +1,21 @@ +#!/usr/bin/awk -f + +/\[expunged\]/ { + printf("%s: Skip\n",$1) + next +} + +/\[not run\]/ { + printf("%s: Conf\n",$1) + next +} + + +$NF ~ /^[0-9]+s/{ + printf("%s: Pass\n",$1) + next +} + +/output mismatch/{ + printf("%s: Failed\n",$1) +} diff --git a/tests/xfstests/run.sh b/tests/xfstests/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..3c7b55caf60e462b15cc09eac25733b0bb44c86a --- /dev/null +++ b/tests/xfstests/run.sh @@ -0,0 +1,96 @@ +#!/bin/bash -x + +. $TONE_ROOT/lib/disk.sh + +add_user() +{ + [ -n "$1" ] || return + grep -q -w "$1" /etc/passwd && return + useradd $1 +} + +disk_type_options() +{ + case $disk_type in + nfsv3) + nfsvers=3 + def_mount="-o vers=$nfsvers" + export TEST_FS_MOUNT_OPTS="-o vers=$nfsvers" + export MOUNT_OPTIONS="-o vers=$nfsvers" + fs="nfs" + ;; + nfsv4*) + nfsvers=${fs#nfsv} + def_mount="-o vers=$nfsvers" + export TEST_FS_MOUNT_OPTS="-o vers=$nfsvers" + export MOUNT_OPTIONS="-o vers=$nfsvers" + fs="nfs" + esac +} +setup() +{ + add_user "fsgqa" + add_user "123456-fsgqa" + add_user "fsgqa2" + + nr_disk=2 + [ -z "$fs2" ] && [ -z "$mkfsopt" ] && nr_disk=4 + + # set disk + [ -z "$fs2" ] && fs2="disk" + if [ "$fs2" == overlay ]; then + overlay=$fs2 + fs2="disk" + export mkfsopt="" + elif [ "$mkfsopt" == bigalloc ]; then + export mkfsopt="-O bigalloc -C 16k" + fi + if [[ "$fs" == ext* ]]; then + export mkfsopt="$mkfsopt -q -F" + fi + echo "mkfsopt is $mkfsopt" + setup_disk_fs "$fs2" "$nr_disk" "mounted" + disk_list=($(eval get_dev_partition)) + mounted_list=($(eval get_mount_points)) + + disk_type_options + if [[ "$fs" == nfs ]]; then + umount_nfs + else + umount_fs + fi + + export TEST_DEV="${disk_list[0]}" + export SCRATCH_DEV="${disk_list[1]}" + export TEST_DIR=${mounted_list[0]} + export SCRATCH_MNT=${mounted_list[1]} + export FSTYP=$fs +} + +run() +{ + [ -z "$test" ] && test="auto" + + # set test options and expunged list + local opts="" + + [ "$overlay" = overlay ] && opts="-overlay" + + local kver=$(uname -r | cut -d. -f1-2) + [ -d "blacklists" ] || mkdir blacklists + [ -f "blacklists/exclude" ] && rm -f blacklists/exclude + [ -f $TONE_BM_SUITE_DIR/blacklists/${fs}-exclude ] && \ + cat $TONE_BM_SUITE_DIR/blacklists/${fs}-exclude > blacklists/exclude + [ -f $TONE_BM_SUITE_DIR/blacklists/${fs}-exclude-${kver} ] && \ + cat $TONE_BM_SUITE_DIR/blacklists/${fs}-exclude-${kver} >> blacklists/exclude + [ -f "blacklists/exclude" ] && \ + opts="$opts -E blacklists/exclude" + echo "options is $opts" + ./check $opts -g $test +} + +parse() +{ + $TONE_BM_SUITE_DIR/parse.awk +} +