summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/units/TEST-58-REPART.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/units/TEST-58-REPART.sh b/test/units/TEST-58-REPART.sh
index b2a3be686c..6110dc4e52 100755
--- a/test/units/TEST-58-REPART.sh
+++ b/test/units/TEST-58-REPART.sh
@@ -1347,6 +1347,49 @@ EOF
done
}
+testcase_random_seed() {
+ local defs imgs output
+
+ # For issue #34257
+
+ defs="$(mktemp --directory "/tmp/test-repart.defs.XXXXXXXXXX")"
+ imgs="$(mktemp --directory "/var/tmp/test-repart.imgs.XXXXXXXXXX")"
+ # shellcheck disable=SC2064
+ trap "rm -rf '$defs' '$imgs'" RETURN
+ chmod 0755 "$defs"
+
+ tee "$defs/root.conf" <<EOF
+[Partition]
+Type=root
+EOF
+
+ tee "$defs/home.conf" <<EOF
+[Partition]
+Type=home
+Label=home-first
+EOF
+
+ tee "$defs/swap.conf" <<EOF
+[Partition]
+Type=swap
+SizeMaxBytes=64M
+PaddingMinBytes=92M
+EOF
+
+ systemd-repart --offline="$OFFLINE" \
+ --definitions="$defs" \
+ --empty=create \
+ --size=1G \
+ --dry-run=no \
+ --seed=random \
+ --offline="$OFFLINE" \
+ --json=pretty \
+ "$imgs/zzz"
+
+ sfdisk -d "$imgs/zzz"
+ [[ "$(sfdisk -d "$imgs/zzz" | grep -F 'uuid=' | awk '{ print $8 }' | sort -u | wc -l)" == "3" ]]
+}
+
OFFLINE="yes"
run_testcases