Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp359454imn; Thu, 4 Aug 2022 08:42:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cUuJ6jVO1OuNvmtR1Ins6ojtVcFBOTn4oSw3UsrYorTUpFjG/tOb1kDx3YqxADD+EQSdX X-Received: by 2002:a63:6a46:0:b0:41a:3e67:67cd with SMTP id f67-20020a636a46000000b0041a3e6767cdmr2120832pgc.94.1659627754663; Thu, 04 Aug 2022 08:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659627754; cv=none; d=google.com; s=arc-20160816; b=aLGuPEDMT8GKsnW8K4M0m5eW8Z4Ys4S57EA5snJSXGbgvh8fADF6oLe5TnlyCaZwlM QVIie57DSb+RhgKH+cZ2pit5VB7b04VFbVxQqAY7MqXVM+rhYCOdtx8NRFB0c9yK6THF rAJ4y51fpa5oL8Ufja0ZDVBPZ1KUuOWzGdpB/HifmhZO2W92xRxvG9EDd6IAsy64eRhg mqrUUxna62lcasCYroAQE4leL+5yZwgAoPVhzK2jruAsaN0F1J8syye8PA3pxzmgOhzx ea9/tdSpvdkrXWJVdCgP/EL99jljDLkFzrbcei+DW8ZeB5XIU48TjuGUWivw2kz8Ur2j EMxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=XgqAvDRGRKbyzelNP7eRPGBQHRHBDH17MuR91kEvAys=; b=Md6ReGBVdqlc/ADPsnoB1WNdfvMnE1p8FN0qqvYkkaArZSjq+uzSzpigXU3RC5o6lX Fz3kCcBsrBb+lrTkGtFrLIE7HBmSjvQHYmk9Mjyhnnp/Hh6DV3pNi1U3XMJm7Rd4r1PY t0NCUmiQcpOq5T9Zfh8JKXaH7Xf2FqzMa0xvU1rMhTTtNL/OpAoe6Nw5Pp+7S3n0/NOr G1eyCWUYx0QN9E8vElZ/hmXO1SM+UIfbJf6f3GXCojXXAjhERUH9DYJKlB+SfCiPV7WR cJxTXmB9cP5wqK+/Uv2kz/g8lF2/TRm/5/LroM9Kcp3tSTb3PvODeHt/RiL/OZvoOcr+ oBXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="Gmly/p+A"; dkim=neutral (no key) header.i=@suse.cz header.b=lUhwujJL; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g123-20020a636b81000000b0041604b902aasi100149pgc.546.2022.08.04.08.42.17; Thu, 04 Aug 2022 08:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="Gmly/p+A"; dkim=neutral (no key) header.i=@suse.cz header.b=lUhwujJL; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234035AbiHDPd2 (ORCPT + 99 others); Thu, 4 Aug 2022 11:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231909AbiHDPd2 (ORCPT ); Thu, 4 Aug 2022 11:33:28 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB259FD11 for ; Thu, 4 Aug 2022 08:33:26 -0700 (PDT) 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 684BC4E623; Thu, 4 Aug 2022 15:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659627205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgqAvDRGRKbyzelNP7eRPGBQHRHBDH17MuR91kEvAys=; b=Gmly/p+Ar0ShQC6kWulggnRp4Lh0zyDvgHJB6pmzKZritUspzTw4+XwwMq2GeY2Pr1jWyK myPWm2gzAbybog+IfNAjp392JvAjh8o3gvgkIn8hWYvlVNBar2QhAzdDzF1/TnLM/j/a4J YTn8WCN2g3p7Q9JxjAliQLXO3PIrFBw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659627205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgqAvDRGRKbyzelNP7eRPGBQHRHBDH17MuR91kEvAys=; b=lUhwujJL5Kflfa6QIGEfioQ0yn4lN90EhuJ78JdOyBGGF+J8CQULYclm8tOUwGICwC4qxl 6ysdL2BAt5pH5xCw== 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 4765813A94; Thu, 4 Aug 2022 15:33:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rZRxEMXm62IlFAAAMHmgww (envelope-from ); Thu, 04 Aug 2022 15:33:25 +0000 Message-ID: <2fd92c3d-a67e-3cfc-aaf8-ca35176cf399@suse.cz> Date: Thu, 4 Aug 2022 17:33:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/1] generate_lvm_runfile.sh: Fix bashism Content-Language: en-US To: Petr Vorel , ltp@lists.linux.it Cc: linux-nfs@vger.kernel.org, Cyril Hrubis References: <20220803175752.19015-1-pvorel@suse.cz> From: Martin Doucha In-Reply-To: <20220803175752.19015-1-pvorel@suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi, `trap ... EXIT` cannot be used to emulate `trap ... ERR`. The latter behaves as if every command/pipeline in the script (except conditions) were wrapped in ROD. So `trap ... ERR` will trigger exit on any failure, while `trap ... EXIT` will let the script continue after all errors and then check exit code of only the very last command. That's not what we want here. On 03. 08. 22 19:57, Petr Vorel wrote: > ERR is not on dash (tested on 0.5.11). > > Signed-off-by: Petr Vorel > --- > testcases/misc/lvm/generate_lvm_runfile.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testcases/misc/lvm/generate_lvm_runfile.sh b/testcases/misc/lvm/generate_lvm_runfile.sh > index 72b286a69..5bf5d91d6 100755 > --- a/testcases/misc/lvm/generate_lvm_runfile.sh > +++ b/testcases/misc/lvm/generate_lvm_runfile.sh > @@ -13,7 +13,7 @@ LVM_TMPDIR="$LVM_DIR/ltp/growfiles" > > generate_runfile() > { > - trap 'tst_brk TBROK "Cannot create LVM runfile"' ERR > + trap '[ $? -eq 0 ] && exit 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` -- Martin Doucha mdoucha@suse.cz QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic