[blivet:master 6/8] Add a test for activation.

mulhern amulhern at redhat.com
Fri Jul 25 16:39:26 UTC 2014


---
 tests/devicelibs_test/mdraid_test.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/devicelibs_test/mdraid_test.py b/tests/devicelibs_test/mdraid_test.py
index 0daa56e..ad0c3c7 100755
--- a/tests/devicelibs_test/mdraid_test.py
+++ b/tests/devicelibs_test/mdraid_test.py
@@ -155,6 +155,8 @@ class SimpleRaidTest(MDRaidAsRootTestCase):
         with self.assertRaises(MDRaidError):
             mdraid.mdnominate(self.loopDevices[2])
 
+        info_pre = mdraid.mddetail(self._dev_name)
+
         ##
         ## mddeactivate
         ##
@@ -182,6 +184,17 @@ class SimpleRaidTest(MDRaidAsRootTestCase):
         with self.assertRaises(MDRaidError):
             mdraid.mdactivate("/dev/md1")
 
+        self.assertIsNone(mdraid.mdactivate(self._dev_name, array_uuid=info_pre['UUID']))
+        time.sleep(2)
+        info_post = mdraid.mddetail(self._dev_name)
+
+        # the array should remain the same across activations
+        for k in info_pre.keys():
+            self.assertEqual(info_pre[k], info_post[k], msg="key: %s" % k)
+
+        # deactivating the array one more time
+        self.assertIsNone(mdraid.mddeactivate(self._dev_name))
+
         ##
         ## mddestroy
         ##
-- 
1.9.3



More information about the anaconda-patches mailing list