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