From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mvbTr-0007ky-UJ for mharc-grub-devel@gnu.org; Fri, 10 Dec 2021 03:42:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvbTi-0007i8-49 for grub-devel@gnu.org; Fri, 10 Dec 2021 03:42:08 -0500 Received: from [2607:f8b0:4864:20::730] (port=46613 helo=mail-qk1-x730.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvbTf-0002zd-Kn for grub-devel@gnu.org; Fri, 10 Dec 2021 03:42:05 -0500 Received: by mail-qk1-x730.google.com with SMTP id a11so7087099qkh.13 for ; Fri, 10 Dec 2021 00:41:59 -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=aYY9TugNTFst9j3xogGFpDmeS8W+Yb9jLQfGV9iQ4wA=; b=Ph7jTg9lQy0MkatR5PdR1EBSeDWoessTB+AEIt6vYJvmEjjMhr7K2WU2aqXzcD+bO+ Uo99E0QeB6zPWekIDGZ+aI8B8pQojg1fLvOo6fv3BMWoKcLJedjGFvyJsJ08T901Sd4R xhwqwD7KfKuWbZF/GxfTONX+VRnMQI/A85tYxrxqpeKvyjhYXz4S1pMzgHBPCif2S+mo QfAMsAVAyYyOD86EuTVkJpagwXC6gOoI5BD2/cFoibSkJ9+RvDVTghz1XGbqJZkB9syu qUJtcNYAYPzWz8DvNx9kDRwCgJc+sN5vnUzjU/UY8zDTV4yxLesT+Z0KkcGZoLlRFhH6 fF9Q== 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=aYY9TugNTFst9j3xogGFpDmeS8W+Yb9jLQfGV9iQ4wA=; b=23W1n5GAFbid4hCTjYCotuVA3TDI7d7Mg3z7tXf6X9Vpl+2Y7RULE/mmzMb7+DYOOS 78OjycC+f/cuMlzrujSc6vQtnWuSz1Hg1ZpyeeNjgCWsShvfZCekcuLLsS/vcw4lVlVY 26FR1two+0EVpqGHF3uOjy4Ucoi+Ws8yNkUVL6+uyyyUL2SVYrvFiG6kWJQLT2iAEb3u E/nxJr0KaH8/RmFl6UJUgcqdv8QQ/ZmSACNUPC3HNalhvF8/kof/vGL6cY7LfVZmFJ+C doUgLlT73y5VQm/VvlPa1tYZaeaWt3zhVWZ/mYOtxFg+OuaW6gjFYRrldi7/n7DrEayc P37w== X-Gm-Message-State: AOAM533PjcnlG9m842TbIMeWZ2Fy8AXMBov7w7l38BqXRHnk1WpROP/A jFpc1HmpisSbBZQb+JKaHWha+Q== X-Google-Smtp-Source: ABdhPJznpibIPYWd1c//PeyKLhL4TJB5RQn+IZ/Bt5OWXRBdKfZeh4pK+/L6wth3XKwg/I42sbIucw== X-Received: by 2002:a05:620a:1a27:: with SMTP id bk39mr18503630qkb.394.1639125718837; Fri, 10 Dec 2021 00:41:58 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id o17sm1495957qtv.30.2021.12.10.00.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 00:41:58 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Thomas Schmitt , Glenn Washburn Subject: [PATCH v2] tests: Refactor building xorriso command for iso9660 tests Date: Fri, 10 Dec 2021 02:41:44 -0600 Message-Id: <20211210084144.1129114-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::730 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::730; envelope-from=development@efficientek.com; helo=mail-qk1-x730.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, 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: Fri, 10 Dec 2021 08:42:08 -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 --- Updates since v1: * Reorder such that command line arguments are built in order, per Thomas' suggestion --- tests/util/grub-fs-tester.in | 45 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index 2dcd09f5e..aa72b2174 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -1027,30 +1027,29 @@ 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="-compliance rec_mtime" + + if [ -z "${fs##*rockridge*}" ]; then + XORRISO_ARGS="$XORRISO_ARGS -rockridge on" + else + XORRISO_ARGS="$XORRISO_ARGS -rockridge off" + fi + + XORRISO_ARGS="$XORRISO_ARGS -as mkisofs $XORRISOFS_CHARSET -graft-points" + + 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 $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