Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kqZGZ-0006X8-Dq for mharc-grub-devel@gnu.org; Sat, 19 Dec 2020 05:15:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqZGX-0006Un-Eb for grub-devel@gnu.org; Sat, 19 Dec 2020 05:15:09 -0500 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:42650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqZGV-0001yd-MR for grub-devel@gnu.org; Sat, 19 Dec 2020 05:15:09 -0500 Received: by mail-io1-xd35.google.com with SMTP id q137so4441777iod.9 for ; Sat, 19 Dec 2020 02:15:07 -0800 (PST) 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=s/WYqToO+toErSZA/cEgD8oOGjLSGRKb0RqPjGNaP4I=; b=mMXazoo8QZf31wfZ1R4c+Gkkv9XwPAyyWRE6VSXKD9H4cvwnzv0kXOycptnwR9iOOR L2xxpdT+Hhp48QrOfS8ttw9JXYnCo4pWdPLWiC3gK4DyKa3BB6vRD7A3HD5KdDNlmV1/ ycMonOTnnNkk0ElPrNRMgurlR4Nlx76D+D4oTk+qo297u7VKeAxuWb8UKy4bswapqOAV lvbEcqICGSoBHNnKST7HrLbxlwBLVO0/xLHUUWuXwueuFjWPOPBDACJCh1N7z1C6Ss6O t4B1bUvDyeOGdl1TSLdJjtCEbEgaNC5oj/as74mZ1sYlECGUe7wI5P4fRr04iHEpec6C lY8g== 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=s/WYqToO+toErSZA/cEgD8oOGjLSGRKb0RqPjGNaP4I=; b=OiB0F1DPiwIz9LqGOOnVifkfOtpk9Xr94ExJ04NGJSCXG1V1xTHcKrLwI8u8i3e1gP Fe0haYGwO0zF5MvkZB93D+DAqPoSg4XFeXfWnl+GqA1uutf57E1n/gn0iREsydAfmVVa NR4yx9XUP9YuXvYLBiknjFzUZCko5tXRjMNgNjsL6VvLUco9YwT08EycncAUiMhT3SvG 1KWpRJA7ajhJ/S3BI47jgUGzw1a6KZB/WH+T12ZuoDKgR+f50z3qKp1dXf7WLAkCyauZ Zejo7miqBaiTin8OWEBawCFOvSuDHKp5LnTk3UZGHCDi58st1tytIUY7hfijji/2shR8 hpDg== X-Gm-Message-State: AOAM53323msw9lbFYDl/awRE8lZEO7Dd37LkhIFxhJAH689O04tX425D MR4vk9IKO9CsVL7pmCPZrwNHDhCESReWjw== X-Google-Smtp-Source: ABdhPJykkfBcBj6txd1ZXYeKX6URN88T0/9IIpOGu03mJxetF06STMpryvq0AqzTT7oBXCSfqy6Jfg== X-Received: by 2002:a02:ccea:: with SMTP id l10mr7627324jaq.101.1608372906292; Sat, 19 Dec 2020 02:15:06 -0800 (PST) Received: from localhost.localdomain ([136.49.211.192]) by smtp.gmail.com with ESMTPSA id o195sm8821542ila.38.2020.12.19.02.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 02:15:05 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [PATCH 3/5] tests: Make setup errors in grub-fs-tester hard errors Date: Sat, 19 Dec 2020 04:14:38 -0600 Message-Id: <1fa69342b8f9a2585caacf1509b74979013a128e.1608372033.git.development@efficientek.com> 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::d35; envelope-from=development@efficientek.com; helo=mail-io1-xd35.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: Sat, 19 Dec 2020 10:15:09 -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 bfc425e1f..c7137eb80 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