From patchwork Thu Aug 4 12:19:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=ebF5Se3Z; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=s9xTln2D; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz7C56KvDz9sFs for ; Thu, 4 Aug 2022 22:22:09 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 906EC3C9478 for ; Thu, 4 Aug 2022 14:22:07 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) (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 562BA3C885D for ; Thu, 4 Aug 2022 14:21:55 +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-3.smtp.seeweb.it (Postfix) with ESMTPS id D76EC1A004CE for ; Thu, 4 Aug 2022 14:21:54 +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 9B1E93382E; Thu, 4 Aug 2022 12:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615592; 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=scalFVTq2fwDslykJaFcD/G+VmTtspIyugJDgdsDw/U=; b=ebF5Se3ZjJfZIUieg4mvPMyafzKHZg44bgdPmdrVJzV1XM6gVFplKxbSWDq9dEB+w15AbK q8x3WVhPPOxtLnYGAlIxskVC1K91wEY1LyoGZvqPmlrq9RwrRO7BtEZGSl1UM7NK7Jq8/P LevQ+NOaXPv4+aRQY7amUD3toYYU7po= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615592; 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=scalFVTq2fwDslykJaFcD/G+VmTtspIyugJDgdsDw/U=; b=s9xTln2Doml9dapojLdLvH5NJNdDlu9HtRiscF6syJrlft6eakCs6G6TvDD6v/i38H5PVr LPlgvg0pXH+9MOAw== 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 E45D313A94; Thu, 4 Aug 2022 12:19:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IK8UNWe562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:51 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:37 +0200 Message-Id: <20220804121946.19564-2-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.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-3.smtp.seeweb.it Subject: [LTP] [PATCH v3 01/10] tst_test.sh: Fix tst_mkfs() for tmpfs 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" + add test for it. This has been broken since ever, but get more problematic when $TST_FORMAT_DEVICE got introduced. Fixes: 7783ac3a0 ("lib/tst_test.sh: Add new shell library") Fixes: 95734791c ("tst_test.sh: Add $TST_FORMAT_DEVICE and related vars") Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh | 15 +++++++++++++++ testcases/lib/tst_test.sh | 5 +++++ 2 files changed, 20 insertions(+) create mode 100755 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh diff --git a/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh new file mode 100755 index 000000000..36a78bc85 --- /dev/null +++ b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Petr Vorel + +TST_MOUNT_DEVICE=1 +TST_FS_TYPE=tmpfs +TST_TESTFUNC=test + +test() +{ + EXPECT_PASS "cd $TST_MNTPOINT" +} + +. tst_test.sh +tst_run diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index a35fa2e7b..b7cf5f3d4 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -351,6 +351,11 @@ tst_mkfs() opts="$@" + if [ "$fs_type" = tmpfs ]; then + tst_res TINFO "Skipping mkfs for TMPFS filesystem" + return + fi + if [ -z "$opts" ]; then if [ "$TST_NEEDS_DEVICE" != 1 ]; then tst_brk "Using default parameters in tst_mkfs requires TST_NEEDS_DEVICE=1" From patchwork Thu Aug 4 12:19:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=iUr022VM; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=efdeYgRs; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz78c2Zj5z9sFs for ; Thu, 4 Aug 2022 22:19:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id BEDA03C93EF for ; Thu, 4 Aug 2022 14:19:55 +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 [217.194.8.7]) (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 picard.linux.it (Postfix) with ESMTPS id F05803C25DD for ; Thu, 4 Aug 2022 14:19:53 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 65436200078 for ; Thu, 4 Aug 2022 14:19:53 +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 04B4220FBB; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615593; 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=HknmkfiNljmA+5LF8RYrEd9ydnx73OpuzTH6yuR46Mo=; b=iUr022VMEt2JH+CH6+VABnBcC9VtUJ/SErz+thU+umZOCMOJPmCCLIVIXvXAUp/6wf/hI2 AZzzJpj5ruGZdFB+PsqR69Q4unHndExeofootJ4y4s5f5U2sgFveRgMGyzfSliw4/owduC ZDKFT+KL/URcxQ9KC+nuZy0ec+3ULaQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615593; 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=HknmkfiNljmA+5LF8RYrEd9ydnx73OpuzTH6yuR46Mo=; b=efdeYgRsGxG2nsDx7IDalWgpuIDgffOUPbYA/nqyvV/ojx0CvUgOnMn0JJpQPbXbCZLEmk nmlwpvxg9rE88VBQ== 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 A953213A94; Thu, 4 Aug 2022 12:19:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +ERfJ2i562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:52 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:38 +0200 Message-Id: <20220804121946.19564-3-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-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_PASS 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 v3 02/10] tst_device: Add clear command 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" clearing block device will be needed for TST_ALL_FILESYSTEMS implementation in shell API. Now we clear device during acquire, but we will reuse this device for each tested filesystem, thus we need a separate command for it. Reviewed-by: Cyril Hrubis Reviewed-by: Li Wang Signed-off-by: Petr Vorel --- testcases/lib/tst_device.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/testcases/lib/tst_device.c b/testcases/lib/tst_device.c index d6b74a5ff..45f77a38b 100644 --- a/testcases/lib/tst_device.c +++ b/testcases/lib/tst_device.c @@ -18,8 +18,10 @@ static struct tst_test test = { static void print_help(void) { - fprintf(stderr, "\nUsage: tst_device acquire [size [filename]]\n"); - fprintf(stderr, " or: tst_device release /path/to/device\n\n"); + fprintf(stderr, "\nUsage:\n"); + fprintf(stderr, "tst_device acquire [size [filename]]\n"); + fprintf(stderr, "tst_device release /path/to/device\n"); + fprintf(stderr, "tst_device clear /path/to/device\n\n"); } static int acquire_device(int argc, char *argv[]) @@ -72,6 +74,17 @@ static int release_device(int argc, char *argv[]) return tst_detach_device(argv[2]); } +static int clear_device(int argc, char *argv[]) +{ + if (argc != 3) + return 1; + + if (tst_clear_device(argv[2])) + return 1; + + return 0; +} + int main(int argc, char *argv[]) { /* @@ -94,6 +107,9 @@ int main(int argc, char *argv[]) } else if (!strcmp(argv[1], "release")) { if (release_device(argc, argv)) goto help; + } else if (!strcmp(argv[1], "clear")) { + if (clear_device(argc, argv)) + goto help; } else { fprintf(stderr, "ERROR: Invalid COMMAND '%s'\n", argv[1]); goto help; From patchwork Thu Aug 4 12:19:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=I1eQa3BK; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=RXq14mqd; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz78p1qNGz9sFs for ; Thu, 4 Aug 2022 22:20:09 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id AE8753C949E for ; Thu, 4 Aug 2022 14:20:06 +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) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 2FB2C3C25DD for ; Thu, 4 Aug 2022 14:19:54 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id BF0DB600155 for ; Thu, 4 Aug 2022 14:19:53 +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 5B1B220FBC; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615593; 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=lCKsDyBWwpM2xjyH9HFase7aQvx5126tp6gx/31tzBs=; b=I1eQa3BKWiDK4AOqmrfwxgmfUbzV33pLxme20kdko52AwNZihF6/d0dd+a4GQMg7dGEh2E dM14jqTG+CMRjYj7l4a7jmVlH7bQ2jOa7YMKrIlQojchstzkpU8UmbQUEECMo/Kgzy+Y6I NifIUr/3efuB6yIfyIlGDjMyycLzFfc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615593; 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=lCKsDyBWwpM2xjyH9HFase7aQvx5126tp6gx/31tzBs=; b=RXq14mqdkgn2qnU+YjbuCuZmn1GRKM71xGU653ERGSdpAp/5C6Mm6EwoHtrSP0rbM8MdXF rsjBbeBYj+VZFbBA== 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 119B113A94; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MBQZAmm562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:53 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:39 +0200 Message-Id: <20220804121946.19564-4-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-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 v3 03/10] tst_test.sh: Allow $ ; after whitelisted variable 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Variable followed by other variable was not whitelisted: e.g.: $TST_FS_TYPE$pattern TWARN: Reserved variable TST_FS_TYPE$ used! for i in $SKIP_FILESYSTEMS; do TWARN: Reserved variable TST_SKIP_FILESYSTEMS used! Also use the same patter for second grep for detection of _tst_* functions variables. Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 testcases/lib/tst_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index b7cf5f3d4..3494f7786 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -625,9 +625,10 @@ tst_run() local _tst_data local _tst_max local _tst_name + local _tst_pattern='[='\''"} \t\/:`$\;].*' if [ -n "$TST_TEST_PATH" ]; then - for _tst_i in $(grep '^[^#]*\bTST_' "$TST_TEST_PATH" | sed 's/.*TST_//; s/[='\''"} \t\/:`].*//'); do + for _tst_i in $(grep '^[^#]*\bTST_' "$TST_TEST_PATH" | sed "s/.*TST_//; s/$_tst_pattern//"); do case "$_tst_i" in DISABLE_APPARMOR|DISABLE_SELINUX);; SETUP|CLEANUP|TESTFUNC|ID|CNT|MIN_KVER);; @@ -647,7 +648,7 @@ tst_run() esac done - for _tst_i in $(grep '^[^#]*\b_tst_' "$TST_TEST_PATH" | sed 's/.*_tst_//; s/[="} \t\/:`].*//'); do + for _tst_i in $(grep '^[^#]*\b_tst_' "$TST_TEST_PATH" | sed "s/.*_tst_//; s/$_tst_pattern//"); do tst_res TWARN "Private variable or function _tst_$_tst_i used!" done fi From patchwork Thu Aug 4 12:19:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=X7DCnRh7; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=abHOok4g; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz7Bv39Pjz9sFs for ; Thu, 4 Aug 2022 22:21:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6BE193C9354 for ; Thu, 4 Aug 2022 14:21:57 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) (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 383C23C25DD for ; Thu, 4 Aug 2022 14:21:55 +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-6.smtp.seeweb.it (Postfix) with ESMTPS id C99071400DD5 for ; Thu, 4 Aug 2022 14:21:54 +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 9C25533E95; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615593; 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=EmoH9A5gjUh3cpgD6z0bSN1OOUl4VUUfe2x2OA+hZoM=; b=X7DCnRh7FeCxX2J1lwfhfd6DkY9gdwg8i82GzGprX/kbib4LrolZTIqg2EHUJItwBriSD+ M8Y56lWItAJs/f7RN2V3EZVBiRXqw1S7TGmgmzrRFTVRPQUS6CmGfG+f4ISL8U2+FXl/CJ m9arRh96XCNZ1dvaiE11WnKZzfwYh0w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615593; 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=EmoH9A5gjUh3cpgD6z0bSN1OOUl4VUUfe2x2OA+hZoM=; b=abHOok4gOBGSvhOFzdaUaVF3TechvtiGWnCAXrDT/ssMlvh55feRQ2zK1/7W5uHyiSaV57 mKF747q5rdXH0eAA== 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 5A69413AE1; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AC4nFGm562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:53 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:40 +0200 Message-Id: <20220804121946.19564-5-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-6.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-6.smtp.seeweb.it Subject: [LTP] [PATCH v3 04/10] tst_mount_device.sh: Cover early tst_umount call 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Caused by tst_brk in tests with TST_MOUNT_DEVICE=1. Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 lib/newlib_tests/shell/tst_mount_device.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/newlib_tests/shell/tst_mount_device.sh b/lib/newlib_tests/shell/tst_mount_device.sh index c8f185626..561f878d2 100755 --- a/lib/newlib_tests/shell/tst_mount_device.sh +++ b/lib/newlib_tests/shell/tst_mount_device.sh @@ -5,7 +5,7 @@ TST_MOUNT_DEVICE=1 TST_FS_TYPE=ext4 TST_TESTFUNC=test -TST_CNT=2 +TST_CNT=3 test1() { @@ -17,5 +17,10 @@ test2() EXPECT_PASS "grep '$TST_MNTPOINT $TST_FS_TYPE' /proc/mounts" } +test3() +{ + tst_brk TCONF "quit early to test early tst_umount" +} + . tst_test.sh tst_run From patchwork Thu Aug 4 12:19:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663665 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=fA5K7Hgq; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VhxsTDd4; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz79C20b8z9sFs for ; Thu, 4 Aug 2022 22:20:31 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 822663C9427 for ; Thu, 4 Aug 2022 14:20:28 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) (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 C0C553C25DD for ; Thu, 4 Aug 2022 14:19:54 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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-6.smtp.seeweb.it (Postfix) with ESMTPS id 46B95140075D for ; Thu, 4 Aug 2022 14:19:54 +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 ECA5220FBF; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615593; 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=zmSCTFGsp+RLL0Eo1ZxitP5FtK3BFPrrS7SzZK6nwW8=; b=fA5K7Hgqss5Ilhx5P+2LbHWKeQkiolhuUjgb8W0ok1t4tgvdtAAu7kEGRJWpgLPRodv35U S69xarDE6OfrHt4MgSEzrhyrHZr9bd/foSUGx8rx9J6Nm1C9hShpN2a4dSh1LSUGTtGxT+ KzA9/ikBdaH7xeJ6yWlxN0iav/CdXm0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615593; 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=zmSCTFGsp+RLL0Eo1ZxitP5FtK3BFPrrS7SzZK6nwW8=; b=VhxsTDd4UqvbLoPwRBC8db9q/WdyfWrR+PSS+w2RB58Y9xSpXmkexdrUDx1CHQAIErX0kt TBngUe4kr3SJrfCQ== 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 A6E0113A94; Thu, 4 Aug 2022 12:19:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2A5bJ2m562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:53 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:41 +0200 Message-Id: <20220804121946.19564-6-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-6.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_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH v3 05/10] tst_supported_fs: Implement skip list 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" as it will be needed for $ALL_FILESYSTEMS shell implementation in the next commit. Pass tmpfs to LVM scripts (as it was required there), but allow to use zram01.sh with tmpfs as it works with it. Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 testcases/lib/tst_supported_fs.c | 56 +++++++++++++++++----- testcases/misc/lvm/generate_lvm_runfile.sh | 2 +- testcases/misc/lvm/prepare_lvm.sh | 2 +- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c index 43eac194f..87be2b759 100644 --- a/testcases/lib/tst_supported_fs.c +++ b/testcases/lib/tst_supported_fs.c @@ -5,42 +5,74 @@ */ #include +#include #include +#define SKIP_DELIMITER ',' + #define TST_NO_DEFAULT_MAIN #include "tst_test.h" #include "tst_fs.h" static void usage(void) { - fprintf(stderr, "Usage: tst_supported_fs [fs_type]\n"); + fprintf(stderr, "Usage: tst_supported_fs [-s skip_list] [fs_type]\n"); fprintf(stderr, " If fs_type is supported, return 0\n"); fprintf(stderr, " If fs_type isn't supported, return 1\n"); fprintf(stderr, " If fs_type isn't specified, print the list of supported filesystems\n"); fprintf(stderr, " fs_type - a specified filesystem type\n"); + fprintf(stderr, " skip_list - filesystems to skip, delimiter: '%c'\n", + SKIP_DELIMITER); } int main(int argc, char *argv[]) { - const char *skiplist[] = {"tmpfs", NULL}; const char *const *filesystems; - int i; + int i, ret, cnt = 1; + char **skiplist = NULL; + char *fs; - if (argc > 2) { - fprintf(stderr, "Can't specify multiple fs_type\n"); - usage(); - return 2; + while ((ret = getopt(argc, argv, "hs:"))) { + if (ret < 0) + break; + + switch (ret) { + case '?': + return 1; + + case 'h': + usage(); + return 0; + + case 's': + fs = optarg; + for (i = 0; fs[i]; i++) { + if (optarg[i] == SKIP_DELIMITER) + cnt++; + } + skiplist = malloc(++cnt * sizeof(char *)); + if (!skiplist) { + fprintf(stderr, "malloc() failed\n"); + return 1; + } + + fs = optarg; + for (i = 0; i < cnt; i++) + skiplist[i] = strtok_r(fs, TST_TO_STR(SKIP_DELIMITER), &fs); + break; + } } - if (argv[1] && !strcmp(argv[1], "-h")) { + if (argc - optind > 1) { + fprintf(stderr, "Can't specify multiple fs_type\n"); usage(); - return 0; + return 2; } - if (argv[1]) - return !tst_fs_is_supported(argv[1]); + if (optind < argc) + return !tst_fs_is_supported(argv[optind]); - filesystems = tst_get_supported_fs_types(skiplist); + filesystems = tst_get_supported_fs_types((const char * const*)skiplist); for (i = 0; filesystems[i]; i++) printf("%s\n", filesystems[i]); diff --git a/testcases/misc/lvm/generate_lvm_runfile.sh b/testcases/misc/lvm/generate_lvm_runfile.sh index 72b286a69..843dd6bb8 100755 --- a/testcases/misc/lvm/generate_lvm_runfile.sh +++ b/testcases/misc/lvm/generate_lvm_runfile.sh @@ -16,7 +16,7 @@ generate_runfile() trap 'tst_brk TBROK "Cannot create LVM runfile"' ERR INFILE="$LTPROOT/testcases/data/lvm/runfile.tpl" OUTFILE="$LTPROOT/runtest/lvm.local" - FS_LIST=`tst_supported_fs` + FS_LIST=$(tst_supported_fs -s tmpfs) echo -n "" >"$OUTFILE" for fsname in $FS_LIST; do diff --git a/testcases/misc/lvm/prepare_lvm.sh b/testcases/misc/lvm/prepare_lvm.sh index d3ae4b23f..29f386df8 100755 --- a/testcases/misc/lvm/prepare_lvm.sh +++ b/testcases/misc/lvm/prepare_lvm.sh @@ -70,7 +70,7 @@ prepare_mounts() prepare_lvm() { - FS_LIST=`tst_supported_fs | sort -u` + FS_LIST=$(tst_supported_fs -s tmpfs | sort -u) ROD mkdir -p "$LVM_TMPDIR" ROD mkdir -p "$LVM_IMGDIR" chmod 777 "$LVM_TMPDIR" From patchwork Thu Aug 4 12:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=ieFcMMWf; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=WYNKf+Im; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz7CV2h1cz9sFs for ; Thu, 4 Aug 2022 22:22:30 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4D5683C933F for ; Thu, 4 Aug 2022 14:22:28 +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 [IPv6:2001:4b78:1:20::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 933FE3C885D for ; Thu, 4 Aug 2022 14:21:55 +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 DA73D600634 for ; Thu, 4 Aug 2022 14:21:54 +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 E76BA33F39; Thu, 4 Aug 2022 12:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615594; 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=6wTkL4sVOgFonza2ilqiafwUZP2ShFRVfW6fSFyrWIA=; b=ieFcMMWfeqCLJ5k6wz3WF1DB72WLVmo4KFWGdjsA8vnbU1aU+NdiefWD2OIw5kIHUWaaw1 I2dTjAfkwJKPKkMq2UOn7RlgWIOdGSkUeLfC67GBN1IUVlJKmgaIt9sWSXMZgIN8BC+gvY hOUcGn9Xvbv43aT5b3a8wJHqX7IPD40= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615594; 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=6wTkL4sVOgFonza2ilqiafwUZP2ShFRVfW6fSFyrWIA=; b=WYNKf+Imx0d7VIH5X3sfhsJsBEk+Lj0IZs95Tq4qltu00gTHxWH/ZTPXRlAO3gZxqAnYdy fZBsYkAH3R8f1VCg== 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 11C9A13A94; Thu, 4 Aug 2022 12:19:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SOJ/AGq562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:54 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:42 +0200 Message-Id: <20220804121946.19564-7-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-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 v3 06/10] tst_supported_fs: Support skip list when query single fs 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 include/tst_fs.h | 10 ++++++++++ lib/tst_supported_fs_types.c | 18 ++++++++++++++++++ testcases/lib/tst_supported_fs.c | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/tst_fs.h b/include/tst_fs.h index 8159b99eb..2fe97f174 100644 --- a/include/tst_fs.h +++ b/include/tst_fs.h @@ -182,6 +182,16 @@ enum tst_fs_impl { */ enum tst_fs_impl tst_fs_is_supported(const char *fs_type); +/* + * Check filesystem support (@see tst_fs_is_supported()), but consider also + * filesystems to skip. + * + * @fs_type A filesystem name to check the support for. + * @skiplist A NULL terminated array of filesystems to skip. + */ +enum tst_fs_impl tst_fs_is_supported_skiplist(const char *fs_type, const char + *const *skiplist); + /* * Returns NULL-terminated array of kernel-supported filesystems. * diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c index 9726d193a..8c9379c1b 100644 --- a/lib/tst_supported_fs_types.c +++ b/lib/tst_supported_fs_types.c @@ -134,6 +134,24 @@ enum tst_fs_impl tst_fs_is_supported(const char *fs_type) return TST_FS_UNSUPPORTED; } +enum tst_fs_impl tst_fs_is_supported_skiplist(const char *fs_type, const char + *const *skiplist) +{ + int ret; + + ret = tst_fs_is_supported(fs_type); + + if (!ret) + return ret; + + if (tst_fs_in_skiplist(fs_type, skiplist)) { + tst_brk(TCONF, "%s is not supported by the test", + fs_type); + } + + return ret; +} + const char **tst_get_supported_fs_types(const char *const *skiplist) { unsigned int i, j = 0; diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c index 87be2b759..75945c809 100644 --- a/testcases/lib/tst_supported_fs.c +++ b/testcases/lib/tst_supported_fs.c @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) } if (optind < argc) - return !tst_fs_is_supported(argv[optind]); + return !tst_fs_is_supported_skiplist(argv[optind], (const char * const*)skiplist); filesystems = tst_get_supported_fs_types((const char * const*)skiplist); for (i = 0; filesystems[i]; i++) From patchwork Thu Aug 4 12:19:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=dPRyDXxk; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=yfJmPoGc; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz79T5PBXz9sFs for ; Thu, 4 Aug 2022 22:20:45 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8AE293C9408 for ; Thu, 4 Aug 2022 14:20:42 +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 [IPv6:2001:4b78:1:20::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 6177B3C9423 for ; Thu, 4 Aug 2022 14:19:56 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 DDCB6600634 for ; Thu, 4 Aug 2022 14:19:55 +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 84FFE20FBC; Thu, 4 Aug 2022 12:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615595; 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=ApEyE+xesiVk9QbzJaMXMiOp0Dtrs6FcSSRMqodDgag=; b=dPRyDXxkAx0hv6IVoqZH2nBCN0IB+s8O8vBM14wm57FbdZrKiZWcl+wCAaZyOAZuzYdPNd 22+vjR8OSNYb92XSGu5uWaSrRDcsYq40MH6pnI40qPXyTw8WvsXA3c/jzzwm5oY9/EBkYn NiYvXPw+KXoCn7Rpv1pprbCl3EVIehU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615595; 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=ApEyE+xesiVk9QbzJaMXMiOp0Dtrs6FcSSRMqodDgag=; b=yfJmPoGcvQzhaOUD3k6TzA1WpiYVFIZhO8sZw0r08MKYh/frFE06A69/OxaM4dZozS5Ckd Ykp9fgj5ZwSKqrAg== 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 01EAA13A94; Thu, 4 Aug 2022 12:19:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2HwwOWq562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:54 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:43 +0200 Message-Id: <20220804121946.19564-8-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-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_PASS 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 v3 07/10] shell: Add $TST_SKIP_FILESYSTEMS + tests 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" C API struct tst_test skip_filesystems member equivalent. Now only running on single filesystem (will be improved in the next commit) Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- New in v3 doc/shell-test-api.txt | 1 + .../shell/tst_skip_filesystems.sh | 34 +++++++++++++++++++ .../shell/tst_skip_filesystems_skip.sh | 16 +++++++++ testcases/lib/tst_test.sh | 6 ++++ 4 files changed, 57 insertions(+) create mode 100755 lib/newlib_tests/shell/tst_skip_filesystems.sh create mode 100755 lib/newlib_tests/shell/tst_skip_filesystems_skip.sh diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt index 65444541e..0961dc5ef 100644 --- a/doc/shell-test-api.txt +++ b/doc/shell-test-api.txt @@ -229,6 +229,7 @@ simply by setting right '$TST_FOO'. | 'TST_NEEDS_KCONFIGS' | Checks kernel kconfigs support for the test (see below). | 'TST_NEEDS_KCONFIGS_IFS' | Used for splitting '$TST_NEEDS_KCONFIGS' variable, default value is comma, it only supports single character. +| 'TST_SKIP_FILESYSTEMS' | Comma separated list of filesystems on which test will be skipped. | 'TST_TIMEOUT' | Maximum timeout set for the test in sec. Must be int >= 1, or -1 (special value to disable timeout), default is 300. Variable is meant be set in tests, not by user. diff --git a/lib/newlib_tests/shell/tst_skip_filesystems.sh b/lib/newlib_tests/shell/tst_skip_filesystems.sh new file mode 100755 index 000000000..dd57d6b42 --- /dev/null +++ b/lib/newlib_tests/shell/tst_skip_filesystems.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Petr Vorel + +TST_MOUNT_DEVICE=1 +TST_FS_TYPE=ext4 +TST_TESTFUNC=test +TST_SKIP_FILESYSTEMS="btrfs,ext2,ext3,xfs,vfat,exfat,ntfs,tmpfs" +TST_CNT=3 + +test1() +{ + EXPECT_PASS "cd $TST_MNTPOINT" +} + +test2() +{ + EXPECT_PASS "grep '$TST_MNTPOINT $TST_FS_TYPE' /proc/mounts" +} + +test3() +{ + local fs fs_skip + + fs=$(grep "$TST_MNTPOINT $TST_FS_TYPE" /proc/mounts | cut -d ' ' -f3) + EXPECT_PASS "[ '$fs' = '$TST_FS_TYPE' ]" + + for fs_skip in $TST_SKIP_FILESYSTEMS; do + EXPECT_FAIL "[ $fs = $fs_skip ]" + done +} + +. tst_test.sh +tst_run diff --git a/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh b/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh new file mode 100755 index 000000000..0d291a0a0 --- /dev/null +++ b/lib/newlib_tests/shell/tst_skip_filesystems_skip.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Petr Vorel + +TST_MOUNT_DEVICE=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 3494f7786..926053357 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -626,6 +626,7 @@ tst_run() local _tst_max local _tst_name local _tst_pattern='[='\''"} \t\/:`$\;].*' + local ret if [ -n "$TST_TEST_PATH" ]; then for _tst_i in $(grep '^[^#]*\bTST_' "$TST_TEST_PATH" | sed "s/.*TST_//; s/$_tst_pattern//"); do @@ -644,6 +645,7 @@ tst_run() CHECKPOINT_WAIT|CHECKPOINT_WAKE);; CHECKPOINT_WAKE2|CHECKPOINT_WAKE_AND_WAIT);; DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE|MOUNT_DEVICE);; + SKIP_FILESYSTEMS);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; esac done @@ -675,6 +677,10 @@ tst_run() tst_brk TCONF "test requires kernel $TST_MIN_KVER+" fi + tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" $TST_FS_TYPE + ret=$? + [ $ret -ne 0 ] && return $ret + _tst_setup_timer [ "$TST_MOUNT_DEVICE" = 1 ] && TST_FORMAT_DEVICE=1 From patchwork Thu Aug 4 12:19:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=tAl5ff/k; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=egYNoBQc; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz7CJ6FY7z9sFs for ; Thu, 4 Aug 2022 22:22:20 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 42F113C9408 for ; Thu, 4 Aug 2022 14:22:18 +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 [217.194.8.5]) (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 picard.linux.it (Postfix) with ESMTPS id 81CD43C25DD for ; Thu, 4 Aug 2022 14:21:55 +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 D2B8D60073B for ; Thu, 4 Aug 2022 14:21:54 +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 ED88A348C5; Thu, 4 Aug 2022 12:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615595; 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=YtJpW8i08s/5sT92dF9aVPvOseb6YfJTwQhj7I/x/Yg=; b=tAl5ff/kPdg+10z6Wd9RwzL4D+bcLcyn715f0DRZl01wHKOkKcWVWCoxfePqmwybSytmyJ HK8vvNaTuLMjw36yWh0FHzehQDxnEQsLWkp8uunpHw9AtzzB/YiVFDZYYEEBUwBX06obGt V40B2i51BnV4QpmGelq3HgiUPKnEUqI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615595; 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=YtJpW8i08s/5sT92dF9aVPvOseb6YfJTwQhj7I/x/Yg=; b=egYNoBQc1MZb7ile8a+3H32/LEIba4gDFhi7pz7r9umjfZGnfi5BtiOd7Q7LwhLBkILerX OD4W8+/O7Z5gkvBA== 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 9049C13A94; Thu, 4 Aug 2022 12:19:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iGC5IWu562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:55 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:44 +0200 Message-Id: <20220804121946.19564-9-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-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 v3 08/10] tst_test.sh: Add $TST_ALL_FILESYSTEMS 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" $TST_ALL_FILESYSTEMS is shell API equivalent of .all_filesystems from C API. Improve also $TST_SKIP_FILESYSTEMS to behave like .skip_filesystems. Reviewed-by: Li Wang Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- Changes v2->v3: * Fixed various functional problems * Added $TST_SKIP_FILESYSTEMS support doc/shell-test-api.txt | 6 +- testcases/lib/tst_test.sh | 118 +++++++++++++++++++++++++------------- 2 files changed, 82 insertions(+), 42 deletions(-) diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt index 0961dc5ef..ecadb8e32 100644 --- a/doc/shell-test-api.txt +++ b/doc/shell-test-api.txt @@ -199,6 +199,9 @@ simply by setting right '$TST_FOO'. [options="header"] |============================================================================= | Variable name | Action done +| 'TST_ALL_FILESYSTEMS' | Testing on all available filesystems (tst_test.all_filesystems equivalent). + When 'TST_SKIP_FILESYSTEMS' any listed filesystem is not + included in the resulting list of supported filesystems. | 'TST_DEV_EXTRA_OPTS' | Pass extra 'mkfs' options _after_ device name, to 'tst_mkfs', use with 'TST_FORMAT_DEVICE=1'. | 'TST_DEV_FS_OPTS' | Pass 'mkfs' options _before_ the device name, @@ -229,7 +232,8 @@ simply by setting right '$TST_FOO'. | 'TST_NEEDS_KCONFIGS' | Checks kernel kconfigs support for the test (see below). | 'TST_NEEDS_KCONFIGS_IFS' | Used for splitting '$TST_NEEDS_KCONFIGS' variable, default value is comma, it only supports single character. -| 'TST_SKIP_FILESYSTEMS' | Comma separated list of filesystems on which test will be skipped. +| 'TST_SKIP_FILESYSTEMS' | Comma separated list of filesystems on which test will be skipped + (tst_test.skip_filesystems equivalent). | 'TST_TIMEOUT' | Maximum timeout set for the test in sec. Must be int >= 1, or -1 (special value to disable timeout), default is 300. Variable is meant be set in tests, not by user. diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 926053357..b679339a0 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -33,17 +33,7 @@ _tst_do_exit() local ret=0 TST_DO_EXIT=1 - if [ -n "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" -a -z "$TST_NO_CLEANUP" ]; then - if command -v $TST_CLEANUP >/dev/null 2>/dev/null; then - $TST_CLEANUP - else - tst_res TWARN "TST_CLEANUP=$TST_CLEANUP declared, but function not defined (or cmd not found)" - fi - fi - - if [ "$TST_MOUNT_FLAG" = 1 ]; then - tst_umount - fi + [ "$TST_MOUNT_FLAG" = 1 ] && tst_umount if [ "$TST_NEEDS_DEVICE" = 1 -a "$TST_DEVICE_FLAG" = 1 ]; then if ! tst_device release "$TST_DEVICE"; then @@ -479,6 +469,7 @@ LTPROOT Prefix for installed LTP (default: /opt/ltp) LTP_COLORIZE_OUTPUT Force colorized output behaviour (y/1 always, n/0: never) LTP_DEV Path to the block device to be used (for .needs_device) LTP_DEV_FS_TYPE Filesystem used for testing (default: ext2) +LTP_SINGLE_FS_TYPE Testing only - specifies filesystem instead all supported (for TST_ALL_FILESYSTEMS=1) LTP_TIMEOUT_MUL Timeout multiplier (must be a number >=1, ceiled to int) TMPDIR Base directory for template directory (for .needs_tmpdir, default: /tmp) EOF @@ -619,10 +610,33 @@ _tst_init_checkpoints() export LTP_IPC_PATH } +_prepare_device() +{ + if [ "$TST_FORMAT_DEVICE" = 1 ]; then + tst_device clear "$TST_DEVICE" + tst_mkfs $TST_FS_TYPE $TST_DEV_FS_OPTS $TST_DEVICE $TST_DEV_EXTRA_OPTS + fi + + if [ "$TST_MOUNT_DEVICE" = 1 ]; then + tst_mount + TST_MOUNT_FLAG=1 + fi +} + +_tst_run_tcases_per_fs() +{ + for _tst_fs in $(tst_supported_fs -s "$TST_SKIP_FILESYSTEMS"); do + tst_res TINFO "=== Testing on $_tst_fs ===" + TST_FS_TYPE="$_tst_fs" + _tst_run_iterations + done +} + tst_run() { local _tst_i local _tst_data + local _tst_fs local _tst_max local _tst_name local _tst_pattern='[='\''"} \t\/:`$\;].*' @@ -631,7 +645,7 @@ tst_run() if [ -n "$TST_TEST_PATH" ]; then for _tst_i in $(grep '^[^#]*\bTST_' "$TST_TEST_PATH" | sed "s/.*TST_//; s/$_tst_pattern//"); do case "$_tst_i" in - DISABLE_APPARMOR|DISABLE_SELINUX);; + ALL_FILESYSTEMS|DISABLE_APPARMOR|DISABLE_SELINUX);; SETUP|CLEANUP|TESTFUNC|ID|CNT|MIN_KVER);; OPTS|USAGE|PARSE_ARGS|POS_ARGS);; NEEDS_ROOT|NEEDS_TMPDIR|TMPDIR|NEEDS_DEVICE|DEVICE);; @@ -677,16 +691,29 @@ tst_run() tst_brk TCONF "test requires kernel $TST_MIN_KVER+" fi - tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" $TST_FS_TYPE - ret=$? - [ $ret -ne 0 ] && return $ret - - _tst_setup_timer + [ -n "$TST_NEEDS_MODULE" ] && tst_require_module "$TST_NEEDS_MODULE" + [ "$TST_ALL_FILESYSTEMS" = 1 ] && TST_MOUNT_DEVICE=1 [ "$TST_MOUNT_DEVICE" = 1 ] && TST_FORMAT_DEVICE=1 [ "$TST_FORMAT_DEVICE" = 1 ] && TST_NEEDS_DEVICE=1 [ "$TST_NEEDS_DEVICE" = 1 ] && TST_NEEDS_TMPDIR=1 + if [ "$TST_ALL_FILESYSTEMS" != 1 ]; then + tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" $TST_FS_TYPE + ret=$? + [ $ret -ne 0 ] && return $ret + fi + + if [ "$TST_NEEDS_DEVICE" = 1 ]; then + TST_DEVICE=$(tst_device acquire) + + if [ ! -b "$TST_DEVICE" -o $? -ne 0 ]; then + unset TST_DEVICE + tst_brk TBROK "Failed to acquire device" + fi + TST_DEVICE_FLAG=1 + fi + if [ "$TST_NEEDS_TMPDIR" = 1 ]; then if [ -z "$TMPDIR" ]; then export TMPDIR="/tmp" @@ -697,35 +724,32 @@ tst_run() chmod 777 "$TST_TMPDIR" TST_STARTWD=$(pwd) - cd "$TST_TMPDIR" fi - TST_MNTPOINT="${TST_MNTPOINT:-$PWD/mntpoint}" - if [ "$TST_NEEDS_DEVICE" = 1 ]; then - - TST_DEVICE=$(tst_device acquire) + [ -n "$TST_NEEDS_CHECKPOINTS" ] && _tst_init_checkpoints - if [ ! -b "$TST_DEVICE" -o $? -ne 0 ]; then - unset TST_DEVICE - tst_brk TBROK "Failed to acquire device" - fi + TST_MNTPOINT="${TST_MNTPOINT:-$PWD/mntpoint}" - TST_DEVICE_FLAG=1 + if [ "$TST_ALL_FILESYSTEMS" = 1 ]; then + _tst_run_tcases_per_fs + else + _tst_run_iterations fi - [ -n "$TST_NEEDS_MODULE" ] && tst_require_module "$TST_NEEDS_MODULE" + _tst_do_exit +} - if [ "$TST_FORMAT_DEVICE" = 1 ]; then - tst_mkfs $TST_FS_TYPE $TST_DEV_FS_OPTS $TST_DEVICE $TST_DEV_EXTRA_OPTS - fi +_tst_run_iterations() +{ + local _tst_i=$TST_ITERATIONS + local _tst_j - if [ "$TST_MOUNT_DEVICE" = 1 ]; then - tst_mount - TST_MOUNT_FLAG=1 - fi + [ "$TST_NEEDS_TMPDIR" = 1 ] && cd "$TST_TMPDIR" - [ -n "$TST_NEEDS_CHECKPOINTS" ] && _tst_init_checkpoints + _prepare_device + + _tst_setup_timer if [ -n "$TST_SETUP" ]; then if command -v $TST_SETUP >/dev/null 2>/dev/null; then @@ -737,20 +761,32 @@ tst_run() fi #TODO check that test reports some results for each test function call - while [ $TST_ITERATIONS -gt 0 ]; do + while [ $_tst_i -gt 0 ]; do if [ -n "$TST_TEST_DATA" ]; then tst_require_cmds cut tr wc _tst_max=$(( $(echo $TST_TEST_DATA | tr -cd "$TST_TEST_DATA_IFS" | wc -c) +1)) - for _tst_i in $(seq $_tst_max); do - _tst_data="$(echo "$TST_TEST_DATA" | cut -d"$TST_TEST_DATA_IFS" -f$_tst_i)" + for _tst_j in $(seq $_tst_max); do + _tst_data="$(echo "$TST_TEST_DATA" | cut -d"$TST_TEST_DATA_IFS" -f$_tst_j)" _tst_run_tests "$_tst_data" done else _tst_run_tests fi - TST_ITERATIONS=$((TST_ITERATIONS-1)) + _tst_i=$((_tst_i-1)) done - _tst_do_exit + + if [ -n "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" -a -z "$TST_NO_CLEANUP" ]; then + if command -v $TST_CLEANUP >/dev/null 2>/dev/null; then + $TST_CLEANUP + else + tst_res TWARN "TST_CLEANUP=$TST_CLEANUP declared, but function not defined (or cmd not found)" + fi + fi + + if [ "$TST_MOUNT_FLAG" = 1 ]; then + tst_umount + TST_MOUNT_FLAG= + fi } _tst_run_tests() From patchwork Thu Aug 4 12:19:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=naBnuGbV; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GpMfSCC5; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz7Cm0hFkz9sFs for ; Thu, 4 Aug 2022 22:22:43 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 5D4713C93E2 for ; Thu, 4 Aug 2022 14:22:41 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (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 1EA983C9427 for ; Thu, 4 Aug 2022 14:21:55 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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-4.smtp.seeweb.it (Postfix) with ESMTPS id CBAB310000EE for ; Thu, 4 Aug 2022 14:21:54 +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 5A440350C3; Thu, 4 Aug 2022 12:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615596; 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=Otj02OSlPlm2Sk5asG7DkaYHqCcce0okZQHBkG2haBc=; b=naBnuGbVrn0TqNZRlg4GzltpFq9UFrnCIwtKQLDaNQddKjLWjs/Z6wB08eG6TltK1qJ1E5 OFIC3v+YEJSe1vrr5EitEtM9ZIovNX55rKmHFu5yiH+Wo7QttJUY+gb/rRDk0LIVAhsAjo Gib5Hx6/t52DIXVuv+WqTnNs7Yeb+R4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615596; 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=Otj02OSlPlm2Sk5asG7DkaYHqCcce0okZQHBkG2haBc=; b=GpMfSCC5G0MtsR+GlR5/o75VJgjHHGRWsFgA5NtmtK4jHjC/BW9mJkl0MwzaJ2Cao/z5Js ioPya0N+BGZPcdDg== 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 0D59113A94; Thu, 4 Aug 2022 12:19:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yPUeAGy562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:56 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:45 +0200 Message-Id: <20220804121946.19564-10-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.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_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v3 09/10] shell: Add test for TST_ALL_FILESYSTEMS=1 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: , Cc: automated-testing@yoctoproject.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Unfortunately GitHub Actions don't have loop devices, thus cannot be run in CI: tst_format_device 1 TINFO: timeout per run is 0h 5m 0s /__w/ltp/ltp/lib/tst_device.c:139: TINFO: No free devices found Reviewed-by: Cyril Hrubis Reviewed-by: Li Wang Signed-off-by: Petr Vorel Acked-by: Richard Palethorpe --- lib/newlib_tests/shell/tst_all_filesystems.sh | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 lib/newlib_tests/shell/tst_all_filesystems.sh diff --git a/lib/newlib_tests/shell/tst_all_filesystems.sh b/lib/newlib_tests/shell/tst_all_filesystems.sh new file mode 100755 index 000000000..8509a7481 --- /dev/null +++ b/lib/newlib_tests/shell/tst_all_filesystems.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Petr Vorel + +TST_ALL_FILESYSTEMS=1 +TST_TESTFUNC=test +TST_CNT=2 + +test1() +{ + tst_res TPASS "device using filesystem" +} + +test2() +{ + local pattern + + + if [ "$TST_FS_TYPE" = "exfat" -o "$TST_FS_TYPE" = "ntfs" ]; then + pattern="|fuseblk" + fi + + EXPECT_PASS "grep -E '$TST_MNTPOINT ($TST_FS_TYPE${pattern})' /proc/mounts" +} + +. tst_test.sh +tst_run From patchwork Thu Aug 4 12:19:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1663667 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=DAX2VrjE; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=HPXpnSvx; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lz79g5fDkz9sFs for ; Thu, 4 Aug 2022 22:20:55 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 17EFD3C93DB for ; Thu, 4 Aug 2022 14:20:53 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) (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 26DC83C9423 for ; Thu, 4 Aug 2022 14:19:58 +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-6.smtp.seeweb.it (Postfix) with ESMTPS id 709681400995 for ; Thu, 4 Aug 2022 14:19:57 +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 EA41620FB0; Thu, 4 Aug 2022 12:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659615596; 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=ganAk8Biqarzg14uiXeLH2Z9aMYAKLnAxtmJQDbKiyc=; b=DAX2VrjElcjJExZRMwZoWYMXR4EfqZNSzL5h6M7RJPhyNGqHeayYVKmLe5fUU6TL2/Nr3u hUqXx7AClrfJoHxA2LBzkDIowTklO2ccZ5LaT5sJTMSouqgpgFcYOp72jvspK12hF616jf 6rbEfroOYg1GQOSb8TMsZfGQ4jBHciA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659615596; 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=ganAk8Biqarzg14uiXeLH2Z9aMYAKLnAxtmJQDbKiyc=; b=HPXpnSvxhmQF9GvLgJRX7+TvHpOLHow2RMX4ggTS8oI9fgFafkrKmdzOLFB86PiADCY1Eb CnN2ByW1SBLlHJDw== 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 6FC2D13A94; Thu, 4 Aug 2022 12:19:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CI/IGGy562L2PQAAMHmgww (envelope-from ); Thu, 04 Aug 2022 12:19:56 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 4 Aug 2022 14:19:46 +0200 Message-Id: <20220804121946.19564-11-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220804121946.19564-1-pvorel@suse.cz> References: <20220804121946.19564-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-6.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-6.smtp.seeweb.it Subject: [LTP] [RFC][PATCH v3 10/10] nfs: Use TST_ALL_FILESYSTEMS=1 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: , Cc: "J . Bruce Fields" , linux-nfs@vger.kernel.org, NeilBrown , Chuck Lever , automated-testing@yoctoproject.org, Trond Myklebust Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Petr Vorel --- Changes v2->v3: * restart_daemon nfs-server + tst_sleep 500ms But still sometimes last test TCONF due server not being ready (restart is not reliable) :( * Skip NTFS and vfat (NTFS is problematic, vfat IMHO does not make sense to test). testcases/network/nfs/nfs_stress/nfs_lib.sh | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index af7d46a21..b9872bb31 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -8,6 +8,7 @@ VERSION=${VERSION:=3} NFILES=${NFILES:=1000} SOCKET_TYPE="${SOCKET_TYPE:-udp}" NFS_TYPE=${NFS_TYPE:=nfs} +TST_SKIP_FILESYSTEMS="ntfs,vfat" nfs_usage() { @@ -28,7 +29,7 @@ NFS_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" TST_OPTS="v:t:$TST_OPTS" TST_PARSE_ARGS=nfs_parse_args TST_USAGE=nfs_usage -TST_NEEDS_TMPDIR=1 +TST_ALL_FILESYSTEMS=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs" TST_SETUP="${TST_SETUP:-nfs_setup}" @@ -63,7 +64,7 @@ nfs_get_remote_path() done v=${1:-$v} - echo "$TST_TMPDIR/$v/$type" + echo "$TST_MNTPOINT/$v/$type" } nfs_server_udp_enabled() @@ -162,8 +163,8 @@ nfs_setup() tst_brk TCONF "UDP support disabled on NFS server" fi - local_dir="$TST_TMPDIR/$i/$n" - remote_dir="$TST_TMPDIR/$i/$type" + local_dir="$TST_MNTPOINT/$i/$n" + remote_dir="$TST_MNTPOINT/$i/$type" mkdir -p $local_dir nfs_setup_server $(($$ + n)) @@ -174,7 +175,7 @@ nfs_setup() done if [ "$n" -eq 1 ]; then - cd ${VERSION}/0 + cd $TST_MNTPOINT/$VERSION/0 fi } @@ -190,19 +191,24 @@ nfs_cleanup() local n=0 for i in $VERSION; do - local_dir="$TST_TMPDIR/$i/$n" - grep -q "$local_dir" /proc/mounts && umount $local_dir + type=$(get_socket_type $n) + remote_dir="$TST_MNTPOINT/$i/$type" + tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" + tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" n=$(( n + 1 )) done n=0 for i in $VERSION; do - type=$(get_socket_type $n) - remote_dir="$TST_TMPDIR/$i/$type" - tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir" - tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir" + local_dir="$TST_MNTPOINT/$i/$n" + + grep -q "$local_dir" /proc/mounts && umount $local_dir n=$(( n + 1 )) done + + restart_daemon nfs-server + tst_sleep 500ms } +. daemonlib.sh . tst_net.sh