From: Rodrigo Campos Date: Tue, 14 Mar 2023 11:45:10 +0000 (+0100) Subject: vfs: Export test_setup() and test_cleanup() X-Git-Tag: v2023.03.19~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4dd193b59b25b41a6b09641632e13a72e9d636c0;p=xfstests-dev.git vfs: Export test_setup() and test_cleanup() Future patches will call existing test inside another test, so we need to properly setup the test environment. Signed-off-by: Rodrigo Campos Reviewed-by: Christian Brauner Signed-off-by: Zorro Lang --- diff --git a/src/vfs/vfstest.c b/src/vfs/vfstest.c index a840e007..325f04a1 100644 --- a/src/vfs/vfstest.c +++ b/src/vfs/vfstest.c @@ -80,7 +80,7 @@ static void stash_overflowgid(struct vfstest_info *info) info->t_overflowgid = atoi(buf); } -static void test_setup(struct vfstest_info *info) +void test_setup(struct vfstest_info *info) { if (mkdirat(info->t_mnt_fd, T_DIR1, 0777)) die("failure: mkdirat"); @@ -93,7 +93,7 @@ static void test_setup(struct vfstest_info *info) die("failure: fchmod"); } -static void test_cleanup(struct vfstest_info *info) +void test_cleanup(struct vfstest_info *info) { safe_close(info->t_dir1_fd); if (rm_r(info->t_mnt_fd, T_DIR1)) diff --git a/src/vfs/vfstest.h b/src/vfs/vfstest.h new file mode 100644 index 00000000..6502d9f1 --- /dev/null +++ b/src/vfs/vfstest.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __VFSTEST_H +#define __VFSTEST_H + +void test_setup(struct vfstest_info *info); +void test_cleanup(struct vfstest_info *info); + + +#endif /* __VFSTEST_H */