parted/tests-add-helper-require_swap_.patch
Sebastian Parschauer 39139f7681 Accepting request 578406 from home:sparschauer:branches:Base:System
- libparted: Fix partition device naming for all devices
  (bsc#1078820, bsc#1081547)
- libparted: Canonicalize /dev/md/ paths (bsc#1078820)

OBS-URL: https://build.opensuse.org/request/show/578406
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=139
2018-02-20 15:38:03 +00:00

33 lines
912 B
Diff

From: Sebastian Parschauer <sparschauer@suse.de>
Date: Tue, 20 Feb 2018 12:30:23 +0100
Subject: tests: Add helper 'require_swap_'
For: libparted-canonicalize-dev-md-paths.patch
References: bsc#1078820
Patch-mainline: submitted, 2018-02-20
To achieve that a partition is busy, it is easiest to use it as swap
partition. So check if mkswap, swapon, and swapoff are available.
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
---
tests/t-lib-helpers.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh
index 9312343..962b4f1 100644
--- a/tests/t-lib-helpers.sh
+++ b/tests/t-lib-helpers.sh
@@ -362,6 +362,12 @@ require_xfs_()
mkfs.xfs -V || skip_ "this test requires XFS support"
}
+require_swap_()
+{
+ mkswap -V && swapon -V && swapoff -V || \
+ skip_ "this test requires swap support"
+}
+
require_dvhtool_()
{
dvhtool --help \