From f32865ea0f9979b8efd0d1aa748061cac8d842b5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 2 Mar 2022 11:34:06 +0100 Subject: tests: (cramfs) make GID and mode use more robust We already use the same in tests/ts/cramfs/mkfs. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2133396 Addresses: https://github.com/util-linux/util-linux/issues/1613 Signed-off-by: Karel Zak --- tests/ts/cramfs/doubles | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ts/cramfs/doubles b/tests/ts/cramfs/doubles index 8a1b7bb88..eb2c7fa0f 100755 --- a/tests/ts/cramfs/doubles +++ b/tests/ts/cramfs/doubles @@ -36,10 +36,17 @@ IMAGE_SRC="$TS_OUTDIR/${TS_TESTNAME}-data" ts_log "create mountpoint dir" [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT -mkdir -p $IMAGE_SRC +rm -rf "$IMAGE_SRC" +mkdir -m 755 -p $IMAGE_SRC + +umask 133 + echo hello > $IMAGE_SRC/a echo hello > $IMAGE_SRC/b +# sudo may use whatever group +chgrp -R 0 "$IMAGE_SRC" + ts_log "create cramfs image" $TS_CMD_MKCRAMFS $IMAGE_SRC $IMAGE_PATH >> $TS_OUTPUT 2>> $TS_ERRLOG [ -s "$IMAGE_PATH" ] || ts_die "Cannot create $IMAGE_PATH" -- 2.40.1