]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
vfs: Export test_setup() and test_cleanup()
authorRodrigo Campos <rodrigo@sdfg.com.ar>
Tue, 14 Mar 2023 11:45:10 +0000 (12:45 +0100)
committerZorro Lang <zlang@kernel.org>
Tue, 14 Mar 2023 14:52:48 +0000 (22:52 +0800)
Future patches will call existing test inside another test, so we need
to properly setup the test environment.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/vfs/vfstest.c
src/vfs/vfstest.h [new file with mode: 0644]

index a840e0077440a7a4998350698922d7e5cfd370f2..325f04a1355dff072051f99328e0fe60c9483f84 100644 (file)
@@ -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 (file)
index 0000000..6502d9f
--- /dev/null
@@ -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 */