richardphibel / rpms / systemd

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