From patchwork Tue Mar 14 11:45:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Campos X-Patchwork-Id: 13174144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEBE6C7619A for ; Tue, 14 Mar 2023 11:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbjCNLqT (ORCPT ); Tue, 14 Mar 2023 07:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjCNLqP (ORCPT ); Tue, 14 Mar 2023 07:46:15 -0400 Received: from alerce.blitiri.com.ar (alerce.blitiri.com.ar [IPv6:2001:bc8:228b:9000::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DE21968D for ; Tue, 14 Mar 2023 04:45:39 -0700 (PDT) Received: from localhost.localdomain by sdfg.com.ar (chasquid) with ESMTPSA tls TLS_AES_128_GCM_SHA256 (over submission, TLS-1.3, envelope from "rodrigo@sdfg.com.ar") ; Tue, 14 Mar 2023 11:45:38 +0000 From: Rodrigo Campos To: fstests@vger.kernel.org Cc: Christian Brauner , Giuseppe Scrivano , Rodrigo Campos Subject: [PATCH v4 8/9] vfs: Export test_setup() and test_cleanup() Date: Tue, 14 Mar 2023 12:45:10 +0100 Message-Id: <20230314114511.128207-9-rodrigo@sdfg.com.ar> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314114511.128207-1-rodrigo@sdfg.com.ar> References: <20230314114511.128207-1-rodrigo@sdfg.com.ar> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org 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 --- src/vfs/vfstest.c | 4 ++-- src/vfs/vfstest.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/vfs/vfstest.h diff --git src/vfs/vfstest.c src/vfs/vfstest.c index a840e007..325f04a1 100644 --- src/vfs/vfstest.c +++ 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 src/vfs/vfstest.h src/vfs/vfstest.h new file mode 100644 index 00000000..6502d9f1 --- /dev/null +++ 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 */