]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: format disk image through loopback device
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Mar 2022 17:26:25 +0000 (02:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 15 Mar 2022 03:35:50 +0000 (12:35 +0900)
It seems that the change on the image file sometimes not propagated on
the loopback device immediately.

test/units/testsuite-58.sh

index 1ebc699a1b044d1faaf4d8a0295285f38975024b..cc755a4f86dbb7ebc9d0827f8bb96a826b3577b4 100755 (executable)
@@ -174,7 +174,7 @@ rm -r /tmp/testsuite-58.3-defs/
 mkdir -p /tmp/testsuite-58-issue-21817-defs/
 truncate -s 100m /var/tmp/testsuite-58-issue-21817.img
 LOOP=$(losetup -P --show -f /var/tmp/testsuite-58-issue-21817.img)
-printf 'size=50M,type=%s\n,\n' "${root_guid}" | sfdisk -X gpt /var/tmp/testsuite-58-issue-21817.img
+printf 'size=50M,type=%s\n,\n' "${root_guid}" | sfdisk -X gpt "$LOOP"
 cat >/tmp/testsuite-58-issue-21817-defs/test.conf <<EOF
 [Partition]
 Type=root