Skip to content

Commit

Permalink
Add test for mountpoints
Browse files Browse the repository at this point in the history
Tests for new dynamic mountpoint detection using MountsCache

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
  • Loading branch information
vojtechtrefny committed Mar 19, 2015
1 parent 706db0b commit 6532cc4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/formats_test/fstesting.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6532cc4

Please sign in to comment.