Esempio n. 1
0
    def test_ext_mkfs_options(self):
        tune2fs_dict = {
            'Filesystem volume name': '<none>',
            'Last mounted on': '<not available>',
            'Filesystem revision #': '1 (dynamic)',
            'Block size': 4096,
            'Block count': 263056,
            'Fragment size': 4096,
            'Blocks per group': 32768,
            'Journal inode': 8,
            'Reserved block count': 2630,
            'Inode count': 131616,
            'Filesystem features': 'filetype sparse_super',
            'Filesystem OS type': 'Linux'
        }
        expected_option = {
            '-b': 4096,
            '-f': 4096,
            '-g': 32768,
            '-j': None,
            '-m': 1,
            '-O': 'filetype,sparse_super',
            '-o': 'Linux',
            '-r': '1'
        }

        mkfs_option = {}
        fsinfo.ext_mkfs_options(tune2fs_dict, mkfs_option)

        for option, value in expected_option.iteritems():
            self.assertEqual(value, mkfs_option[option])
Esempio n. 2
0
    def test_ext_mkfs_options(self):
        tune2fs_dict = {'Filesystem volume name': '<none>',
                        'Last mounted on': '<not available>',
                        'Filesystem revision #': '1 (dynamic)',
                        'Block size': 4096,
                        'Block count': 263056,
                        'Fragment size': 4096,
                        'Blocks per group': 32768,
                        'Journal inode': 8,
                        'Reserved block count': 2630,
                        'Inode count': 131616,
                        'Filesystem features': 'filetype sparse_super',
                        'Filesystem OS type': 'Linux'}
        expected_option = {'-b': 4096,
                           '-f': 4096,
                           '-g': 32768,
                           '-j': None,
                           '-m': 1,
                           '-O': 'filetype,sparse_super',
                           '-o': 'Linux',
                           '-r': '1'}

        mkfs_option = {}
        fsinfo.ext_mkfs_options(tune2fs_dict, mkfs_option)

        for option, value in expected_option.iteritems():
            self.assertEqual(value, mkfs_option[option])