def test_fstype_fallback_unknown(self): volume = Volume(disk=Disk(ImageParser(), "...")) volume._get_blkid_type = mock.Mock(return_value=None) volume._get_magic_type = mock.Mock(return_value=None) volume.info['fsdescription'] = "Linux (0x83)" # If something more specific is set, we use that volume.fstype = "?bsd" volume.determine_fs_type() self.assertEqual("bsd", volume.fstype) # Otherwise we fallback to unknown if Linux (0x83) is set volume.fstype = "" volume.determine_fs_type() self.assertEqual("unknown", volume.fstype)
def test_fstype_fallback(self): volume = Volume(disk=Disk(ImageParser(), "...")) volume.fstype = "?bsd" volume._get_blkid_type = mock.Mock(return_value=None) volume._get_magic_type = mock.Mock(return_value=None) volume.determine_fs_type() self.assertEqual("bsd", volume.fstype)
def test_valid_vstype(self): volume = Volume(disk=Disk(ImageParser(), "...")) volume.fstype = 'dos' volume.determine_fs_type() self.assertEqual("dos", volume.volumes.vstype) self.assertEqual("volumesystem", volume.fstype)
def test_valid_fstype(self): volume = Volume(disk=Disk(ImageParser(), "...")) volume.fstype = 'ext' volume.determine_fs_type() self.assertEqual("ext", volume.fstype)