Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1muqdd-0001k2-Rh for mharc-grub-devel@gnu.org; Wed, 08 Dec 2021 01:41:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muqdZ-0001iU-Pl for grub-devel@gnu.org; Wed, 08 Dec 2021 01:41:10 -0500 Received: from [2607:f8b0:4864:20::82e] (port=34367 helo=mail-qt1-x82e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muqdX-0002DC-5o for grub-devel@gnu.org; Wed, 08 Dec 2021 01:41:09 -0500 Received: by mail-qt1-x82e.google.com with SMTP id o17so1449150qtk.1 for ; Tue, 07 Dec 2021 22:41:06 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=6N66Rm63ChlBZWpBjnqYW4d9ELEDoLfmh0PNhp9wry0=; b=5HQBLjlPyMvZ+sEAReP6J7DoKUDlqjXkCNnJGL5nyS4OyPhuhS03moBEumHd8OLx3b aWGR1vZ9ju34F0a7jJd+HeI80ZJSDek+ml5pHCqdz/VDwtCsSGsOgQQnaCGAVUe6crtB JoZ7yywhgv6P7NatEFtomcMXtMY0Ky+IDVWibTRenYLdNxzqQ17gzlFyEseBpSLrWS3W ymVwa5HWG6eQ+kexoSP7k+HG08tL34lKhgqDQOw28RGDdX/dFDJsFnHiPRVZxonIQ94j tGbRS+7TN40P36J80ve4mmptjvpBbtWAL/JrxMNh41wbe50CtReXbgqUDkJKFRj7ocVY /jJQ== 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:mime-version :content-transfer-encoding; bh=6N66Rm63ChlBZWpBjnqYW4d9ELEDoLfmh0PNhp9wry0=; b=UKTvO6OY3vuwPZgoyIPX/+tM4qAweYTFIFwNiqfCiMQmVKyBpXy4Ng8hPsarDX/u2h 0kKWcpzfaPQewDhJ8nQTeBc8ahlfy1kPng+H8sq5Z0Xr93a7y1jAyEztdIXQleHNp6t5 d5ZqlCQxk3L0NO2NiOUs47wIt7KgNZeV2wwwGiQFjLxzhJoumWAoMQwRsoCgGGxglu73 fECaQikIjp36nn/BmcVUlW7rpGzu76i0UH19JFpj8mz++1GNOzjzebx38uvTxSYxK8xw mNjhO34MB5a01MNDvC4yLjhu+r2S40wZiEHQjwY/J1E4hKps0WepvtkAho3WTpJITzWL aWAQ== X-Gm-Message-State: AOAM532caWrFQaqw//eI737PKxLRoZWHzYLT7odJdfdo28SGzMPFD6E6 xIzLjhlxfdqVD7zRrC5d1APgQA== X-Google-Smtp-Source: ABdhPJznSkfHYOdi2u5p2bs7jTvBiYRetqTrtC7afSnS5wNIbN7JjJq4MI/MsSEcfxy+fNCbh/roEg== X-Received: by 2002:ac8:488b:: with SMTP id i11mr5202062qtq.208.1638945665999; Tue, 07 Dec 2021 22:41:05 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id a20sm1024991qkh.63.2021.12.07.22.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 22:41:05 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Thomas Schmitt , Glenn Washburn Subject: [PATCH] tests: Refactor building xorriso command for iso9660 tests Date: Wed, 8 Dec 2021 00:40:51 -0600 Message-Id: <20211208064051.980395-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::82e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=development@efficientek.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2021 06:41:11 -0000 The iso9660 tests test creating isos with different combinations of joliet, rockridge, and iso9660 conformance level. Refactor xorriso argument generation for more readability and extensibility. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 43 +++++++++++++++++------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index 2dcd09f5e..959d0694d 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -1027,30 +1027,27 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do x"ziso9660") FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); xorriso -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 3 -graft-points -R -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" -- -add /="$MASTER" -- -zisofs default -set_filter_r --zisofs / -- ;; - x"iso9660") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge off -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 3 -graft-points -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"joliet") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge off -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 3 -graft-points -J -joliet-long -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"rockridge") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge on -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 3 -graft-points -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"rockridge_joliet") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge on -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 3 -graft-points -J -joliet-long -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"iso9660_1999") + x"iso9660" | xjoliet | xrockridge | xrockridge_joliet | x"iso9660_1999" | xjoliet_1999 | xrockridge_1999 | xrockridge_joliet_1999) FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge off -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 4 -graft-points -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"joliet_1999") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge off -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 4 -graft-points -J -joliet-long -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"rockridge_1999") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge on -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 4 -graft-points -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; - x"rockridge_joliet_1999") - FSUUID=$(date -u +%Y-%m-%d-%H-%M-%S-00); - xorriso --rockridge on -compliance rec_mtime -as mkisofs $XORRISOFS_CHARSET -iso-level 4 -graft-points -J -joliet-long -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; + XORRISO_ARGS="-as mkisofs $XORRISOFS_CHARSET -graft-points" + + if [ -z "${fs##*rockridge*}" ]; then + XORRISO_ARGS="-rockridge on $XORRISO_ARGS" + else + XORRISO_ARGS="-rockridge off $XORRISO_ARGS" + fi + + if [ -z "${fs##*1999*}" ]; then + XORRISO_ARGS="$XORRISO_ARGS -iso-level 4" + else + XORRISO_ARGS="$XORRISO_ARGS -iso-level 3" + fi + + if [ -z "${fs##*joliet*}" ]; then + XORRISO_ARGS="$XORRISO_ARGS -J -joliet-long" + fi + + xorriso -compliance rec_mtime $XORRISO_ARGS -V "$FSLABEL" --modification-date=$(echo ${FSUUID} | sed 's/-//g;') -o "${FSIMAGEP}0.img" /="$MASTER" ;; x"romfs") genromfs -V "$FSLABEL" -f "${FSIMAGEP}0.img" -d "$MASTER" ;; xsquash4_*) -- 2.27.0