Beispiel #1
0
    def test_xfs_mkfs_options(self):
        tune2fs_dict = {
            'meta-data: isize': 256,
            'meta-data: agcount': 8,
            'meta-data: agsize': 32882,
            'meta-data: sectsz': 512,
            'meta-data: attr': 0,
            'data: bsize': 4096,
            'data: imaxpct': 25,
            'data: sunit': 0,
            'data: swidth': 0,
            'data: unwritten': 1,
            'naming: version': 2,
            'naming: bsize': 4096,
            'log: version': 1,
            'log: sectsz': 512,
            'log: sunit': 0,
            'log: lazy-count': 0,
            'log: bsize': 4096,
            'log: blocks': 2560,
            'realtime: extsz': 4096,
            'realtime: blocks': 0,
            'realtime: rtextents': 0
        }

        expected_option = {
            '-i size': 256,
            '-d agcount': 8,
            '-s size': 512,
            '-b size': 4096,
            '-i attr': 0,
            '-i maxpct': 25,
            '-d sunit': 0,
            '-d swidth': 0,
            '-d unwritten': 1,
            '-n version': 2,
            '-n size': 4096,
            '-l version': 1,
            '-l sectsize': 512,
            '-l sunit': 0,
            '-l lazy-count': 0,
            '-r extsize': 4096,
            '-r size': 0,
            '-r rtdev': 0,
            '-l size': 10485760
        }
        mkfs_option = {}
        fsinfo.xfs_mkfs_options(tune2fs_dict, mkfs_option)
        for option, value in expected_option.iteritems():
            self.assertEqual(value, mkfs_option[option])
Beispiel #2
0
    def test_xfs_mkfs_options(self):
        tune2fs_dict = {'meta-data: isize': 256,
                        'meta-data: agcount': 8,
                        'meta-data: agsize': 32882,
                        'meta-data: sectsz': 512,
                        'meta-data: attr': 0,
                        'data: bsize': 4096,
                        'data: imaxpct': 25,
                        'data: sunit': 0,
                        'data: swidth': 0,
                        'data: unwritten': 1,
                        'naming: version': 2,
                        'naming: bsize': 4096,
                        'log: version': 1,
                        'log: sectsz': 512,
                        'log: sunit': 0,
                        'log: lazy-count': 0,
                        'log: bsize': 4096,
                        'log: blocks': 2560,
                        'realtime: extsz': 4096,
                        'realtime: blocks': 0,
                        'realtime: rtextents': 0}

        expected_option = {'-i size': 256,
                           '-d agcount': 8,
                           '-s size': 512,
                           '-b size': 4096,
                           '-i attr': 0,
                           '-i maxpct': 25,
                           '-d sunit': 0,
                           '-d swidth': 0,
                           '-d unwritten': 1,
                           '-n version': 2,
                           '-n size': 4096,
                           '-l version': 1,
                           '-l sectsize': 512,
                           '-l sunit': 0,
                           '-l lazy-count': 0,
                           '-r extsize': 4096,
                           '-r size': 0,
                           '-r rtdev': 0,
                           '-l size': 10485760}
        mkfs_option = {}
        fsinfo.xfs_mkfs_options(tune2fs_dict, mkfs_option)
        for option, value in expected_option.iteritems():
            self.assertEqual(value, mkfs_option[option])