dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
c62b8e
From b1759ccd2f83bf75871333524cffb4c5b312ea93 Mon Sep 17 00:00:00 2001
c62b8e
From: Frantisek Sumsal <fsumsal@redhat.com>
c62b8e
Date: Fri, 15 Feb 2019 18:13:22 +0100
c62b8e
Subject: [PATCH] tests: run `udevadm settle` after `fdisk`
c62b8e
c62b8e
This makes the script wait for the newly created partition to
c62b8e
show up before trying to put a filesystem on it, which should
c62b8e
prevent the tests from failing with the following error:
c62b8e
```
c62b8e
Command (m for help): Building a new DOS disklabel with disk identifier 0x614565d4.
c62b8e
c62b8e
Command (m for help): Partition type:
c62b8e
   p   primary (0 primary, 0 extended, 4 free)
c62b8e
   e   extended
c62b8e
Select (default p): Partition number (1-4, default 1): First sector (2048-819199, default 2048): Using default value 2048
c62b8e
Last sector, +sectors or +size{K,M,G} (2048-819199, default 819199): Partition 1 of type Linux and of size 290 MiB is set
c62b8e
c62b8e
Command (m for help): Partition type:
c62b8e
   p   primary (1 primary, 0 extended, 3 free)
c62b8e
   e   extended
c62b8e
Select (default p): Partition number (2-4, default 2): First sector (595968-819199, default 595968): Using default value 595968
c62b8e
Last sector, +sectors or +size{K,M,G} (595968-819199, default 819199): Partition 2 of type Linux and of size 50 MiB is set
c62b8e
c62b8e
Command (m for help): The partition table has been altered!
c62b8e
c62b8e
Calling ioctl() to re-read partition table.
c62b8e
Syncing disks.
c62b8e
/dev/loop1p1: No such file or directory
c62b8e
Usage: mkfs.xfs
c62b8e
<snip>
c62b8e
mount: /dev/loop1p1 is write-protected, mounting read-only
c62b8e
mount: unknown filesystem type '(null)'
c62b8e
```
c62b8e
c62b8e
Based on 053edc5b04d8130a344eb1746f4b14a9823ac3ad
c62b8e
---
c62b8e
 test/test-functions | 2 +-
c62b8e
 1 file changed, 1 insertion(+), 1 deletion(-)
c62b8e
c62b8e
diff --git a/test/test-functions b/test/test-functions
c62b8e
index def16d3277..78e725d5b9 100644
c62b8e
--- a/test/test-functions
c62b8e
+++ b/test/test-functions
c62b8e
@@ -160,7 +160,7 @@ p
c62b8e
 w
c62b8e
 q
c62b8e
 EOF
c62b8e
-    partprobe "$LOOPDEV"
c62b8e
+    udevadm settle
c62b8e
     mkfs.xfs -L systemd "${LOOPDEV}p1"
c62b8e
 }
c62b8e