teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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