From 6532cc462b6ecccca02bc699fe19cc294aacbff6 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 18 Mar 2015 15:27:19 +0100 Subject: [PATCH] Add test for mountpoints Tests for new dynamic mountpoint detection using MountsCache Signed-off-by: Vojtech Trefny --- 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 491e8b2d1..9a5d92ebd 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: