From patchwork Mon Aug 8 11:37:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1664545 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=mhmu2/58; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=WOqI7Nma; 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 4M1Z2R0XqXz9sB4 for ; Mon, 8 Aug 2022 21:38:07 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 403563C9486 for ; Mon, 8 Aug 2022 13:38:04 +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)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 7C5DF3C91F1 for ; Mon, 8 Aug 2022 13:38:02 +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-5.smtp.seeweb.it (Postfix) with ESMTPS id DFF776006E6 for ; Mon, 8 Aug 2022 13:38:01 +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 45BD220B66; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659958681; 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=m2B6QpTyz9udmWdGc6xYWYdMsbdBOhN81v/twKgGsos=; b=mhmu2/58Zcxu+HF8vx7cGYkehqnCNyGAZSS+peEkIFsoYRNAFRdF1O31UReIWbuB0Rc6jZ 1ui0xtwnR58KPT2JlsKjwmP3sZqLDDj2KFYT/s6BHCmb3q/5dxGhabmE1ee18hEWMyMqXI 8XHOJmZZofYD0++aZiCzP+VsiOdiMYk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659958681; 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=m2B6QpTyz9udmWdGc6xYWYdMsbdBOhN81v/twKgGsos=; b=WOqI7NmamqGE8X0JpaGgVvkP9l4PSJrAXtJj1R5qapjzhX9WxGLdC7x5AgAR6h08x6Zy2q 1563kQCNDbEfZGDA== 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 1199513AB3; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YO6aApn18GJ0LgAAMHmgww (envelope-from ); Mon, 08 Aug 2022 11:38:01 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 8 Aug 2022 13:37:53 +0200 Message-Id: <20220808113756.11582-2-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808113756.11582-1-pvorel@suse.cz> References: <20220808113756.11582-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_PASS, T_SCC_BODY_TEXT_LINE 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 v4 1/4] tst_test.sh: runtest.sh: Remove unused code 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" This code is in tst_print_colored() (probably forgotten to remove code from tst_test.sh in a7f613372 when moved to tst_print_colored during development; later copy wrong code in d132084bc into runtest.sh). Fixes: a7f613372 ("Colorize test type in the output") Fixes: d132084bc ("lib: Add script for running tests") Signed-off-by: Petr Vorel Reviewed-by: Li Wang Reviewed-by: Martin Doucha --- lib/newlib_tests/runtest.sh | 3 --- testcases/lib/tst_test.sh | 3 --- 2 files changed, 6 deletions(-) diff --git a/lib/newlib_tests/runtest.sh b/lib/newlib_tests/runtest.sh index f136bcb88..e78b556c5 100755 --- a/lib/newlib_tests/runtest.sh +++ b/lib/newlib_tests/runtest.sh @@ -48,9 +48,6 @@ runtest_res() local res="$1" shift - tst_color_enabled - local color=$? - printf "runtest " >&2 tst_print_colored $res "$res: " >&2 echo "$@" >&2 diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index a35fa2e7b..356af0106 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -112,9 +112,6 @@ tst_res() local res=$1 shift - tst_color_enabled - local color=$? - _tst_inc_res "$res" printf "$TST_ID $TST_COUNT " >&2 From patchwork Mon Aug 8 11:37:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1664546 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=K5YTIKbg; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=dWJ4h93Y; 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 4M1Z2d6QmQz9sB4 for ; Mon, 8 Aug 2022 21:38:17 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8CD9A3C94FA for ; Mon, 8 Aug 2022 13:38:14 +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 BE1603C942D for ; Mon, 8 Aug 2022 13:38:02 +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-6.smtp.seeweb.it (Postfix) with ESMTPS id EBE7E140016D for ; Mon, 8 Aug 2022 13:38:01 +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 81A2237985; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659958681; 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=/Vlm8yb9vXZ7SxOZ/n+iW/tOgTb2RMot1RLYIwkUde0=; b=K5YTIKbgzSR9yHNIWwNOwXZhZdNVh4QHuZsdkAQWsMSJh54q/OlGn32cBE3cz0UHX6Cc6O TXKWmLKby9oPQfjrYt4YH+4+IYGLxRyb3xX8Dovx7tGczouoke9Uh0j5hHUbCmuhQa4atJ 3mA2RPdllS6bCFCE4CXSFqjQZFLYyQw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659958681; 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=/Vlm8yb9vXZ7SxOZ/n+iW/tOgTb2RMot1RLYIwkUde0=; b=dWJ4h93Ys9m520ojrrMStXuv4NxVL7C2PTX90PQI6+09Zw6b9TQ3CKZtcC1KDiIVLHOS6X ZJSci1LJOsAAU6Dw== 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 5038F13AB3; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0CfiEZn18GJ0LgAAMHmgww (envelope-from ); Mon, 08 Aug 2022 11:38:01 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 8 Aug 2022 13:37:54 +0200 Message-Id: <20220808113756.11582-3-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808113756.11582-1-pvorel@suse.cz> References: <20220808113756.11582-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, T_SCC_BODY_TEXT_LINE 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 v4 2/4] tst_ansi_color.sh: Allow to run with set -e 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" set -e (or #!/bin/sh -e or set -o errexit) quits on any non-zero exit code, therefore any && must be turned into || (or if ...; then ..; fi). Fix hardens tst_res TINFO to be able to be used on scripts with errexit. Signed-off-by: Petr Vorel --- changes v2->v3: * really fix it. testcases/lib/tst_ansi_color.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/testcases/lib/tst_ansi_color.sh b/testcases/lib/tst_ansi_color.sh index 703df1eb8..517b709d0 100644 --- a/testcases/lib/tst_ansi_color.sh +++ b/testcases/lib/tst_ansi_color.sh @@ -24,18 +24,19 @@ tst_flag2color() tst_color_enabled() { - [ "$LTP_COLORIZE_OUTPUT" = "n" ] || [ "$LTP_COLORIZE_OUTPUT" = "0" ] && return 0 - [ "$LTP_COLORIZE_OUTPUT" = "y" ] || [ "$LTP_COLORIZE_OUTPUT" = "1" ] && return 1 + [ "$LTP_COLORIZE_OUTPUT" = "n" -o "$LTP_COLORIZE_OUTPUT" = "0" ] || return 1 + [ "$LTP_COLORIZE_OUTPUT" = "y" -o "$LTP_COLORIZE_OUTPUT" = "1" ] || return 0 [ -t 1 ] || return 0 return 1 } tst_print_colored() { - tst_color_enabled - local color=$? + local color=0 - [ "$color" = "1" ] && tst_flag2color "$1" + tst_color_enabled || color=$? + + [ "$color" != 1 ] || tst_flag2color "$1" printf "$2" - [ "$color" = "1" ] && printf '\033[0m' + [ "$color" != 1 ] || printf '\033[0m' } From patchwork Mon Aug 8 11:37:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1664549 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=M5KhEjDh; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=yatW2jG1; 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 4M1Z3H3SvDz9rx7 for ; Mon, 8 Aug 2022 21:38:51 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 62C373C94B0 for ; Mon, 8 Aug 2022 13:38:49 +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 46E413C91F1 for ; Mon, 8 Aug 2022 13:38:02 +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-3.smtp.seeweb.it (Postfix) with ESMTPS id 7FE681A006E5 for ; Mon, 8 Aug 2022 13:38:02 +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 BFA3420B80; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659958681; 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=qrhLa61ONw22s5/kObwaK1H71NTZoB5pwfM6+Z1heUQ=; b=M5KhEjDhDAazUzg7UJLms8HxjehnLd0LMaYcg55dbWSkqJM4d+q3ViRR88UU3lEeef+Zs3 ouZohUhX5uMQFxgHft758mZxJ5CCkATKs6fmEwsMJfa5EtU1SsmLPDSPTkqSa1JPHfFAgm DIGXteH89pVpgBRq7xoZEFKoMG6im94= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659958681; 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=qrhLa61ONw22s5/kObwaK1H71NTZoB5pwfM6+Z1heUQ=; b=yatW2jG1HkrG+whGqLa7U4k6BilytXc9wcYfIeewhgR372YP3N5//FuhXWLWRBSGkp54GY WWKoEx3+f1hxKMAg== 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 9092213AB3; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8EO6IJn18GJ0LgAAMHmgww (envelope-from ); Mon, 08 Aug 2022 11:38:01 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 8 Aug 2022 13:37:55 +0200 Message-Id: <20220808113756.11582-4-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808113756.11582-1-pvorel@suse.cz> References: <20220808113756.11582-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, T_SCC_BODY_TEXT_LINE 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 v4 3/4] tst_test.sh: Fix _tst_cleanup_timer() on set -e 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" If test exits on time (i.e. no timeout) kill in _tst_cleanup_timer() have nothing to kill therefore following wait exits 143. set -e (or #!/bin/sh -e or set -o errexit) quits on any non-zero exit code, fix hardens _tst_cleanup_timer() to be able to be used on scripts with it. Signed-off-by: Petr Vorel Reviewed-by: Li Wang Reviewed-by: Martin Doucha --- I can use 'if ...; then ; fi' if you prefer: if [ "$LTP_COLORIZE_OUTPUT" = "n" -o "$LTP_COLORIZE_OUTPUT" = "0" ]; then return 0 fi if [ "$LTP_COLORIZE_OUTPUT" = "y" ] || [ "$LTP_COLORIZE_OUTPUT" = "1" ]; then return 1 fi ... if [ "$color" = 1 ]; then tst_flag2color "$1" fi printf "$2" if [ "$color" = 1 ]; then printf '\033[0m' fi Kind regards, Petr testcases/lib/tst_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 356af0106..1d2bf06cc 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -518,7 +518,7 @@ _tst_cleanup_timer() { if [ -n "$_tst_setup_timer_pid" ]; then kill -TERM $_tst_setup_timer_pid 2>/dev/null - wait $_tst_setup_timer_pid 2>/dev/null + wait $_tst_setup_timer_pid 2>/dev/null || true fi } From patchwork Mon Aug 8 11:37:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1664548 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=zNtmj1kl; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=kqWuvLm1; 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 4M1Z351r30z9rx7 for ; Mon, 8 Aug 2022 21:38:40 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 5EEA93C94CC for ; Mon, 8 Aug 2022 13:38:36 +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 07C263C91F1 for ; Mon, 8 Aug 2022 13:38:03 +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-6.smtp.seeweb.it (Postfix) with ESMTPS id 9B80914000E5 for ; Mon, 8 Aug 2022 13:38:02 +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 4D47837986; Mon, 8 Aug 2022 11:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659958682; 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=XuQFlsi9xFlsvW9m3zSVoMzGCvic80f9VJmocYWKTZE=; b=zNtmj1klxX97u4EsHYBm5cUrsrdm0nd7jQPU6iI3e1+fHCTA/1Aw/3l7r2qsNt2wlB9J4M lZOnmNC/xv3IOPlH7Jw3KC+Cll6Ll60YKc4lVUjmNMdL+eHwrcJ6GAtxgVZiyzZl039Uba +X0py23mHUuMhB78Oc1OsIiE+3jza+o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659958682; 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=XuQFlsi9xFlsvW9m3zSVoMzGCvic80f9VJmocYWKTZE=; b=kqWuvLm1yYoA9VDRZwMvy66nlG7fNbBTaZGKsY9lBCaXkLliVtfRRvil5jxXRe9qwYuSZF 6ztbO6i012KL1OBQ== 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 D75F113AB3; Mon, 8 Aug 2022 11:38:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8C4fMJn18GJ0LgAAMHmgww (envelope-from ); Mon, 08 Aug 2022 11:38:01 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 8 Aug 2022 13:37:56 +0200 Message-Id: <20220808113756.11582-5-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808113756.11582-1-pvorel@suse.cz> References: <20220808113756.11582-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, T_SCC_BODY_TEXT_LINE 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 v4 4/4] generate_lvm_runfile.sh: Fix bashism 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" ERR is not on dash (tested on 0.5.11). using -e (i.e. implying 'set -e') is required to exit on any non zero exit code. It requires 2 previous fixes. Signed-off-by: Petr Vorel Reviewed-by: Li Wang Reviewed-by: Martin Doucha --- testcases/misc/lvm/generate_lvm_runfile.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/misc/lvm/generate_lvm_runfile.sh b/testcases/misc/lvm/generate_lvm_runfile.sh index 72b286a69..aba706c64 100755 --- a/testcases/misc/lvm/generate_lvm_runfile.sh +++ b/testcases/misc/lvm/generate_lvm_runfile.sh @@ -1,6 +1,7 @@ -#!/bin/sh +#!/bin/sh -e # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2020 SUSE LLC +# Copyright (c) Linux Test Project, 2022 # # Generate LTP runfile for LVM tests (runtest/lvm.local) @@ -13,7 +14,7 @@ LVM_TMPDIR="$LVM_DIR/ltp/growfiles" generate_runfile() { - trap 'tst_brk TBROK "Cannot create LVM runfile"' ERR + trap '[ $? -eq 0 ] || tst_brk TBROK "Cannot create LVM runfile"' EXIT INFILE="$LTPROOT/testcases/data/lvm/runfile.tpl" OUTFILE="$LTPROOT/runtest/lvm.local" FS_LIST=`tst_supported_fs`