def test_fs_device(self): part = 'sda1' fstype = fs.getFsType(part) label = fs.getFsLabel(part) self.assertTrue(fstype) self.assertGreater(len(fstype), 0) self.assertTrue(label) self.assertGreater(len(label), 0)
def test_fs_file(self): for ft in ('ext2', 'ext4', 'xfs', 'reiserfs', 'jfs', 'btrfs', 'ntfs', 'fat16', 'fat32', 'swap'): f = '{0}.fs'.format(ft) self.assertEqual(fs.makeFs(f, ft, 'test_{0}'.format(ft), True), 0) if ft in ('fat16', 'fat32'): expectedFt = 'vfat' else: expectedFt = ft self.assertEqual(fs.getFsType(f), expectedFt) self.assertEqual(fs.getFsLabel(f).upper(), 'test_{0}'.format(ft).upper())