# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
-extension-pkg-whitelist=
+extension-pkg-whitelist=rados,rbd
# Add files or directories to the blacklist. They should be base names, not
# paths.
import logging
import sys
# pylint: disable=W0403
- from . import ceph_module_mock
+ from .cephmock import ceph_module_mock, rados_mock, rbd_mock
sys.modules['ceph_module'] = ceph_module_mock
+ sys.modules['rados'] = rados_mock
+ sys.modules['rbd'] = rbd_mock
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
logging.root.handlers[0].setLevel(logging.WARNING)
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-
-class BasePyOSDMap(object):
- pass
-
-
-class BasePyOSDMapIncremental(object):
- pass
-
-
-class BasePyCRUSH(object):
- pass
-
-
-class BaseMgrStandbyModule(object):
- pass
-
-
-class BaseMgrModule(object):
- # pylint: disable=W0613
- def __init__(self, py_modules_ptr, this_ptr):
- self.config_key_map = {}
-
- def _ceph_get_version(self):
- return 'ceph-13.0.0'
-
- def _ceph_get_mgr_id(self):
- return 'x'
-
- def _ceph_set_config(self, key, value):
- self.config_key_map[key] = value
-
- def _ceph_get_config(self, key):
- return self.config_key_map.get(key, None)
-
- def _ceph_log(self, *args):
- pass
--- /dev/null
+# -*- coding: utf-8 -*-
+
+
+class BasePyOSDMap(object):
+ pass
+
+
+class BasePyOSDMapIncremental(object):
+ pass
+
+
+class BasePyCRUSH(object):
+ pass
+
+
+class BaseMgrStandbyModule(object):
+ pass
+
+
+class BaseMgrModule(object):
+ # pylint: disable=W0613
+ def __init__(self, py_modules_ptr, this_ptr):
+ self.config_key_map = {}
+
+ def _ceph_get_version(self):
+ return 'ceph-13.0.0'
+
+ def _ceph_get_mgr_id(self):
+ return 'x'
+
+ def _ceph_set_config(self, key, value):
+ self.config_key_map[key] = value
+
+ def _ceph_get_config(self, key):
+ return self.config_key_map.get(key, None)
+
+ def _ceph_log(self, *args):
+ pass
+
+ def _ceph_get_context(self):
+ return None
--- /dev/null
+# -*- coding: utf-8 -*-
+
+
+class Rados(object):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def connect(self):
+ pass
+
+ def open_ioctx(self, pool_name):
+ pass
--- /dev/null
+# -*- coding: utf-8 -*-
+
+
+RBD_FEATURE_LAYERING = "RBD_FEATURE_LAYERING"
+RBD_FEATURE_STRIPINGV2 = "RBD_FEATURE_STRIPINGV2"
+RBD_FEATURE_EXCLUSIVE_LOCK = "RBD_FEATURE_EXCLUSIVE_LOCK"
+RBD_FEATURE_OBJECT_MAP = "RBD_FEATURE_OBJECT_MAP"
+RBD_FEATURE_FAST_DIFF = "RBD_FEATURE_FAST_DIFF"
+RBD_FEATURE_DEEP_FLATTEN = "RBD_FEATURE_DEEP_FLATTEN"
+RBD_FEATURE_JOURNALING = "RBD_FEATURE_JOURNALING"
+RBD_FEATURE_DATA_POOL = "RBD_FEATURE_DATA_POOL"
+RBD_FEATURE_OPERATIONS = "RBD_FEATURE_OPERATIONS"
+
+
+class RBD(object):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def list(self, ioctx):
+ pass
+
+
+class Image(object):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def stat(self):
+ pass
+
+ def features(self):
+ pass
UNITTEST=true
WEBTEST_INTERACTIVE=false
COVERAGE_FILE= .coverage.{envname}
+ PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3:{toxinidir}/../../../../build/lib/cython_modules/lib.2
+ LD_LIBRARY_PATH = {toxinidir}/../../../../build/lib
commands=
{envbindir}/py.test --cov=. --cov-report= --junitxml=junit.{envname}.xml tests/
coverage xml
[testenv:lint]
+setenv =
+ PYTHONPATH = {toxinidir}/../../../../build/lib/cython_modules/lib.3:{toxinidir}/../../../../build/lib/cython_modules/lib.2
+ LD_LIBRARY_PATH = {toxinidir}/../../../../build/lib
deps=-r{toxinidir}/requirements.txt
commands=
- pylint --rcfile=.pylintrc --jobs=5 . module.py tools.py ceph_module_mock.py controllers tests
+ pylint --rcfile=.pylintrc --jobs=5 . module.py tools.py controllers tests cephmock
pycodestyle --max-line-length=100 --exclude=python2.7,.tox,venv,frontend .