summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-21 02:30:53 +0900
committerGitHub <noreply@github.com>2021-12-21 02:30:53 +0900
commita2482eb290614b3a21c7486336b9584e737c61e6 (patch)
treeda5b28ce616fa18d7b496e1247a34d05f718359e
parent94c5a83c6eedec472e9867dcd55e42e9601695bc (diff)
parent71bb6048075313a4ba90e08b70c29103ceff6f15 (diff)
downloadsystemd-a2482eb290614b3a21c7486336b9584e737c61e6.tar.gz
Merge pull request #21839 from yuwata/repart-issue-reproducer-21817
test: add test case for #21817
-rwxr-xr-xtest/TEST-29-PORTABLE/test.sh1
-rwxr-xr-xtest/TEST-50-DISSECT/test.sh1
-rwxr-xr-xtest/TEST-67-INTEGRITY/test.sh1
-rw-r--r--test/test-functions1
-rwxr-xr-xtest/units/testsuite-58.sh19
5 files changed, 20 insertions, 3 deletions
diff --git a/test/TEST-29-PORTABLE/test.sh b/test/TEST-29-PORTABLE/test.sh
index a345e29314..7727e7b5ca 100755
--- a/test/TEST-29-PORTABLE/test.sh
+++ b/test/TEST-29-PORTABLE/test.sh
@@ -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
diff --git a/test/TEST-50-DISSECT/test.sh b/test/TEST-50-DISSECT/test.sh
index bbc65a0539..77a64b9b1e 100755
--- a/test/TEST-50-DISSECT/test.sh
+++ b/test/TEST-50-DISSECT/test.sh
@@ -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
diff --git a/test/TEST-67-INTEGRITY/test.sh b/test/TEST-67-INTEGRITY/test.sh
index c379d72e20..b3bc1441ab 100755
--- a/test/TEST-67-INTEGRITY/test.sh
+++ b/test/TEST-67-INTEGRITY/test.sh
@@ -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
diff --git a/test/test-functions b/test/test-functions
index 7b9467cfc1..218d0e6888 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -154,6 +154,7 @@ BASICTOOLS=(
ln
loadkeys
login
+ losetup
lz4cat
mkfifo
mktemp
diff --git a/test/units/testsuite-58.sh b/test/units/testsuite-58.sh
index 62d0a29cb5..78c25051a2 100755
--- a/test/units/testsuite-58.sh
+++ b/test/units/testsuite-58.sh
@@ -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