[master 6/6] Add test for mountpoints

vojtechtrefny installerbot-noreply at redhat.com
Wed Mar 18 15:45:32 UTC 2015


From: Vojtech Trefny <vtrefny at redhat.com>

Tests for new dynamic mountpoint detection using MountsCache

Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
 tests/formats_test/fstesting.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/formats_test/fstesting.py b/tests/formats_test/fstesting.py
index 491e8b2..9a5d92e 100644
--- a/tests/formats_test/fstesting.py
+++ b/tests/formats_test/fstesting.py
@@ -3,6 +3,9 @@
 import abc
 from six import add_metaclass
 
+import os
+import tempfile
+
 from tests import loopbackedtestcase
 from blivet.errors import FSError, FSResizeError
 from blivet.size import Size, ROUND_DOWN
@@ -164,6 +167,22 @@ def testMounting(self):
         self.assertIsNone(an_fs.create())
         self.assertTrue(an_fs.testMount())
 
+    def testMountpoint(self):
+        an_fs = self._fs_class()
+        # FIXME: BTRFS fails to mount
+        if isinstance(an_fs, fs.BTRFS):
+            return
+        if not an_fs.formattable or not an_fs.mountable:
+            return
+        an_fs.device = self.loopDevices[0]
+        self.assertIsNone(an_fs.create())
+        mountpoint = tempfile.mkdtemp()
+        an_fs.mount(mountpoint=mountpoint)
+        self.assertEqual(an_fs.systemMountpoint, mountpoint)
+        an_fs.unmount()
+        self.assertIsNone(an_fs.systemMountpoint)
+        os.rmdir(mountpoint)
+
     def testResize(self):
         an_fs = self._fs_class()
         if not an_fs.formattable:


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/be5aa4d7bcc5da6b7f5d22fa57161c0713e0beab


More information about the anaconda-patches mailing list