Esempio n. 1
0
    def test_quobyte_umount_volume_fails(self, mock_execute, mock_exception):
        mnt_base = "/mnt"
        quobyte_volume = "192.168.1.1/volume-00001"
        export_mnt_base = os.path.join(mnt_base, utils.get_hash_str(quobyte_volume))

        quobyte.umount_volume(export_mnt_base)

        (mock_exception.assert_called_once_with("Couldn't unmount " "the Quobyte Volume at %s", export_mnt_base))
Esempio n. 2
0
    def test_quobyte_umount_volume(self, mock_execute):
        mnt_base = "/mnt"
        quobyte_volume = "192.168.1.1/volume-00001"
        export_mnt_base = os.path.join(mnt_base, utils.get_hash_str(quobyte_volume))

        quobyte.umount_volume(export_mnt_base)

        mock_execute.assert_called_once_with("umount.quobyte", export_mnt_base)
Esempio n. 3
0
    def test_quobyte_umount_volume(self, mock_execute):
        mnt_base = '/mnt'
        quobyte_volume = '192.168.1.1/volume-00001'
        export_mnt_base = os.path.join(mnt_base,
                                       utils.get_hash_str(quobyte_volume))

        quobyte.umount_volume(export_mnt_base)

        mock_execute.assert_called_once_with('umount.quobyte', export_mnt_base)
Esempio n. 4
0
    def test_quobyte_umount_volume_fails(self, mock_execute, mock_exception):
        mnt_base = '/mnt'
        quobyte_volume = '192.168.1.1/volume-00001'
        export_mnt_base = os.path.join(mnt_base,
                                       utils.get_hash_str(quobyte_volume))

        quobyte.umount_volume(export_mnt_base)

        (mock_exception.assert_called_once_with(
            "Couldn't unmount "
            "the Quobyte Volume at %s", export_mnt_base))
Esempio n. 5
0
    def test_quobyte_umount_volume_warns(self, mock_execute, mock_debug):
        mnt_base = "/mnt"
        quobyte_volume = "192.168.1.1/volume-00001"
        export_mnt_base = os.path.join(mnt_base, utils.get_hash_str(quobyte_volume))

        def exec_side_effect(*cmd, **kwargs):
            exerror = processutils.ProcessExecutionError()
            exerror.message = "Device or resource busy"
            raise exerror

        mock_execute.side_effect = exec_side_effect

        quobyte.umount_volume(export_mnt_base)

        (mock_debug.assert_called_once_with("The Quobyte volume at %s is still in use.", export_mnt_base))
Esempio n. 6
0
    def test_quobyte_umount_volume_warns(self, mock_execute, mock_debug):
        mnt_base = '/mnt'
        quobyte_volume = '192.168.1.1/volume-00001'
        export_mnt_base = os.path.join(mnt_base,
                                       utils.get_hash_str(quobyte_volume))

        def exec_side_effect(*cmd, **kwargs):
            exerror = processutils.ProcessExecutionError()
            exerror.message = "Device or resource busy"
            raise exerror

        mock_execute.side_effect = exec_side_effect

        quobyte.umount_volume(export_mnt_base)

        (mock_debug.assert_called_once_with(
            "The Quobyte volume at %s is still in use.", export_mnt_base))