Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mImyF-0002wa-Ld for mharc-grub-devel@gnu.org; Wed, 25 Aug 2021 03:05:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mImy3-0002gy-8r for grub-devel@gnu.org; Wed, 25 Aug 2021 03:04:59 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:37628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mImy1-0002d4-AE for grub-devel@gnu.org; Wed, 25 Aug 2021 03:04:58 -0400 Received: by mail-qt1-x834.google.com with SMTP id l24so19036453qtj.4 for ; Wed, 25 Aug 2021 00:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yuon8aeI1hp3/+XhQyOgq7lTAjV+WvSWQqF/VXeewMs=; b=pCGlPHp/r/k4RcOe+zYoLNIM8D6HX1+PpQZMQDgRK7oGLBEHuVmN/G/DDGFAuuxqrU ZGMCDEjski270zbUq/yK9j35UFRY7prkhdm5qH8WeUZOOgM/P1Q7XjWcKoOorDpqCwxM ZV+8qRtFN1LqWc6ZnSkSbV8UzHQvHr5WqvtxHlQY48DtqM/9Aa0TRxyYh4Q//nZ+qnbN Smw4oKtF3lm9Zc75OjE9OcShzRXeANdg+NBkbO+x73PKIRQexsxu9cal0YOl2sMXtXqG 71TNbAm/San9vNtDbD4UhkbBkaYauztvAMuaJAfoawfG627TXUjzUv/WEPytySfX66TZ vQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yuon8aeI1hp3/+XhQyOgq7lTAjV+WvSWQqF/VXeewMs=; b=sM05BI4+ZjmX4lxFQSI5B7r/0vWakreDWt7uaxEoKULmB0ioUSOAUf1h4/XJbkgcv6 08hSc0ixA4+4ktqpPLVHuhaNj1Z8HaHdMpX8qlMUMVB4BpDonbEY7S0HmgtiiPRCziKD h2LcOqQ0OtzQ2G4EvBpPbvEtGuv/JWwEgB1Hxcjwyo3Tz7HXjqYnkpUNEeDMuZGTzBtK lOyWdwdQi4K6tZ4IDpMybAi1iNCkA4SGISet8xgSVZoQMiC9vVL6lnuhxAZ5sYEAmi+M wNyewpLic7PMbVaWxamNCuPtI1BqQGqzpxn6QJxkH7G/O7teLN/UmemETHW7DViDjyJg eORQ== X-Gm-Message-State: AOAM532EmXw33GhCDOEz3pZA2O51cMwe1GEtYhHlbOtO8E8A0agyJ8Bp qjBJ0gPRKUcp9TjLDutjvIja9dus/xl04gYN X-Google-Smtp-Source: ABdhPJx2l3BgUji7ce5At+YJe3YRq6mAqSgPfA1onngqYgRIwcPJKjX9FVvbpHBXZkEMKrQoSt8F2A== X-Received: by 2002:ac8:59c4:: with SMTP id f4mr38676273qtf.334.1629875096288; Wed, 25 Aug 2021 00:04:56 -0700 (PDT) Received: from localhost.localdomain ([199.58.83.11]) by smtp.gmail.com with ESMTPSA id g1sm12444585qkd.89.2021.08.25.00.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 00:04:55 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors Date: Wed, 25 Aug 2021 02:03:59 -0500 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=development@efficientek.com; helo=mail-qt1-x834.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 07:04:59 -0000 When a test program fails because it failed to setup the test properly, this does not indicate a failure in what is attempting to be tested because the test is never run. So exit with a hard error exit status to note this difference. This will allow easier detection of tests that are not actually being run and those that are really failing. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index 4213b7bfc..eacb1e0a7 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -6,7 +6,8 @@ fs="$1" GRUBFSTEST="@builddir@/grub-fstest" -tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 +tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || +{ echo "Failed to make temporary directory"; exit 99; } # This wrapper is to ease insertion of valgrind or time statistics run_it () { @@ -273,7 +274,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do done if test "$CFILESRC" = "" ; then echo "Couldn't find compressible file" >&2 - exit 1 + exit 99 fi case x"$fs" in # FS LIMITATION: 8.3 names @@ -616,7 +617,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do mkdir -p "$MNTPOINTRO" for i in $(range 0 $((NDEVICES-1)) 1); do dd if=/dev/zero of="$FSIMAGEP${i}.img" count=1 bs=1 seek=$((DISKSIZE-1)) &> /dev/null - LODEVICE=$(losetup --find --show "$FSIMAGEP${i}.img") + LODEVICE=$(losetup --find --show "$FSIMAGEP${i}.img") || exit 99 LODEVICES="$LODEVICES $LODEVICE" if test "$i" = 0; then MOUNTDEVICE="$LODEVICE" @@ -820,7 +821,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do "mkfs.xfs" -m crc=1 -b size=$BLKSIZE -s size=$SECSIZE -L "$FSLABEL" -q "${MOUNTDEVICE}" ;; *) echo "Add appropriate mkfs command here" - exit 1 + exit 99 ;; esac BASEFILE="1.img" @@ -926,7 +927,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do for i in $(range 0 $((NDEVICES-1)) 1); do rm "$FSIMAGEP${i}.img" done - exit 1; + exit 99; fi ;; esac -- 2.27.0