ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ecbff1
From 5655999840f9c3d8b55a40c1751df400b425178a Mon Sep 17 00:00:00 2001
ecbff1
From: Michal Sekletar <msekleta@redhat.com>
ecbff1
Date: Mon, 24 Jul 2017 13:25:19 +0200
ecbff1
Subject: [PATCH] tests: use fdisk instead of sfdisk
ecbff1
ecbff1
In RHEL7 we have an older version of sfdisk that exits with an error
ecbff1
when executed with sfdisk script that is used in upstream to create
ecbff1
partitions on root disk.
ecbff1
ecbff1
Let's use equivalent fdisk commands to achieve the (more less) same
ecbff1
result.
ecbff1
ecbff1
Also default size of disk image is bumped to 400M. Previous 300M doesn't
ecbff1
work, probably due to some fdisk bug. Size of second partiotion (/var in
ecbff1
TEST-02-CRYPTSETUP) is bumped to 50M to accommodate space requirements
ecbff1
of xfs filesystem.
ecbff1
ecbff1
RHEL-only
ecbff1
ecbff1
Resolves: #1475870
ecbff1
---
ecbff1
 test/test-functions | 21 ++++++++++++++++-----
ecbff1
 1 file changed, 16 insertions(+), 5 deletions(-)
ecbff1
ecbff1
diff --git a/test/test-functions b/test/test-functions
ecbff1
index f8950e31e..cf5612370 100644
ecbff1
--- a/test/test-functions
ecbff1
+++ b/test/test-functions
ecbff1
@@ -141,15 +141,26 @@ install_missing_libraries() {
ecbff1
 create_empty_image() {
ecbff1
     rm -f "$TESTDIR/rootdisk.img"
ecbff1
     # Create the blank file to use as a root filesystem
ecbff1
-    dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek=300
ecbff1
+    dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek=400
ecbff1
     LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
ecbff1
     [ -b "$LOOPDEV" ] || return 1
ecbff1
     echo "LOOPDEV=$LOOPDEV" >> $STATEFILE
ecbff1
-    sfdisk "$LOOPDEV" <
ecbff1
-,290M
ecbff1
-,
ecbff1
+    fdisk "$LOOPDEV" <
ecbff1
+o
ecbff1
+n
ecbff1
+p
ecbff1
+1
ecbff1
+
ecbff1
++290M
ecbff1
+n
ecbff1
+p
ecbff1
+2
ecbff1
+
ecbff1
++50M
ecbff1
+w
ecbff1
+q
ecbff1
 EOF
ecbff1
-
ecbff1
+    partprobe "$LOOPDEV"
ecbff1
     mkfs.xfs -L systemd "${LOOPDEV}p1"
ecbff1
 }
ecbff1