Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lLcqc-0004bX-V0 for mharc-grub-devel@gnu.org; Sun, 14 Mar 2021 22:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLcqY-0004SI-QS for grub-devel@gnu.org; Sun, 14 Mar 2021 22:20:42 -0400 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]:45092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLcqV-00045Q-H5 for grub-devel@gnu.org; Sun, 14 Mar 2021 22:20:42 -0400 Received: by mail-ot1-x331.google.com with SMTP id r24so6326175otp.12 for ; Sun, 14 Mar 2021 19:20:39 -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=EW7gKAlM2rsqxJTxvN9ALQ48PFbJiPfRcYhsdt3dfj72v/OlnXkHmPKp0ULXP20HCj k5MyyVzjkCAeBESqPy9TTbivTttu+jedsnJRR9cW0sd0xVebb9lovRF3cSedB6kac3m5 LUTjSqoSKgXwak6UTYQbpaASbanC+8pcvs8bpJHzY/xa1v6/UEPxPi5PfHU8rzy86T4Y cLgWe+gOvrl569PzKjvan9oqhJanU2tTd90lKYDhPmdoDOQUAEjWvIVf9qaBwlLxjgCy sWnTQWbun9AiUCQ/GNybufHh3SCZVn3/U70C+TrSU1ynk4k8yHcJkJD1uqdVAIyHfjjC s8YQ== 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=lfDxDh0cCW/XUh4awQuOUYVw8c5SkSM35F05aPa+l5nPyLHodurbdF/bywiB4GZtW2 y5ZJed5Y6LQVDaQZM05dTBVVr5MTvi046QtETAyngwcE9ptZaT98SW5K4KR2Pa3NRDo/ OIxfu1cchP5qhAFSDRK5x21+5kJQjGa2IFAtnRY0qh4T03yO3e/7Q+HP35DaOq6vVmTm qnbUMdYEW6mlMcxRAYoqPF6jUgMqM/OQfAwXM0AyBY6m1sYokPdD7zeLFhMlb7e5c5+S wMjo5KVUfZgHNqPcPjZ4yDievchtSznSsz9svpehnw8Kr4OP7expEuXO6doKXGb58JaF BqaQ== X-Gm-Message-State: AOAM531UogylVsie7VPzSMMxQJXlw7Qr/NEpg978DU7Zexryv74lMIah izQJkUAoPMpB0aRysYhrmu4dyFndTWFVFA== X-Google-Smtp-Source: ABdhPJxl/V6xTk++ncwxqaJalGizwJxMNF6zO5CyUviteRA7HOazEJB2ZzdIxhA68ddMrw9dONMG8g== X-Received: by 2002:a9d:825:: with SMTP id 34mr12970067oty.280.1615774838339; Sun, 14 Mar 2021 19:20:38 -0700 (PDT) Received: from localhost.localdomain ([2605:a601:aac5:3700:b5e5:83e3:99ae:e6e8]) by smtp.gmail.com with ESMTPSA id t22sm6733206otl.49.2021.03.14.19.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 19:20:37 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH 5/8] tests: Make setup errors in grub-fs-tester hard errors Date: Sun, 14 Mar 2021 21:20:20 -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::331; envelope-from=development@efficientek.com; helo=mail-ot1-x331.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: Mon, 15 Mar 2021 02:20:43 -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