Ejemplo n.º 1
0
    def test_mkfs_with_label(self, execute_mock):
        utils.mkfs('ext4', '/my/block/dev', 'ext4-vol')
        utils.mkfs('msdos', '/my/msdos/block/dev', 'msdos-vol')
        utils.mkfs('swap', '/my/swap/block/dev', 'swap-vol')

        expected = [
            mock.call('mkfs',
                      '-t',
                      'ext4',
                      '-F',
                      '-L',
                      'ext4-vol',
                      '/my/block/dev',
                      run_as_root=True,
                      use_standard_locale=True),
            mock.call('mkfs',
                      '-t',
                      'msdos',
                      '-n',
                      'msdos-vol',
                      '/my/msdos/block/dev',
                      run_as_root=True,
                      use_standard_locale=True),
            mock.call('mkswap',
                      '-L',
                      'swap-vol',
                      '/my/swap/block/dev',
                      run_as_root=True,
                      use_standard_locale=True)
        ]
        self.assertEqual(expected, execute_mock.call_args_list)
Ejemplo n.º 2
0
    def test_mkfs_with_label(self, execute_mock):
        utils.mkfs('ext4', '/my/block/dev', 'ext4-vol')
        utils.mkfs('msdos', '/my/msdos/block/dev', 'msdos-vol')
        utils.mkfs('swap', '/my/swap/block/dev', 'swap-vol')

        expected = [mock.call('mkfs', '-t', 'ext4', '-F', '-L', 'ext4-vol',
                              '/my/block/dev', run_as_root=True,
                              use_standard_locale=True),
                    mock.call('mkfs', '-t', 'msdos', '-n', 'msdos-vol',
                              '/my/msdos/block/dev', run_as_root=True,
                              use_standard_locale=True),
                    mock.call('mkswap', '-L', 'swap-vol',
                              '/my/swap/block/dev', run_as_root=True,
                              use_standard_locale=True)]
        self.assertEqual(expected, execute_mock.call_args_list)