diff options
Diffstat (limited to 'moonv4')
-rw-r--r-- | moonv4/moon_utilities/README.md | 33 | ||||
-rw-r--r-- | moonv4/python_moondb/Changelog (renamed from moonv4/moon_db/Changelog) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/LICENSE (renamed from moonv4/moon_db/LICENSE) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/MANIFEST.in (renamed from moonv4/moon_db/MANIFEST.in) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/README.md (renamed from moonv4/moon_db/README.md) | 16 | ||||
-rw-r--r-- | moonv4/python_moondb/bin/drop_tables.sql (renamed from moonv4/moon_db/bin/drop_tables.sql) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/build.sh (renamed from moonv4/moon_db/build.sh) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/__init__.py (renamed from moonv4/moon_db/moon_db/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/__init__.py (renamed from moonv4/moon_db/moon_db/api/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/keystone.py (renamed from moonv4/moon_db/moon_db/api/keystone.py) | 4 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/managers.py (renamed from moonv4/moon_db/moon_db/api/managers.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/model.py (renamed from moonv4/moon_db/moon_db/api/model.py) | 6 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/pdp.py (renamed from moonv4/moon_db/moon_db/api/pdp.py) | 4 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/api/policy.py (renamed from moonv4/moon_db/moon_db/api/policy.py) | 4 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/backends/__init__.py (renamed from moonv4/moon_db/moon_db/backends/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/backends/flat.py (renamed from moonv4/moon_db/moon_db/backends/flat.py) | 2 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/backends/sql.py (renamed from moonv4/moon_db/moon_db/backends/sql.py) | 7 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/core.py (renamed from moonv4/moon_db/moon_db/core.py) | 4 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/db_manager.py (renamed from moonv4/moon_db/moon_db/db_manager.py) | 4 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/migrate_repo/__init__.py (renamed from moonv4/moon_db/moon_db/migrate_repo/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/migrate_repo/versions/001_moon.py (renamed from moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/python_moondb/migrate_repo/versions/__init__.py (renamed from moonv4/moon_db/moon_db/migrate_repo/versions/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/requirements.txt (renamed from moonv4/moon_db/requirements.txt) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/setup.py (renamed from moonv4/moon_db/setup.py) | 12 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/conftest.py (renamed from moonv4/moon_db/tests/unit_python/conftest.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/mock_components.py (renamed from moonv4/moon_db/tests/unit_python/mock_components.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/mock_keystone.py (renamed from moonv4/moon_db/tests/unit_python/mock_keystone.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/requirements.txt (renamed from moonv4/moon_db/tests/unit_python/requirements.txt) | 2 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/test_policies.py (renamed from moonv4/moon_db/tests/unit_python/test_policies.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moondb/tests/unit_python/utilities.py (renamed from moonv4/moon_db/tests/unit_python/utilities.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/Changelog (renamed from moonv4/moon_utilities/Changelog) | 1 | ||||
-rw-r--r-- | moonv4/python_moonutilities/LICENSE (renamed from moonv4/moon_utilities/LICENSE) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/MANIFEST.in (renamed from moonv4/moon_utilities/MANIFEST.in) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/README.md | 33 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/__init__.py (renamed from moonv4/moon_utilities/moon_utilities/__init__.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/api.py (renamed from moonv4/moon_utilities/moon_utilities/api.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/auth.py (renamed from moonv4/moon_utilities/moon_utilities/auth.py) | 2 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/cache.py (renamed from moonv4/moon_utilities/moon_utilities/cache.py) | 2 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/configuration.py (renamed from moonv4/moon_utilities/moon_utilities/configuration.py) | 2 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/exceptions.py (renamed from moonv4/moon_utilities/moon_utilities/exceptions.py) | 1 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/misc.py (renamed from moonv4/moon_utilities/moon_utilities/misc.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/python_moonutilities/security_functions.py (renamed from moonv4/moon_utilities/moon_utilities/security_functions.py) | 3 | ||||
-rw-r--r-- | moonv4/python_moonutilities/requirements.txt (renamed from moonv4/moon_utilities/requirements.txt) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/setup.py (renamed from moonv4/moon_utilities/setup.py) | 6 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/conftest.py (renamed from moonv4/moon_utilities/tests/unit_python/conftest.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/mock_cache.py (renamed from moonv4/moon_utilities/tests/unit_python/mock_cache.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/mock_components.py (renamed from moonv4/moon_utilities/tests/unit_python/mock_components.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/mock_keystone.py (renamed from moonv4/moon_utilities/tests/unit_python/mock_keystone.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/requirements.txt (renamed from moonv4/moon_utilities/tests/unit_python/requirements.txt) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/test_cache.py (renamed from moonv4/moon_utilities/tests/unit_python/test_cache.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/test_configuration.py (renamed from moonv4/moon_utilities/tests/unit_python/test_configuration.py) | 0 | ||||
-rw-r--r-- | moonv4/python_moonutilities/tests/unit_python/utilities.py (renamed from moonv4/moon_utilities/tests/unit_python/utilities.py) | 0 | ||||
-rw-r--r-- | moonv4/tests/performance/README.md | 69 |
53 files changed, 142 insertions, 75 deletions
diff --git a/moonv4/moon_utilities/README.md b/moonv4/moon_utilities/README.md deleted file mode 100644 index bbc1d458..00000000 --- a/moonv4/moon_utilities/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Moon Python Utilities Package -This package contains the core module for the Moon project. -It is designed to provide authorization feature to all OpenStack components. - -For any other information, refer to the parent project: - - https://git.opnfv.org/moon - -moon_utilities is a common Python lib for other Moon Python packages - -## Build -### Build Python Package -```bash -cd ${MOON_HOME}/moonv4/moon_utilities -python3 setup.py sdist bdist_wheel -``` - -### Push Python Package to PIP -```bash -cd ${MOON_HOME}/moonv4/moon_utilities -gpg --detach-sign -u "${GPG_ID}" -a dist/moon_utilities-X.Y.Z-py3-none-any.whl -gpg --detach-sign -u "${GPG_ID}" -a dist/moon_utilities-X.Y.Z.tar.gz -twine upload dist/moon_db-X.Y.Z-py3-none-any.whl dist/moon_utilities-X.Y.Z-py3-none-any.whl.asc -twine upload dist/moon_db-X.Y.Z.tar.gz dist/moon_uutilities-X.Y.Z.tar.gz.asc -``` - -## Test -### Python Unit Test -launch Docker for Python unit tests -```bash -cd ${MOON_HOME}/moonv4/moon_utilities -docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest -``` diff --git a/moonv4/moon_db/Changelog b/moonv4/python_moondb/Changelog index de04eadc..de04eadc 100644 --- a/moonv4/moon_db/Changelog +++ b/moonv4/python_moondb/Changelog diff --git a/moonv4/moon_db/LICENSE b/moonv4/python_moondb/LICENSE index d6456956..d6456956 100644 --- a/moonv4/moon_db/LICENSE +++ b/moonv4/python_moondb/LICENSE diff --git a/moonv4/moon_db/MANIFEST.in b/moonv4/python_moondb/MANIFEST.in index 82b40140..82b40140 100644 --- a/moonv4/moon_db/MANIFEST.in +++ b/moonv4/python_moondb/MANIFEST.in diff --git a/moonv4/moon_db/README.md b/moonv4/python_moondb/README.md index 5aa877fc..d36c6ae3 100644 --- a/moonv4/moon_db/README.md +++ b/moonv4/python_moondb/README.md @@ -1,4 +1,4 @@ -# moon_db +# python_moondb This package contains the database module for the Moon project It is designed to provide a driver to access the Moon database. @@ -10,23 +10,23 @@ For any other information, refer to the parent project: ## Build ### Build Python Package ```bash -cd ${MOON_HOME}/moonv4/moon_db +cd ${MOON_HOME}/python_moondb python3 setup.py sdist bdist_wheel ``` ### Push Python Package to PIP ```bash -cd ${MOON_HOME}/moonv4/moon_db -gpg --detach-sign -u "${GPG_ID}" -a dist/moon_db-X.Y.Z-py3-none-any.whl -gpg --detach-sign -u "${GPG_ID}" -a dist/moon_db-X.Y.Z.tar.gz -twine upload dist/moon_db-X.Y.Z-py3-none-any.whl dist/moon_db-X.Y.Z-py3-none-any.whl.asc -twine upload dist/moon_db-X.Y.Z.tar.gz dist/moon_db-X.Y.Z.tar.gz.asc +cd ${MOON_HOME}/python_moondb +gpg --detach-sign -u "${GPG_ID}" -a dist/python_moondb-X.Y.Z-py3-none-any.whl +gpg --detach-sign -u "${GPG_ID}" -a dist/python_moondb-X.Y.Z.tar.gz +twine upload dist/python_moondb-X.Y.Z-py3-none-any.whl dist/python_moondb-X.Y.Z-py3-none-any.whl.asc +twine upload dist/python_moondb-X.Y.Z.tar.gz dist/python_moondb-X.Y.Z.tar.gz.asc ``` ## Test ### Python Unit Test launch Docker for Python unit tests ```bash -cd ${MOON_HOME}/moonv4/moon_db +cd ${MOON_HOME}/python_moondb docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest ```
\ No newline at end of file diff --git a/moonv4/moon_db/bin/drop_tables.sql b/moonv4/python_moondb/bin/drop_tables.sql index f5f65ea7..f5f65ea7 100644 --- a/moonv4/moon_db/bin/drop_tables.sql +++ b/moonv4/python_moondb/bin/drop_tables.sql diff --git a/moonv4/moon_db/build.sh b/moonv4/python_moondb/build.sh index f109e9b8..f109e9b8 100644 --- a/moonv4/moon_db/build.sh +++ b/moonv4/python_moondb/build.sh diff --git a/moonv4/moon_db/moon_db/__init__.py b/moonv4/python_moondb/python_moondb/__init__.py index 0be29aa0..0be29aa0 100644 --- a/moonv4/moon_db/moon_db/__init__.py +++ b/moonv4/python_moondb/python_moondb/__init__.py diff --git a/moonv4/moon_db/moon_db/api/__init__.py b/moonv4/python_moondb/python_moondb/api/__init__.py index e69de29b..e69de29b 100644 --- a/moonv4/moon_db/moon_db/api/__init__.py +++ b/moonv4/python_moondb/python_moondb/api/__init__.py diff --git a/moonv4/moon_db/moon_db/api/keystone.py b/moonv4/python_moondb/python_moondb/api/keystone.py index b570918c..906ab788 100644 --- a/moonv4/moon_db/moon_db/api/keystone.py +++ b/moonv4/python_moondb/python_moondb/api/keystone.py @@ -9,8 +9,8 @@ import json from uuid import uuid4 from oslo_log import log as logging from moon_utilities import exceptions, configuration -from moon_db.api.managers import Managers -from moon_utilities.security_functions import filter_input, login, logout +from python_moonutilities.security_functions import filter_input, login, logout +from python_moondb.api.managers import Managers LOG = logging.getLogger("moon.db.api.keystone") diff --git a/moonv4/moon_db/moon_db/api/managers.py b/moonv4/python_moondb/python_moondb/api/managers.py index 602e0f11..602e0f11 100644 --- a/moonv4/moon_db/moon_db/api/managers.py +++ b/moonv4/python_moondb/python_moondb/api/managers.py diff --git a/moonv4/moon_db/moon_db/api/model.py b/moonv4/python_moondb/python_moondb/api/model.py index f648295e..fbfbb680 100644 --- a/moonv4/moon_db/moon_db/api/model.py +++ b/moonv4/python_moondb/python_moondb/api/model.py @@ -5,9 +5,9 @@ from uuid import uuid4 from oslo_log import log as logging -from moon_utilities import exceptions -from moon_utilities.security_functions import filter_input, enforce -from moon_db.api.managers import Managers +from python_moonutilities import exceptions +from python_moonutilities.security_functions import filter_input, enforce +from python_moondb.api.managers import Managers LOG = logging.getLogger("moon.db.api.model") diff --git a/moonv4/moon_db/moon_db/api/pdp.py b/moonv4/python_moondb/python_moondb/api/pdp.py index 05eb163f..5fb7aa78 100644 --- a/moonv4/moon_db/moon_db/api/pdp.py +++ b/moonv4/python_moondb/python_moondb/api/pdp.py @@ -5,8 +5,8 @@ from uuid import uuid4 from oslo_log import log as logging -from moon_utilities.security_functions import filter_input, enforce -from moon_db.api.managers import Managers +from python_moonutilities.security_functions import filter_input, enforce +from python_moondb.api.managers import Managers LOG = logging.getLogger("moon.db.api.pdp") diff --git a/moonv4/moon_db/moon_db/api/policy.py b/moonv4/python_moondb/python_moondb/api/policy.py index 272872ad..81689826 100644 --- a/moonv4/moon_db/moon_db/api/policy.py +++ b/moonv4/python_moondb/python_moondb/api/policy.py @@ -5,8 +5,8 @@ from uuid import uuid4 import logging -from moon_utilities.security_functions import enforce -from moon_db.api.managers import Managers +from python_moonutilities.security_functions import enforce +from python_moondb.api.managers import Managers LOG = logging.getLogger("moon.db.api.policy") diff --git a/moonv4/moon_db/moon_db/backends/__init__.py b/moonv4/python_moondb/python_moondb/backends/__init__.py index 237bdc3e..237bdc3e 100644 --- a/moonv4/moon_db/moon_db/backends/__init__.py +++ b/moonv4/python_moondb/python_moondb/backends/__init__.py diff --git a/moonv4/moon_db/moon_db/backends/flat.py b/moonv4/python_moondb/python_moondb/backends/flat.py index 820a4146..0fe2f00b 100644 --- a/moonv4/moon_db/moon_db/backends/flat.py +++ b/moonv4/python_moondb/python_moondb/backends/flat.py @@ -5,7 +5,7 @@ import logging import time -from moon_db.core import LogDriver +from python_moondb.core import LogDriver class LogConnector(LogDriver): diff --git a/moonv4/moon_db/moon_db/backends/sql.py b/moonv4/python_moondb/python_moondb/backends/sql.py index 78de468f..5dba8eb2 100644 --- a/moonv4/moon_db/moon_db/backends/sql.py +++ b/moonv4/python_moondb/python_moondb/backends/sql.py @@ -6,8 +6,6 @@ import copy import json from uuid import uuid4 -from moon_utilities.exceptions import * -from moon_db.core import PDPDriver, PolicyDriver, ModelDriver import sqlalchemy as sql import logging from sqlalchemy.orm import sessionmaker @@ -15,8 +13,9 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine from contextlib import contextmanager from sqlalchemy import types as sql_types -from moon_utilities import configuration - +from python_moonutilities import configuration +from python_moonutilities.exceptions import * +from python_moondb.core import PDPDriver, PolicyDriver, ModelDriver LOG = logging.getLogger("moon.db.driver.sql") Base = declarative_base() diff --git a/moonv4/moon_db/moon_db/core.py b/moonv4/python_moondb/python_moondb/core.py index 069f2533..49e9f711 100644 --- a/moonv4/moon_db/moon_db/core.py +++ b/moonv4/python_moondb/python_moondb/core.py @@ -6,8 +6,8 @@ from oslo_log import log as logging from oslo_config import cfg from stevedore.driver import DriverManager -from moon_utilities import configuration -from moon_db.api import model, policy, pdp, keystone +from python_moonutilities import configuration +from python_moondb.api import model, policy, pdp, keystone CONF = cfg.CONF LOG = logging.getLogger("moon.db") diff --git a/moonv4/moon_db/moon_db/db_manager.py b/moonv4/python_moondb/python_moondb/db_manager.py index 75cbcdb0..c305284d 100644 --- a/moonv4/moon_db/moon_db/db_manager.py +++ b/moonv4/python_moondb/python_moondb/db_manager.py @@ -11,8 +11,8 @@ import importlib import argparse import logging from sqlalchemy import create_engine -from moon_db.migrate_repo import versions -from moon_utilities import configuration +from python_moonutilities import configuration +from python_moondb.migrate_repo import versions def init_args(): diff --git a/moonv4/moon_db/moon_db/migrate_repo/__init__.py b/moonv4/python_moondb/python_moondb/migrate_repo/__init__.py index e69de29b..e69de29b 100644 --- a/moonv4/moon_db/moon_db/migrate_repo/__init__.py +++ b/moonv4/python_moondb/python_moondb/migrate_repo/__init__.py diff --git a/moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py b/moonv4/python_moondb/python_moondb/migrate_repo/versions/001_moon.py index 2cc36140..2cc36140 100644 --- a/moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py +++ b/moonv4/python_moondb/python_moondb/migrate_repo/versions/001_moon.py diff --git a/moonv4/moon_db/moon_db/migrate_repo/versions/__init__.py b/moonv4/python_moondb/python_moondb/migrate_repo/versions/__init__.py index e69de29b..e69de29b 100644 --- a/moonv4/moon_db/moon_db/migrate_repo/versions/__init__.py +++ b/moonv4/python_moondb/python_moondb/migrate_repo/versions/__init__.py diff --git a/moonv4/moon_db/requirements.txt b/moonv4/python_moondb/requirements.txt index 03afc879..03afc879 100644 --- a/moonv4/moon_db/requirements.txt +++ b/moonv4/python_moondb/requirements.txt diff --git a/moonv4/moon_db/setup.py b/moonv4/python_moondb/setup.py index 0cd90940..65687c3f 100644 --- a/moonv4/moon_db/setup.py +++ b/moonv4/python_moondb/setup.py @@ -4,7 +4,7 @@ # or at 'http://www.apache.org/licenses/LICENSE-2.0'. from setuptools import setup, find_packages -import moon_db +import python_moondb with open('requirements.txt') as f: @@ -12,9 +12,9 @@ with open('requirements.txt') as f: setup( - name='moon_db', + name='python-moondb', - version=moon_db.__version__, + version=python_moondb.__version__, packages=find_packages(), @@ -44,11 +44,11 @@ setup( entry_points={ "moon_db.driver": [ - "sql = moon_db.backends.sql:SQLConnector", - "flat = moon_db.backends.flat:LogConnector", + "sql = python_moondb.backends.sql:SQLConnector", + "flat = python_moondb.backends.flat:LogConnector", ], 'console_scripts': [ - 'moon_db_manager = moon_db.db_manager:run', + 'moon_db_manager = python_moondb.db_manager:run', ], } diff --git a/moonv4/moon_db/tests/unit_python/conftest.py b/moonv4/python_moondb/tests/unit_python/conftest.py index c2e5e579..c2e5e579 100644 --- a/moonv4/moon_db/tests/unit_python/conftest.py +++ b/moonv4/python_moondb/tests/unit_python/conftest.py diff --git a/moonv4/moon_db/tests/unit_python/mock_components.py b/moonv4/python_moondb/tests/unit_python/mock_components.py index a0319e1a..a0319e1a 100644 --- a/moonv4/moon_db/tests/unit_python/mock_components.py +++ b/moonv4/python_moondb/tests/unit_python/mock_components.py diff --git a/moonv4/moon_db/tests/unit_python/mock_keystone.py b/moonv4/python_moondb/tests/unit_python/mock_keystone.py index c0b26b88..c0b26b88 100644 --- a/moonv4/moon_db/tests/unit_python/mock_keystone.py +++ b/moonv4/python_moondb/tests/unit_python/mock_keystone.py diff --git a/moonv4/moon_db/tests/unit_python/requirements.txt b/moonv4/python_moondb/tests/unit_python/requirements.txt index d6110d12..5f507ff7 100644 --- a/moonv4/moon_db/tests/unit_python/requirements.txt +++ b/moonv4/python_moondb/tests/unit_python/requirements.txt @@ -2,4 +2,4 @@ sqlalchemy pymysql pytest requests_mock -moon_utilities
\ No newline at end of file +python_moonutilities
\ No newline at end of file diff --git a/moonv4/moon_db/tests/unit_python/test_policies.py b/moonv4/python_moondb/tests/unit_python/test_policies.py index 3bd1360e..3bd1360e 100644 --- a/moonv4/moon_db/tests/unit_python/test_policies.py +++ b/moonv4/python_moondb/tests/unit_python/test_policies.py diff --git a/moonv4/moon_db/tests/unit_python/utilities.py b/moonv4/python_moondb/tests/unit_python/utilities.py index 1d79d890..1d79d890 100644 --- a/moonv4/moon_db/tests/unit_python/utilities.py +++ b/moonv4/python_moondb/tests/unit_python/utilities.py diff --git a/moonv4/moon_utilities/Changelog b/moonv4/python_moonutilities/Changelog index 952c2aa1..3eaf7894 100644 --- a/moonv4/moon_utilities/Changelog +++ b/moonv4/python_moonutilities/Changelog @@ -62,4 +62,3 @@ CHANGES 1.4.1 ----- - Cleanup moon_utilities code - diff --git a/moonv4/moon_utilities/LICENSE b/moonv4/python_moonutilities/LICENSE index d6456956..d6456956 100644 --- a/moonv4/moon_utilities/LICENSE +++ b/moonv4/python_moonutilities/LICENSE diff --git a/moonv4/moon_utilities/MANIFEST.in b/moonv4/python_moonutilities/MANIFEST.in index b764e35c..b764e35c 100644 --- a/moonv4/moon_utilities/MANIFEST.in +++ b/moonv4/python_moonutilities/MANIFEST.in diff --git a/moonv4/python_moonutilities/README.md b/moonv4/python_moonutilities/README.md new file mode 100644 index 00000000..8e21966a --- /dev/null +++ b/moonv4/python_moonutilities/README.md @@ -0,0 +1,33 @@ +# python-moonutilities Package +This package contains the core module for the Moon project. +It is designed to provide authorization feature to all OpenStack components. + +For any other information, refer to the parent project: + + https://git.opnfv.org/moon + +python-moonutilities is a common Python lib for other Moon Python packages + +## Build +### Build Python Package +```bash +cd ${MOON_HOME}/python_moonutilities +python3 setup.py sdist bdist_wheel +``` + +### Push Python Package to PIP +```bash +cd ${MOON_HOME}/python_moonutilities +gpg --detach-sign -u "${GPG_ID}" -a dist/python_moonutilities-X.Y.Z-py3-none-any.whl +gpg --detach-sign -u "${GPG_ID}" -a dist/python_moonutilities-X.Y.Z.tar.gz +twine upload dist/python_moonutilities-X.Y.Z-py3-none-any.whl dist/python_moonutilities-X.Y.Z-py3-none-any.whl.asc +twine upload dist/python_moonutilities-X.Y.Z.tar.gz dist/python_moonutilities-X.Y.Z.tar.gz.asc +``` + +## Test +### Python Unit Test +launch Docker for Python unit tests +```bash +cd ${MOON_HOME}/python_moonutilities +docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest +``` diff --git a/moonv4/moon_utilities/moon_utilities/__init__.py b/moonv4/python_moonutilities/python_moonutilities/__init__.py index e3ad9307..e3ad9307 100644 --- a/moonv4/moon_utilities/moon_utilities/__init__.py +++ b/moonv4/python_moonutilities/python_moonutilities/__init__.py diff --git a/moonv4/moon_utilities/moon_utilities/api.py b/moonv4/python_moonutilities/python_moonutilities/api.py index 8e80c21d..8e80c21d 100644 --- a/moonv4/moon_utilities/moon_utilities/api.py +++ b/moonv4/python_moonutilities/python_moonutilities/api.py diff --git a/moonv4/moon_utilities/moon_utilities/auth.py b/moonv4/python_moonutilities/python_moonutilities/auth.py index 10dda3ed..7656f4e7 100644 --- a/moonv4/moon_utilities/moon_utilities/auth.py +++ b/moonv4/python_moonutilities/python_moonutilities/auth.py @@ -9,7 +9,7 @@ import time from functools import wraps from flask import request from oslo_log import log as logging -from moon_utilities import exceptions, configuration +from python_moonutilities import exceptions, configuration LOG = logging.getLogger(__name__) diff --git a/moonv4/moon_utilities/moon_utilities/cache.py b/moonv4/python_moonutilities/python_moonutilities/cache.py index 8c6ee3bf..93e3daca 100644 --- a/moonv4/moon_utilities/moon_utilities/cache.py +++ b/moonv4/python_moonutilities/python_moonutilities/cache.py @@ -2,7 +2,7 @@ import logging import time import requests from uuid import uuid4 -from moon_utilities import configuration, exceptions +from python_moonutilities import configuration, exceptions LOG = logging.getLogger("moon.utilities.cache") diff --git a/moonv4/moon_utilities/moon_utilities/configuration.py b/moonv4/python_moonutilities/python_moonutilities/configuration.py index cda75de5..f0ef74a6 100644 --- a/moonv4/moon_utilities/moon_utilities/configuration.py +++ b/moonv4/python_moonutilities/python_moonutilities/configuration.py @@ -9,7 +9,7 @@ import json import requests import logging import logging.config -from moon_utilities import exceptions +from python_moonutilities import exceptions LOG = logging.getLogger("moon.utilities") diff --git a/moonv4/moon_utilities/moon_utilities/exceptions.py b/moonv4/python_moonutilities/python_moonutilities/exceptions.py index eb606432..5bbab2be 100644 --- a/moonv4/moon_utilities/moon_utilities/exceptions.py +++ b/moonv4/python_moonutilities/python_moonutilities/exceptions.py @@ -5,6 +5,7 @@ from oslo_log import log as logging from werkzeug.exceptions import HTTPException + LOG = logging.getLogger("moon.utilities.exceptions") _ = str diff --git a/moonv4/moon_utilities/moon_utilities/misc.py b/moonv4/python_moonutilities/python_moonutilities/misc.py index b83523c3..b83523c3 100644 --- a/moonv4/moon_utilities/moon_utilities/misc.py +++ b/moonv4/python_moonutilities/python_moonutilities/misc.py diff --git a/moonv4/moon_utilities/moon_utilities/security_functions.py b/moonv4/python_moonutilities/python_moonutilities/security_functions.py index 50ab4daf..6d9307fe 100644 --- a/moonv4/moon_utilities/moon_utilities/security_functions.py +++ b/moonv4/python_moonutilities/python_moonutilities/security_functions.py @@ -13,8 +13,7 @@ import time from functools import wraps from flask import request import logging -from moon_utilities import exceptions -from moon_utilities import configuration +from python_moonutilities import exceptions, configuration LOG = logging.getLogger("moon.utilities." + __name__) diff --git a/moonv4/moon_utilities/requirements.txt b/moonv4/python_moonutilities/requirements.txt index 5b80e5f2..5b80e5f2 100644 --- a/moonv4/moon_utilities/requirements.txt +++ b/moonv4/python_moonutilities/requirements.txt diff --git a/moonv4/moon_utilities/setup.py b/moonv4/python_moonutilities/setup.py index 21e11419..4a2eef5d 100644 --- a/moonv4/moon_utilities/setup.py +++ b/moonv4/python_moonutilities/setup.py @@ -4,16 +4,16 @@ # or at 'http://www.apache.org/licenses/LICENSE-2.0'. from setuptools import setup, find_packages -import moon_utilities +import python_moonutilities with open('requirements.txt') as f: required = f.read().splitlines() setup( - name='moon_utilities', + name='python-moonutilities', - version=moon_utilities.__version__, + version=python_moonutilities.__version__, packages=find_packages(), diff --git a/moonv4/moon_utilities/tests/unit_python/conftest.py b/moonv4/python_moonutilities/tests/unit_python/conftest.py index 7217586a..7217586a 100644 --- a/moonv4/moon_utilities/tests/unit_python/conftest.py +++ b/moonv4/python_moonutilities/tests/unit_python/conftest.py diff --git a/moonv4/moon_utilities/tests/unit_python/mock_cache.py b/moonv4/python_moonutilities/tests/unit_python/mock_cache.py index b2b287a9..b2b287a9 100644 --- a/moonv4/moon_utilities/tests/unit_python/mock_cache.py +++ b/moonv4/python_moonutilities/tests/unit_python/mock_cache.py diff --git a/moonv4/moon_utilities/tests/unit_python/mock_components.py b/moonv4/python_moonutilities/tests/unit_python/mock_components.py index a0319e1a..a0319e1a 100644 --- a/moonv4/moon_utilities/tests/unit_python/mock_components.py +++ b/moonv4/python_moonutilities/tests/unit_python/mock_components.py diff --git a/moonv4/moon_utilities/tests/unit_python/mock_keystone.py b/moonv4/python_moonutilities/tests/unit_python/mock_keystone.py index c0b26b88..c0b26b88 100644 --- a/moonv4/moon_utilities/tests/unit_python/mock_keystone.py +++ b/moonv4/python_moonutilities/tests/unit_python/mock_keystone.py diff --git a/moonv4/moon_utilities/tests/unit_python/requirements.txt b/moonv4/python_moonutilities/tests/unit_python/requirements.txt index 3c1ad607..3c1ad607 100644 --- a/moonv4/moon_utilities/tests/unit_python/requirements.txt +++ b/moonv4/python_moonutilities/tests/unit_python/requirements.txt diff --git a/moonv4/moon_utilities/tests/unit_python/test_cache.py b/moonv4/python_moonutilities/tests/unit_python/test_cache.py index 3d4f7292..3d4f7292 100644 --- a/moonv4/moon_utilities/tests/unit_python/test_cache.py +++ b/moonv4/python_moonutilities/tests/unit_python/test_cache.py diff --git a/moonv4/moon_utilities/tests/unit_python/test_configuration.py b/moonv4/python_moonutilities/tests/unit_python/test_configuration.py index 0ebff995..0ebff995 100644 --- a/moonv4/moon_utilities/tests/unit_python/test_configuration.py +++ b/moonv4/python_moonutilities/tests/unit_python/test_configuration.py diff --git a/moonv4/moon_utilities/tests/unit_python/utilities.py b/moonv4/python_moonutilities/tests/unit_python/utilities.py index 1d79d890..1d79d890 100644 --- a/moonv4/moon_utilities/tests/unit_python/utilities.py +++ b/moonv4/python_moonutilities/tests/unit_python/utilities.py diff --git a/moonv4/tests/performance/README.md b/moonv4/tests/performance/README.md new file mode 100644 index 00000000..52613d2c --- /dev/null +++ b/moonv4/tests/performance/README.md @@ -0,0 +1,69 @@ +# Moon Yardstick and Bottlenecks Performance Tests + +The main objective of this document is to describe the performance tests for the Moon project/module. +Moon is a security managment platform which provides a set of security functions to project the underlying OPNFV infrastructure and/or VNFs. +Moon is consisted of 2 parts: a master and a set of slaves. The master holds all security-related information and each slave only fetches and holds +related informations for its local usage from master. + +## Moon Master Performance Tests +In this test, we should: +- setup a Moon master service on a physical server +- create a tenant/scope through the Moon master service +- create a MSL security policy with 4 subject security levels and 4 object security levels for this tenant + +- increase N to find the limit of the security policy (implemented in format of a Docker) + - create N users and N resources (VMs in our case) in this tenant + - simulate 2 operation requests per user per second to Moon's authorization endpoint + - gather performance metrics like CPU, memory, network usages + - throught the iteration, determine the capacity limit for one Docker + +- setup 20 user and 20 resources (VMs in our case) for one tenant + - increase the number of tenants to test the maximal number of tenants on the server + +- setup 5 tenants of N users and N resources (VMs in our case) in each tenant + - increase N by simulating 2 operation requests per user per second to the Moon's authorization endpoint + - gather performance metrics like CPU, memory, network usages + - throught the iteration, dermine the maximal user/resource number of these 5 tenants/Dockers on the server + +- setup 10 tenants of N users and N resources (VMs in our case) in each tenant + - increase N by simulating 2 operation requests per user per second to the Moon's authorization endpoint + - gather performance metrics like CPU, memory, network usages + - throught the iteration, dermine the maximal user/resource number of these 10 tenants/Dockers on the server + +- setup 20 tenants of N users and N resources (VMs in our case) in each tenant + - increase N by simulating 2 operation requests per user per second to the Moon's authorization endpoint + - gather performance metrics like CPU, memory, network usages + - throught the iteration, dermine the maximal user/resource number of these 20 tenants/Dockers on the server + +## Moon Slave Performace Tests +In this test, we should: +- setup a Moon master service on a physical server +- setup a Moon slave service on a physical server +- create a tenant/scope through the Moon master service +- create a MSL security policy with 4 subject security levels and 4 object security levels for this tenant through the Moon master service + +- increase N to find the limit of the security policy (implemented in format of a Docker) + - create N users and N resources (VMs in our case) in this tenant + - simulate 2 operation requests per user per second to Moon slave's authorizatoin endpoint + - gather performance metrics like CPU, memory, network usages of Moon slave + - throught the iteration, dermine the capacity limit for one Docker of Moon slave + +- setup 20 user and 20 resources (VMs in our case) for one tenant through the Moon slave service + - increate the number of tenants to test the maximal number of tenants on the server of the Moon slave + +- setup 5 tenants of N users and N resources (VMs in our case) in each tenant through the Moon master service + - increate N by simulating 2 operation requests per user per second to the Moon slave's authorization endpoint + - gather performance metrics like CPU, memory, network usages of both Moon master and Moon slave + - throught the iteration, dermine the maximal user/resource number of these 5 tenants/Dockers on the server of Moon slave + +- setup 10 tenants of N users and N resources (VMs in our case) in each tenant through the Moon master service + - increate N by simulating 2 operation requests per user per second to the Moon slave's authorization endpoint + - gather performance metrics like CPU, memory, network usages of both Moon master and slave + - throught the iteration, dermine the maximal user/resource number of these 10 tenants/Dockers on the server of the Moon slave + +- setup 20 tenants of N users and N resources (VMs in our case) in each tenant through the Moon master service + - increate N by simulating 2 operation requests per user per second to the Moon slave's authorization endpoint + - gather performance metrics like CPU, memory, network usages of both Moon master and slave + - throught the iteration, dermine the maximal user/resource number of these 20 tenants/Dockers on the server of the Moon slave + + |