[blivet:rhel7/master 09/10] Add a test for labeling swap devices (#1038590)
mulhern
amulhern at redhat.com
Thu Jan 9 18:54:59 UTC 2014
Related: rhbz#1038590
Signed-off-by: mulhern <amulhern at redhat.com>
---
tests/formats_test/misc_test.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/formats_test/misc_test.py b/tests/formats_test/misc_test.py
index be3b98a..6593f67 100755
--- a/tests/formats_test/misc_test.py
+++ b/tests/formats_test/misc_test.py
@@ -5,7 +5,7 @@ import unittest
from devicelibs_test import baseclass
from blivet.formats import device_formats
import blivet.formats.fs as fs
-import blivet.formats.swas as swap
+import blivet.formats.swap as swap
class InitializationTestCase(unittest.TestCase):
"""Test FS object initialization."""
@@ -165,6 +165,14 @@ class LabelingAsRootTestCase(baseclass.DevicelibsTestCase):
an_fs.label = None
self.assertIsNone(an_fs.writeLabel())
+ @unittest.skipUnless(os.geteuid() == 0, "requires root privileges")
+ def testLabelingSwapSpace(self):
+ _LOOP_DEV0 = self._loopMap[self._LOOP_DEVICES[0]]
+
+ an_fs = swap.SwapSpace(device=_LOOP_DEV0)
+ an_fs.label = "mkswap is really pretty permissive about labels"
+ self.assertIsNone(an_fs.create())
+
def suite():
suite1 = unittest.TestLoader().loadTestsFromTestCase(InitializationTestCase)
suite2 = unittest.TestLoader().loadTestsFromTestCase(MethodsTestCase)
--
1.8.3.1
More information about the anaconda-patches
mailing list