mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
Merge pull request #21839 from yuwata/repart-issue-reproducer-21817
test: add test case for #21817
This commit is contained in:
commit
a2482eb290
@ -21,7 +21,6 @@ test_append_files() {
|
||||
instmods overlay =overlayfs
|
||||
install_dmevent
|
||||
generate_module_dependencies
|
||||
inst_binary losetup
|
||||
inst_binary mksquashfs
|
||||
inst_binary unsquashfs
|
||||
install_verity_minimal
|
||||
|
@ -27,7 +27,6 @@ test_append_files() {
|
||||
instmods overlay =overlayfs
|
||||
install_dmevent
|
||||
generate_module_dependencies
|
||||
inst_binary losetup
|
||||
inst_binary wc
|
||||
if command -v openssl >/dev/null 2>&1; then
|
||||
inst_binary openssl
|
||||
|
@ -15,7 +15,6 @@ test_append_files() {(
|
||||
instmods loop =block
|
||||
instmods dm_integrity =md
|
||||
|
||||
inst_binary losetup
|
||||
inst_binary integritysetup
|
||||
inst_binary blkid
|
||||
install_dmevent
|
||||
|
@ -154,6 +154,7 @@ BASICTOOLS=(
|
||||
ln
|
||||
loadkeys
|
||||
login
|
||||
losetup
|
||||
lz4cat
|
||||
mkfifo
|
||||
mktemp
|
||||
|
@ -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 -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
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user