1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00

Merge pull request #21839 from yuwata/repart-issue-reproducer-21817

test: add test case for #21817
This commit is contained in:
Yu Watanabe 2021-12-21 02:30:53 +09:00 committed by GitHub
commit a2482eb290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 3 deletions

View File

@ -21,7 +21,6 @@ test_append_files() {
instmods overlay =overlayfs instmods overlay =overlayfs
install_dmevent install_dmevent
generate_module_dependencies generate_module_dependencies
inst_binary losetup
inst_binary mksquashfs inst_binary mksquashfs
inst_binary unsquashfs inst_binary unsquashfs
install_verity_minimal install_verity_minimal

View File

@ -27,7 +27,6 @@ test_append_files() {
instmods overlay =overlayfs instmods overlay =overlayfs
install_dmevent install_dmevent
generate_module_dependencies generate_module_dependencies
inst_binary losetup
inst_binary wc inst_binary wc
if command -v openssl >/dev/null 2>&1; then if command -v openssl >/dev/null 2>&1; then
inst_binary openssl inst_binary openssl

View File

@ -15,7 +15,6 @@ test_append_files() {(
instmods loop =block instmods loop =block
instmods dm_integrity =md instmods dm_integrity =md
inst_binary losetup
inst_binary integritysetup inst_binary integritysetup
inst_binary blkid inst_binary blkid
install_dmevent install_dmevent

View File

@ -154,6 +154,7 @@ BASICTOOLS=(
ln ln
loadkeys loadkeys
login login
losetup
lz4cat lz4cat
mkfifo mkfifo
mktemp mktemp

View File

@ -116,6 +116,25 @@ grep -qxF '/var/tmp/testsuite-58.3.img3 : start= 3662944, size= 17308536,
rm /var/tmp/testsuite-58.3.img /tmp/testsuite-58.3.dump rm /var/tmp/testsuite-58.3.img /tmp/testsuite-58.3.dump
rm -r /tmp/testsuite-58.3-defs/ rm -r /tmp/testsuite-58.3-defs/
# testcase for #21817
mkdir -p /tmp/testsuite-58-issue-21817-defs/
truncate -s 100m /tmp/testsuite-58-issue-21817.img
LOOP=$(losetup -P --show -f /tmp/testsuite-58-issue-21817.img)
printf 'size=50M,type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709\n,\n' | sfdisk -X gpt /tmp/testsuite-58-issue-21817.img
cat >/tmp/testsuite-58-issue-21817-defs/test.conf <<EOF
[Partition]
Type=root
EOF
systemd-repart --pretty=yes --definitions /tmp/testsuite-58-issue-21817-defs/ "$LOOP"
sfdisk --dump "$LOOP" | tee /tmp/testsuite-58-issue-21817.dump
losetup -d "$LOOP"
grep -qF 'p1 : start= 2048, size= 102400, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709,' /tmp/testsuite-58-issue-21817.dump
grep -qF 'p2 : start= 104448, size= 100319,' /tmp/testsuite-58-issue-21817.dump
rm /tmp/testsuite-58-issue-21817.img /tmp/testsuite-58-issue-21817.dump
rm -r /tmp/testsuite-58-issue-21817-defs/
echo OK >/testok echo OK >/testok
exit 0 exit 0