All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tests: Refactor building xorriso command for iso9660 tests
@ 2021-12-10  8:41 Glenn Washburn
  2021-12-10 21:03 ` Thomas Schmitt
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Washburn @ 2021-12-10  8:41 UTC (permalink / raw)
  To: Daniel Kiper, grub-devel; +Cc: Thomas Schmitt, Glenn Washburn

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 <development@efficientek.com>
---
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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] tests: Refactor building xorriso command for iso9660 tests
  2021-12-10  8:41 [PATCH v2] tests: Refactor building xorriso command for iso9660 tests Glenn Washburn
@ 2021-12-10 21:03 ` Thomas Schmitt
  2021-12-16 13:44   ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schmitt @ 2021-12-10 21:03 UTC (permalink / raw)
  To: grub-devel; +Cc: dkiper, development

Hi,

On Fri, 10 Dec 2021 02:41:44 -0600, Glenn Washburn wrote:
> 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 <development@efficientek.com>
> ---
> Updates since v1:
> * Reorder such that command line arguments are built in order, per Thomas'
>   suggestion
> ---

Reviewed-by: Thomas Schmitt <scdbackup@gmx.net>

Have a nice day :)

Thomas



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] tests: Refactor building xorriso command for iso9660 tests
  2021-12-10 21:03 ` Thomas Schmitt
@ 2021-12-16 13:44   ` Daniel Kiper
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2021-12-16 13:44 UTC (permalink / raw)
  To: development; +Cc: grub-devel, Thomas Schmitt

On Fri, Dec 10, 2021 at 10:03:09PM +0100, Thomas Schmitt wrote:
> Hi,
>
> On Fri, 10 Dec 2021 02:41:44 -0600, Glenn Washburn wrote:
> > 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 <development@efficientek.com>
> > ---
> > Updates since v1:
> > * Reorder such that command line arguments are built in order, per Thomas'
> >   suggestion
> > ---
>
> Reviewed-by: Thomas Schmitt <scdbackup@gmx.net>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-16 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-10  8:41 [PATCH v2] tests: Refactor building xorriso command for iso9660 tests Glenn Washburn
2021-12-10 21:03 ` Thomas Schmitt
2021-12-16 13:44   ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.