File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -1190,6 +1190,49 @@ testcase_dropped_partitions() {
11901190 [[ " $( sfdisk -q -l " $image " | grep -c " $image " ) " -eq 2 ]]
11911191}
11921192
1193+ testcase_random_seed () {
1194+ local defs imgs output
1195+
1196+ # For issue #34257
1197+
1198+ defs=" $( mktemp --directory " /tmp/test-repart.defs.XXXXXXXXXX" ) "
1199+ imgs=" $( mktemp --directory " /var/tmp/test-repart.imgs.XXXXXXXXXX" ) "
1200+ # shellcheck disable=SC2064
1201+ trap " rm -rf '$defs ' '$imgs '" RETURN
1202+ chmod 0755 " $defs "
1203+
1204+ tee " $defs /root.conf" << EOF
1205+ [Partition]
1206+ Type=root
1207+ EOF
1208+
1209+ tee " $defs /home.conf" << EOF
1210+ [Partition]
1211+ Type=home
1212+ Label=home-first
1213+ EOF
1214+
1215+ tee " $defs /swap.conf" << EOF
1216+ [Partition]
1217+ Type=swap
1218+ SizeMaxBytes=64M
1219+ PaddingMinBytes=92M
1220+ EOF
1221+
1222+ systemd-repart --offline=" $OFFLINE " \
1223+ --definitions=" $defs " \
1224+ --empty=create \
1225+ --size=1G \
1226+ --dry-run=no \
1227+ --seed=random \
1228+ --offline=" $OFFLINE " \
1229+ --json=pretty \
1230+ " $imgs /zzz"
1231+
1232+ sfdisk -d " $imgs /zzz"
1233+ [[ " $( sfdisk -d " $imgs /zzz" | grep -F ' uuid=' | awk ' { print $8 }' | sort -u | wc -l) " == " 3" ]]
1234+ }
1235+
11931236OFFLINE=" yes"
11941237run_testcases
11951238
You can’t perform that action at this time.
0 commit comments