# Path: os_brick/exception.py
# LOG = logging.getLogger(__name__)
# class BrickException(Exception):
# class NotFound(BrickException):
# class Invalid(BrickException):
# class InvalidParameterValue(Invalid):
# class NoFibreChannelHostsFound(BrickException):
# class NoFibreChannelVolumeDeviceFound(BrickException):
# class VolumeNotDeactivated(BrickException):
# class VolumeDeviceNotFound(BrickException):
# class VolumePathsNotFound(BrickException):
# class VolumePathNotRemoved(BrickException):
# class ProtocolNotSupported(BrickException):
# class TargetPortalNotFound(BrickException):
# class TargetPortalsNotFound(TargetPortalNotFound):
# class FailedISCSITargetPortalLogin(BrickException):
# class BlockDeviceReadOnly(BrickException):
# class VolumeGroupNotFound(BrickException):
# class VolumeGroupCreationFailed(BrickException):
# class CommandExecutionFailed(BrickException):
# class VolumeDriverException(BrickException):
# class InvalidIOHandleObject(BrickException):
# class VolumeEncryptionNotSupported(Invalid):
# class VolumeLocalCacheNotSupported(Invalid):
# class InvalidConnectorProtocol(ValueError):
# class ExceptionChainer(BrickException):
# class ExecutionTimeout(putils.ProcessExecutionError):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __nonzero__(self) -> bool:
#     def add_exception(self, exc_type, exc_val, exc_tb) -> None:
#     def context(self,
#                 catch_exception: bool,
#                 msg: str = '',
#                 *msg_args: Iterable):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# 
# Path: os_brick/initiator/linuxrbd.py
# LOG = logging.getLogger(__name__)
# class RBDClient(object):
# class RBDVolume(object):
# class RBDImageMetadata(object):
# class RBDVolumeIOWrapper(io.RawIOBase):
#     def __init__(self, user, pool, *args, **kwargs):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def connect(self):
#     def disconnect(self):
#     def __init__(self, client, name, snapshot=None, read_only=False):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __getattr__(self, attrib):
#     def __init__(self, image, pool, user, conf):
#     def __init__(self, rbd_volume):
#     def _inc_offset(self, length):
#     def rbd_image(self):
#     def rbd_user(self):
#     def rbd_pool(self):
#     def rbd_conf(self):
#     def read(self, length=None):
#     def write(self, data):
#     def seekable(self):
#     def seek(self, offset, whence=0):
#     def tell(self):
#     def flush(self):
#     def fileno(self):
#     def close(self):
# 
# Path: os_brick/tests/base.py
# class TestCase(testtools.TestCase):
#     SENTINEL = object()
#     def setUp(self):
#     def _common_cleanup(self):
#     def log_level(self, level):
#     def mock_object(self, obj, attr_name, new_attr=SENTINEL, **kwargs):
#     def patch(self, path, *args, **kwargs):
# 
# Path: os_brick/utils.py
# def _sleep(secs: float) -> None:
#     def __init__(self, codes: Union[int, Tuple[int, ...]]):
#     def _check_exit_code(self, exc: Type[Exception]) -> bool:
# def retry(retry_param: Union[None,
#                              Type[Exception],
#                              Tuple[Type[Exception], ...],
#                              int,
#                              Tuple[int, ...]],
#           interval: float = 1,
#           retries: int = 3,
#           backoff_rate: float = 2,
#           retry: Callable = tenacity.retry_if_exception_type) -> Callable:
#     def _decorator(f):
#         def _wrapper(*args, **kwargs):
# def platform_matches(current_platform: str, connector_platform: str) -> bool:
# def os_matches(current_os: str, connector_os: str) -> bool:
# def merge_dict(dict1: dict, dict2: dict) -> dict:
# def trace(f: Callable) -> Callable:
#     def trace_logging_wrapper(*args, **kwargs):
# def convert_str(text: Union[bytes, str]) -> str:
# def get_host_nqn():
# LOG = logging.getLogger(__name__)
# class retry_if_exit_code(tenacity.retry_if_exception):


from unittest import mock
from os_brick import exception
from os_brick.initiator import linuxrbd
from os_brick.tests import base
from os_brick import utils
        def __enter__(self, *args, **kwargs):
            return self

        def __exit__(self, *args, **kwargs):
            return False

        def close(self, *args, **kwargs):
            pass

    class Rados(object):

        def __init__(self, *args, **kwargs):
            pass

        def __enter__(self, *args, **kwargs):
            return self

        def __exit__(self, *args, **kwargs):
            return False

        def connect(self, *args, **kwargs):
            pass

        def open_ioctx(self, *args, **kwargs):
            return MockRados.ioctx()

        def shutdown(self, *args, **kwargs):
            pass



# Path: os_brick/exception.py
# LOG = logging.getLogger(__name__)
# class BrickException(Exception):
# class NotFound(BrickException):
# class Invalid(BrickException):
# class InvalidParameterValue(Invalid):
# class NoFibreChannelHostsFound(BrickException):
# class NoFibreChannelVolumeDeviceFound(BrickException):
# class VolumeNotDeactivated(BrickException):
# class VolumeDeviceNotFound(BrickException):
# class VolumePathsNotFound(BrickException):
# class VolumePathNotRemoved(BrickException):
# class ProtocolNotSupported(BrickException):
# class TargetPortalNotFound(BrickException):
# class TargetPortalsNotFound(TargetPortalNotFound):
# class FailedISCSITargetPortalLogin(BrickException):
# class BlockDeviceReadOnly(BrickException):
# class VolumeGroupNotFound(BrickException):
# class VolumeGroupCreationFailed(BrickException):
# class CommandExecutionFailed(BrickException):
# class VolumeDriverException(BrickException):
# class InvalidIOHandleObject(BrickException):
# class VolumeEncryptionNotSupported(Invalid):
# class VolumeLocalCacheNotSupported(Invalid):
# class InvalidConnectorProtocol(ValueError):
# class ExceptionChainer(BrickException):
# class ExecutionTimeout(putils.ProcessExecutionError):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __nonzero__(self) -> bool:
#     def add_exception(self, exc_type, exc_val, exc_tb) -> None:
#     def context(self,
#                 catch_exception: bool,
#                 msg: str = '',
#                 *msg_args: Iterable):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# 
# Path: os_brick/initiator/linuxrbd.py
# LOG = logging.getLogger(__name__)
# class RBDClient(object):
# class RBDVolume(object):
# class RBDImageMetadata(object):
# class RBDVolumeIOWrapper(io.RawIOBase):
#     def __init__(self, user, pool, *args, **kwargs):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def connect(self):
#     def disconnect(self):
#     def __init__(self, client, name, snapshot=None, read_only=False):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __getattr__(self, attrib):
#     def __init__(self, image, pool, user, conf):
#     def __init__(self, rbd_volume):
#     def _inc_offset(self, length):
#     def rbd_image(self):
#     def rbd_user(self):
#     def rbd_pool(self):
#     def rbd_conf(self):
#     def read(self, length=None):
#     def write(self, data):
#     def seekable(self):
#     def seek(self, offset, whence=0):
#     def tell(self):
#     def flush(self):
#     def fileno(self):
#     def close(self):
# 
# Path: os_brick/tests/base.py
# class TestCase(testtools.TestCase):
#     SENTINEL = object()
#     def setUp(self):
#     def _common_cleanup(self):
#     def log_level(self, level):
#     def mock_object(self, obj, attr_name, new_attr=SENTINEL, **kwargs):
#     def patch(self, path, *args, **kwargs):
# 
# Path: os_brick/utils.py
# def _sleep(secs: float) -> None:
#     def __init__(self, codes: Union[int, Tuple[int, ...]]):
#     def _check_exit_code(self, exc: Type[Exception]) -> bool:
# def retry(retry_param: Union[None,
#                              Type[Exception],
#                              Tuple[Type[Exception], ...],
#                              int,
#                              Tuple[int, ...]],
#           interval: float = 1,
#           retries: int = 3,
#           backoff_rate: float = 2,
#           retry: Callable = tenacity.retry_if_exception_type) -> Callable:
#     def _decorator(f):
#         def _wrapper(*args, **kwargs):
# def platform_matches(current_platform: str, connector_platform: str) -> bool:
# def os_matches(current_os: str, connector_os: str) -> bool:
# def merge_dict(dict1: dict, dict2: dict) -> dict:
# def trace(f: Callable) -> Callable:
#     def trace_logging_wrapper(*args, **kwargs):
# def convert_str(text: Union[bytes, str]) -> str:
# def get_host_nqn():
# LOG = logging.getLogger(__name__)
# class retry_if_exit_code(tenacity.retry_if_exception):


# Path: os_brick/tests/initiator/test_linuxrbd.py
from unittest import mock
from os_brick import exception
from os_brick.initiator import linuxrbd
from os_brick.tests import base
from os_brick import utils

        def __enter__(self, *args, **kwargs):
            return self

        def __exit__(self, *args, **kwargs):
            return False

        def close(self, *args, **kwargs):
            pass

    class Rados(object):

        def __init__(self, *args, **kwargs):
            pass

        def __enter__(self, *args, **kwargs):
            return self

        def __exit__(self, *args, **kwargs):
            return False

        def connect(self, *args, **kwargs):
            pass

        def open_ioctx(self, *args, **kwargs):
            return MockRados.ioctx()

        def shutdown(self, *args, **kwargs):
            pass



class RBDClientTestCase(base.TestCase):