[parted-devel] [PATCH 1/3] tests: Add helper 'require_swap_'

Sebastian Parschauer sparschauer at suse.de
Tue Feb 20 14:37:42 UTC 2018


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 at 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 \
-- 
2.16.1




More information about the parted-devel mailing list