Exemple #1
0
 def test_subvolume_sync_fail_parameters(self):
     '''
     Test btrfs subvolume sync
     '''
     # Fails when subvolids is not a list
     with pytest.raises(CommandExecutionError):
         btrfs.subvolume_sync('/mnt', subvolids='257')
Exemple #2
0
 def test_subvolume_sync_fail_parameters(self):
     """
     Test btrfs subvolume sync
     """
     # Fails when subvolids is not a list
     with pytest.raises(CommandExecutionError):
         btrfs.subvolume_sync("/mnt", subvolids="257")
Exemple #3
0
 def test_subvolume_sync(self):
     '''
     Test btrfs subvolume sync
     '''
     salt_mock = {
         'cmd.run_all': MagicMock(return_value={'recode': 0}),
     }
     with patch.dict(btrfs.__salt__, salt_mock):
         assert btrfs.subvolume_sync('/mnt', subvolids=['257'], sleep='1')
         salt_mock['cmd.run_all'].assert_called_once()
         salt_mock['cmd.run_all'].assert_called_with(
             ['btrfs', 'subvolume', 'sync', '-s', '1', '/mnt', '257'])
Exemple #4
0
 def test_subvolume_sync(self):
     """
     Test btrfs subvolume sync
     """
     salt_mock = {
         "cmd.run_all": MagicMock(return_value={"recode": 0}),
     }
     with patch.dict(btrfs.__salt__, salt_mock):
         assert btrfs.subvolume_sync("/mnt", subvolids=["257"], sleep="1")
         salt_mock["cmd.run_all"].assert_called_once()
         salt_mock["cmd.run_all"].assert_called_with(
             ["btrfs", "subvolume", "sync", "-s", "1", "/mnt", "257"])
Exemple #5
0
                    'top level id': '256',
                    'flags': '-',
                    'snapshot(s)': '',
                },
            }
            salt_mock['cmd.run_all'].assert_called_once()
            salt_mock['cmd.run_all'].assert_called_with(
                ['btrfs', 'subvolume', 'show', '/var'])

    def test_subvolume_sync_fail_parameters(self):
        '''
        Test btrfs subvolume sync
        '''
        # Fails when subvolids is not a list
        with pytest.raises(CommandExecutionError):
            btrfs.subvolume_sync('/mnt', subvolids='257')

    def test_subvolume_sync(self):
        '''
        Test btrfs subvolume sync
        '''
        salt_mock = {
            'cmd.run_all': MagicMock(return_value={'recode': 0}),
        }
        with patch.dict(btrfs.__salt__, salt_mock):
            assert btrfs.subvolume_sync('/mnt', subvolids=['257'],
                                        sleep='1')
            salt_mock['cmd.run_all'].assert_called_once()
            salt_mock['cmd.run_all'].assert_called_with(
                ['btrfs', 'subvolume', 'sync', '-s', '1', '/mnt', '257'])