Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1maSK9-0006FH-7J for mharc-grub-devel@gnu.org; Tue, 12 Oct 2021 20:40:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maSJw-0005t1-B0 for grub-devel@gnu.org; Tue, 12 Oct 2021 20:40:38 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:44765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maSJr-0000X7-8W for grub-devel@gnu.org; Tue, 12 Oct 2021 20:40:35 -0400 Received: by mail-qk1-x736.google.com with SMTP id bi9so718376qkb.11 for ; Tue, 12 Oct 2021 17:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vxIB20zwwqUp7n/xeCvrmcCWeJQJChZqscixLySpIBA=; b=2m4Si4em0KGCB9cSq8WttxPFsTveb3cDgX4Zw38jfWSaDA6lLTGelKAvTgf95uj5c0 SrQXOATrX5mhSu8D2eKnKVQR7amUJ9Yfez13AV5N29+m1VZGgNb40o1Fz5iJssVmaFA0 6v7B1Zf6feDE/63Jfjh4VSXmxxaCIlGkKloW7XLDPnkQT9VGaLQ2cw5Z7yFKD3USounn DX58UkpnLHMnM6R4mcnwkK9QJqdvQ3ZKvbZhLUPzYYJC0ViM1Q6jCsXdaslKph4dI2tA pPRyYQ22/2yIl3gSueWBjdfBkd+f9KnLgtlc5RC3WdK3sfhn0rgfDoZTpmG3DOt394Ct 4VNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vxIB20zwwqUp7n/xeCvrmcCWeJQJChZqscixLySpIBA=; b=UFzWft0Arodnyy1EQBqNd+wHOV3GiA3Xu/45jqZ3rPQVRMO5zUdkNWoxqK06GPQdBM 2/M3SVQiPGfneVG/JSr144W7dC4wC92ocKoX+hX4oMRsCnFUnYS7eNA2iAchi8NTWXf4 WJsTeSYwloMES40WhfwcdVtBHoJDJdoGgZySGfQEgFqLgXRs6KXhI+NKw029PjAaiIF+ SvieY0tJjVdz/KHp+xwm6r/jiyoyOg/2hZKBcEZUS96s3gLFayN/wBJFaz28PBMspKIn f+oqNyj8uDiAEOqnRbZJOr9vw6FRSj3PZSzlCN2YXCTjqLqhTua1046IlScnb7i6kUJY 6hxQ== X-Gm-Message-State: AOAM532CP6V8Nswd69kZHfv0euq5BKKepwrEy/jfzvyLcWGpCO/lwaOZ URVRKYpaYg5siwZU3D3oSZOhr/+DzCTKzQ== X-Google-Smtp-Source: ABdhPJzpQMOB/ioISPZ2hRKwOZpCoXBKNqqteAefo3CuS72FMf3JeyzNJCkYC4jPQKZYQ4qfM2yhDw== X-Received: by 2002:a37:be87:: with SMTP id o129mr22576425qkf.213.1634085629513; Tue, 12 Oct 2021 17:40:29 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id x18sm6682367qkx.94.2021.10.12.17.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 17:40:29 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH v4 6/9] tests: Make setup errors in grub-fs-tester hard errors Date: Tue, 12 Oct 2021 19:40:00 -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::736; envelope-from=development@efficientek.com; helo=mail-qk1-x736.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, 13 Oct 2021 00:40:40 -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 cba94233d..9a05a2d26 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; } # xorriso -as mkisofs options to ignore locale when processing file names and # FSLABEL. This is especially needed for the conversion to Joliet UCS-2. @@ -277,7 +278,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 @@ -621,7 +622,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" @@ -825,7 +826,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" @@ -931,7 +932,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