提交 097dc1d3 编写于 作者: C Cleber Rosa

avocado/utils/partition.py: Partition fstype default is ext2

When not given one specific filesystem types, the Partition utility
class defaults to ext2.  Let's document that properly and reinforce
that in the accompanying unittests.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 0740308c
......@@ -159,7 +159,8 @@ class Partition(object):
"""
Format a partition to filesystem type
:param fstype: the filesystem type, e.g.. "ext3", "ext2"
:param fstype: the filesystem type, such as "ext3", "ext2". Defaults
to previously set type or "ext2" if none has set.
:param args: arguments to be passed to mkfs command.
"""
......
......@@ -26,8 +26,8 @@ class TestPartition(unittest.TestCase):
Unit tests for avocado.utils.partition
"""
@unittest.skipIf(process.system("which mkfs.ext3", ignore_status=True),
"mkfs.ext3 is required for these tests to run.")
@unittest.skipIf(process.system("which mkfs.ext2", ignore_status=True),
"mkfs.ext2 is required for these tests to run.")
def setUp(self):
try:
process.system("/bin/true", sudo=True)
......@@ -63,7 +63,7 @@ class TestPartition(unittest.TestCase):
def test_double_mount(self):
""" Check the attempt for second mount fails """
self.disk.mkfs("ext2")
self.disk.mkfs()
self.disk.mount()
self.assertIn(self.mountpoint, open("/proc/mounts").read())
self.assertRaises(partition.PartitionError, self.disk.mount)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册