1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-22 17:57:49 +03:00

test: extend repart test suite to test for unaligned partitions

This commit is contained in:
Lennart Poettering 2021-11-09 16:53:11 +01:00
parent 1052a1142d
commit 15c5977644

View File

@ -84,6 +84,38 @@ cmp /var/tmp/testsuite-58.img /var/tmp/testsuite-58.2.img
rm /var/tmp/testsuite-58.img /var/tmp/testsuite-58.2.img /tmp/testsuite-58.dump
rm -r /tmp/testsuite-58-defs/
# Third part: operate on an an image with unaligned partition, to see if that works.
rm -f /var/tmp/testsuite-58.3.img /tmp/testsuite-58-3.dump
mkdir -p /tmp/testsuite-58.3-defs/
cat >/tmp/testsuite-58.3-defs/root.conf <<EOF
[Partition]
Type=root
EOF
truncate -s 10g /var/tmp/testsuite-58.3.img
sfdisk /var/tmp/testsuite-58.3.img <<EOF
label: gpt
start=2048, size=69044
start=71092, size=3591848
EOF
systemd-repart --definitions=/tmp/testsuite-58.3-defs/ \
--seed=750b6cd5c4ae4012a15e7be3c29e6a47 \
--dry-run=no \
/var/tmp/testsuite-58.3.img
sfdisk --dump /var/tmp/testsuite-58.3.img | tee /tmp/testsuite-58.3.dump
grep -qF '/var/tmp/testsuite-58.3.img1 : start= 2048, size= 69044,' /tmp/testsuite-58.3.dump
grep -qF '/var/tmp/testsuite-58.3.img2 : start= 71092, size= 3591848,' /tmp/testsuite-58.3.dump
grep -qxF '/var/tmp/testsuite-58.3.img3 : start= 3662944, size= 17308536, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=60F33797-1D71-4DCB-AA6F-20564F036CD0, name="root-x86-64", attrs="GUID:59"' /tmp/testsuite-58.3.dump
rm /var/tmp/testsuite-58.3.img /tmp/testsuite-58.3.dump
rm -r /tmp/testsuite-58.3-defs/
echo OK >/testok
exit 0