From patchwork Thu Sep 22 21:09:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1681341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=CZssrq1L; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=1Sq2aP4C; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MYSbv2QmYz1ypv for ; Fri, 23 Sep 2022 07:10:19 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id AF7C33CAD5F for ; Thu, 22 Sep 2022 23:10:16 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id AE74A3CAD82 for ; Thu, 22 Sep 2022 23:09:42 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id DE4AC601E8D for ; Thu, 22 Sep 2022 23:09:41 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 21DA92199C; Thu, 22 Sep 2022 21:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jXS0ZoEnXLzhhTQpUewsa25M9mE4ekWsMAUnjztRNjE=; b=CZssrq1LQyVs4dfVn8z74JRcdhJYjP83Nd54U9oZRugCbnJLm4siTM4It3sll1cQCXIwG4 cVmsaj0UpVBqm0sYQA7KI6de3ndzNc+degDKbF6a73f7yAQz9p0yb44Agh3+7bFSR7N78N XoRkexdjHZlI2kwFn1ZLiq8qx6LVxZU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jXS0ZoEnXLzhhTQpUewsa25M9mE4ekWsMAUnjztRNjE=; b=1Sq2aP4Cxdk8a58Pld/qTUOupkfZdxWHO9+RoPc9hlwIWgR7G90jMDkaI6+NvlUFhM28Y1 XaP/028PLQmSkuAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CC34E1346B; Thu, 22 Sep 2022 21:09:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MFhHMBPPLGMYKQAAMHmgww (envelope-from ); Thu, 22 Sep 2022 21:09:39 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 22 Sep 2022 23:09:29 +0200 Message-Id: <20220922210931.23982-2-pvorel@suse.cz> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922210931.23982-1-pvorel@suse.cz> References: <20220922210931.23982-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 1/3 v2] tst_supported_fs: Unify messaging X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Most of the messages used fprintf() instead of tst_{res,brk}(), thus convert all messages to fprintf(). Add macros to shorten code. Fixes: eb47b4497 ("tst_supported_fs: Support skip list when query single fs") Signed-off-by: Petr Vorel Reviewed-by: Li Wang --- I'm not sure about this myself. Shouldn't we rather use tst_brk() and tst_res() instead? It's show tst_supported_fs as command. testcases/lib/tst_supported_fs.c | 61 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c index 26577c726..947aa4dae 100644 --- a/testcases/lib/tst_supported_fs.c +++ b/testcases/lib/tst_supported_fs.c @@ -15,6 +15,22 @@ #include "tst_test.h" #include "tst_fs.h" +#define err(...) ({ \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + usage(); \ + return 2; }) + +#define fail(...) ({ \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + return 1; }) + +#define info(...) ({ \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + return 0; }) + static void usage(void) { fprintf(stderr, "Usage:\n"); @@ -90,67 +106,50 @@ int main(int argc, char *argv[]) break; case 'd': - if (fsname) { - fprintf(stderr, - "Can't specify multiple paths\n"); - usage(); - return 2; - } + if (fsname) + err("Can't specify multiple paths"); fsname = tst_fs_type_name(tst_fs_type(optarg)); break; } } - if (fsname && !skiplist) { - fprintf(stderr, "Parameter -d requires skiplist\n"); - usage(); - return 2; - } + if (fsname && !skiplist) + err("Parameter -d requires skiplist"); - if (argc - optind > 1) { - fprintf(stderr, "Can't specify multiple fs_type\n"); - usage(); - return 2; - } + if (argc - optind > 1) + err("Can't specify multiple fs_type"); /* fs_type */ if (optind < argc) { - if (fsname) { - fprintf(stderr, "Can't specify fs_type and -d together\n"); - usage(); - return 2; - } + if (fsname) + err("Can't specify fs_type and -d together"); fsname = argv[optind]; } if (fsname) { if (fsname[0] == '\0') - tst_brk(TCONF, "fs_type is empty"); + err("fs_type is empty"); if (skiplist) { if (tst_fs_in_skiplist(fsname, (const char * const*)skiplist)) - tst_brk(TCONF, "%s is skipped", fsname); - else - tst_res(TINFO, "%s is not skipped", fsname); + fail("%s is skipped", fsname); - return 0; + info("%s is not skipped", fsname); } if (tst_fs_is_supported(fsname) == TST_FS_UNSUPPORTED) - tst_brk(TCONF, "%s is not supported", fsname); - else - tst_res(TINFO, "%s is supported", fsname); + fail("%s is not supported", fsname); - return 0; + info("%s is supported", fsname); } /* all filesystems */ filesystems = tst_get_supported_fs_types((const char * const*)skiplist); if (!filesystems[0]) - tst_brk(TCONF, "There are no supported filesystems or all skipped"); + fail("There are no supported filesystems or all skipped"); for (i = 0; filesystems[i]; i++) printf("%s\n", filesystems[i]); From patchwork Thu Sep 22 21:09:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1681340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Pz+LNSL1; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=OBquSpD0; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MYSbh189Rz1yqW for ; Fri, 23 Sep 2022 07:10:08 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 40FEF3CAD6A for ; Thu, 22 Sep 2022 23:10:05 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 6D4513C93EF for ; Thu, 22 Sep 2022 23:09:42 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id DCE186005CF for ; Thu, 22 Sep 2022 23:09:41 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 65015219F9; Thu, 22 Sep 2022 21:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4r2tWmYqDC0sC9tn1XAQwQtE4z05Iaqpkc1LILFZhpo=; b=Pz+LNSL16xM7A/Rirf9bPt6BHODrJVT6uyNEQFX4sac7mcAKOa0pvxEFQty/i2LTIhmguW qTdZuEuHp5hhADcsopmhWtvf5uutrJ0XxA4N3/kKResj9mejPo0J4nCewXfCdvZraRY3K3 oTkHUCpbm61cuWulez11mOUva3Oxzjc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4r2tWmYqDC0sC9tn1XAQwQtE4z05Iaqpkc1LILFZhpo=; b=OBquSpD03zwQVWFDT+D0ycw5pryymyf/4jA8piC7dfXje6NsK6fC3FIKw8wNgT8edM8FiC uoyOkOVWFmiuV2Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2061A13AF0; Thu, 22 Sep 2022 21:09:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sD8ZBhTPLGMYKQAAMHmgww (envelope-from ); Thu, 22 Sep 2022 21:09:40 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 22 Sep 2022 23:09:30 +0200 Message-Id: <20220922210931.23982-3-pvorel@suse.cz> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922210931.23982-1-pvorel@suse.cz> References: <20220922210931.23982-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 2/3 v2] tst_supported_fs: Fix return codes X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" exit code 2 is for errors not related to filesystem detection. Fixes: eb47b4497 ("tst_supported_fs: Support skip list when query single fs") Signed-off-by: Petr Vorel --- testcases/lib/tst_supported_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c index 947aa4dae..f644bbd3f 100644 --- a/testcases/lib/tst_supported_fs.c +++ b/testcases/lib/tst_supported_fs.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) switch (ret) { case '?': usage(); - return 1; + return 2; case 'h': usage(); @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) case 's': skiplist = parse_skiplist(optarg); if (!skiplist) - return 1; + return 2; break; case 'd': From patchwork Thu Sep 22 21:09:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1681338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=JwtwLCff; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=L/hGVuvZ; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MYSbG2PQsz1yqH for ; Fri, 23 Sep 2022 07:09:46 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D45CF3CAD67 for ; Thu, 22 Sep 2022 23:09:43 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 20C2A3C93EF for ; Thu, 22 Sep 2022 23:09:41 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 6DDB7200C88 for ; Thu, 22 Sep 2022 23:09:41 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A5D331F86A; Thu, 22 Sep 2022 21:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SJRMDrcz5ZXJjyzoi0tLVgHtc1uZ5VANQAhZInIGe7M=; b=JwtwLCff5ADV2tj9mDccWAhlZxK2qe52sQHp2RBDu98p0zj43XrfMs+pmFuBB81q49yLzj HywqkYL/H+waMszKOwU+fUIWSqtfvlP5ptRgyxlW3jZsb7EKlhc0g/s2MK55B0E7PN6ZJ9 CQuWxSeNvDV4UOfLfDz5VgT6Wj8KqCo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1663880980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SJRMDrcz5ZXJjyzoi0tLVgHtc1uZ5VANQAhZInIGe7M=; b=L/hGVuvZbrZV3t+n6Q55GqMIYxGp1DrYXhvjtE09ZCsS5u1/BF0UpZSPAkxcOE483+dVYY K6ySxF/5q5Hx7FAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6EF241346B; Thu, 22 Sep 2022 21:09:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gIfAGRTPLGMYKQAAMHmgww (envelope-from ); Thu, 22 Sep 2022 21:09:40 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 22 Sep 2022 23:09:31 +0200 Message-Id: <20220922210931.23982-4-pvorel@suse.cz> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922210931.23982-1-pvorel@suse.cz> References: <20220922210931.23982-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 3/3 v2] tst_test.sh: Fix filesystem support detection X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Filesystem detection of locally used filesystem was broken on tests which did not use TST_ALL_FILESYSTEMS as it 1) expected used filesystem is $TST_FS_TYPE 2) this variable was not yet set. Also this check makes sense only if test defines TST_SKIP_FILESYSTEMS (to align with the condition in do_test_setup() in C API). Move filesystem check after (optional) cd "$TST_TMPDIR" (TMPDIR can have different filesystem). Remove tst_skip_filesystems_skip.sh test, as filesystem on tmpfs would have to be detected before. Fixes: 1f6bd6e66 ("tst_test.sh: Add $TST_ALL_FILESYSTEMS") Reported-by: Martin Doucha Signed-off-by: Petr Vorel Reviewed-by: Cyril Hrubis --- .../shell/tst_skip_filesystems_skip.sh | 17 ----------------- testcases/lib/tst_test.sh | 14 ++++++++------ 2 files changed, 8 insertions(+), 23 deletions(-) delete mode 100755 lib/newlib_tests/shell/tst_skip_filesystems_skip.sh diff --git a/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh b/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh deleted file mode 100755 index 6748d021d..000000000 --- a/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2022 Petr Vorel - -TST_MOUNT_DEVICE=1 -TST_NEEDS_ROOT=1 -TST_FS_TYPE=ext4 -TST_TESTFUNC=test -TST_SKIP_FILESYSTEMS="ext4" - -test() -{ - tst_res TFAIL "test should be skipped with TCONF" -} - -. tst_test.sh -tst_run diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 33aadea91..01c01b79b 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -702,12 +702,6 @@ tst_run() [ "$TST_FORMAT_DEVICE" = 1 -o "$TST_ALL_FILESYSTEMS" = 1 ] && TST_NEEDS_DEVICE=1 [ "$TST_NEEDS_DEVICE" = 1 ] && TST_NEEDS_TMPDIR=1 - if [ "$TST_ALL_FILESYSTEMS" != 1 ]; then - if ! tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" $TST_FS_TYPE > /dev/null; then - tst_brk TCONF "$TST_FS_TYPE is skipped by the test" - fi - fi - if [ "$TST_NEEDS_DEVICE" = 1 ]; then TST_DEVICE=$(tst_device acquire) @@ -735,6 +729,14 @@ tst_run() cd "$TST_TMPDIR" fi + if [ "$TST_ALL_FILESYSTEMS" != 1 -a "$TST_SKIP_FILESYSTEMS" ]; then + if ! tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" -d . > /dev/null; then + tst_brk TCONF "filesystem is not supported by the test" + fi + + tst_res TINFO "filesystem is supported by the test" + fi + [ -n "$TST_NEEDS_CHECKPOINTS" ] && _tst_init_checkpoints TST_MNTPOINT="${TST_MNTPOINT:-$PWD/mntpoint}"