[master 22/22] Guard tests against device support being missing.
mulkieran
installerbot-noreply at redhat.com
Tue May 5 16:35:46 UTC 2015
From: mulhern <amulhern at redhat.com>
Related: #12
Signed-off-by: mulhern <amulhern at redhat.com>
---
tests/action_test.py | 9 +++++++++
tests/clearpart_test.py | 6 ++++++
tests/devices_test/lvm_test.py | 11 +++++++++++
3 files changed, 26 insertions(+)
diff --git a/tests/action_test.py b/tests/action_test.py
index f030153..c370886 100644
--- a/tests/action_test.py
+++ b/tests/action_test.py
@@ -24,6 +24,15 @@
from blivet.deviceaction import ActionAddMember
from blivet.deviceaction import ActionRemoveMember
+DEVICE_CLASSES = [
+ DiskDevice,
+ PartitionDevice,
+ MDRaidArrayDevice,
+ LVMVolumeGroupDevice,
+ LVMLogicalVolumeDevice
+]
+
+ at unittest.skipUnless(all(not x.unavailableTypeDependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
class DeviceActionTestCase(StorageTestCase):
""" DeviceActionTestSuite """
diff --git a/tests/clearpart_test.py b/tests/clearpart_test.py
index 80d43ee..830a37a 100644
--- a/tests/clearpart_test.py
+++ b/tests/clearpart_test.py
@@ -6,6 +6,12 @@
from parted import PARTITION_NORMAL
from blivet.flags import flags
+DEVICE_CLASSES = [
+ blivet.devices.DiskDevice,
+ blivet.devices.PartitionDevice
+]
+
+ at unittest.skipUnless(all(not x.unavailableTypeDependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
class ClearPartTestCase(unittest.TestCase):
def setUp(self):
flags.testing = True
diff --git a/tests/devices_test/lvm_test.py b/tests/devices_test/lvm_test.py
index 12f0807..7cdfcc9 100644
--- a/tests/devices_test/lvm_test.py
+++ b/tests/devices_test/lvm_test.py
@@ -14,6 +14,17 @@
from blivet.devices import LVMVolumeGroupDevice
from blivet.size import Size
+DEVICE_CLASSES = [
+ LVMLogicalVolumeDevice,
+ LVMSnapShotDevice,
+ LVMThinLogicalVolumeDevice,
+ LVMThinPoolDevice,
+ LVMThinSnapShotDevice,
+ LVMVolumeGroupDevice,
+ StorageDevice
+]
+
+ at unittest.skipUnless(all(not x.unavailableTypeDependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
class LVMDeviceTest(unittest.TestCase):
def testLVMSnapShotDeviceInit(self):
pv = StorageDevice("pv1", fmt=blivet.formats.getFormat("lvmpv"),
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/fb8040ea528f84be04557ada27bc612a2fe48f2e
More information about the anaconda-patches
mailing list