Blame SOURCES/0500-tests-use-fdisk-instead-of-sfdisk.patch

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