diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/test/python | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/python')
-rw-r--r-- | src/test/python/.gitignore | 27 | ||||
-rw-r--r-- | src/test/python/brag-client/.gitignore | 1 | ||||
-rw-r--r-- | src/test/python/brag-client/setup.py | 31 | ||||
-rw-r--r-- | src/test/python/brag-client/tests/test_ceph_brag.py | 10 | ||||
-rw-r--r-- | src/test/python/brag-client/tox.ini | 16 | ||||
-rw-r--r-- | src/test/python/ceph/.gitignore | 3 | ||||
-rw-r--r-- | src/test/python/ceph/setup.py | 27 | ||||
-rw-r--r-- | src/test/python/ceph/tests/test_ceph.py | 10 | ||||
-rw-r--r-- | src/test/python/ceph/tox.ini | 18 |
9 files changed, 143 insertions, 0 deletions
diff --git a/src/test/python/.gitignore b/src/test/python/.gitignore new file mode 100644 index 00000000..f24cd995 --- /dev/null +++ b/src/test/python/.gitignore @@ -0,0 +1,27 @@ +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/src/test/python/brag-client/.gitignore b/src/test/python/brag-client/.gitignore new file mode 100644 index 00000000..18ca10aa --- /dev/null +++ b/src/test/python/brag-client/.gitignore @@ -0,0 +1 @@ +ceph_brag.py diff --git a/src/test/python/brag-client/setup.py b/src/test/python/brag-client/setup.py new file mode 100644 index 00000000..7f2bc7a2 --- /dev/null +++ b/src/test/python/brag-client/setup.py @@ -0,0 +1,31 @@ +import os +from setuptools import setup, find_packages + +# link ceph-brag client script here so we can "install" it +current_dir = os.path.abspath(os.path.dirname(__file__)) +src_dir = os.path.dirname(os.path.dirname(os.path.dirname(current_dir))) +script_path = os.path.join(src_dir, 'brag/client/ceph-brag') + + +def link_target(source, destination): + if not os.path.exists(destination): + try: + os.symlink(source, destination) + except (IOError, OSError) as error: + print('Ignoring linking of target: %s' % str(error)) + +link_target(script_path, 'ceph_brag.py') + +setup( + name='ceph_brag', + version='0.1', + description='', + author='', + author_email='', + install_requires=[ + "requests", + ], + zip_safe=False, + packages=find_packages(), + #packages=find_packages(exclude=['ez_setup']) +) diff --git a/src/test/python/brag-client/tests/test_ceph_brag.py b/src/test/python/brag-client/tests/test_ceph_brag.py new file mode 100644 index 00000000..2a584f5a --- /dev/null +++ b/src/test/python/brag-client/tests/test_ceph_brag.py @@ -0,0 +1,10 @@ +import ceph_brag + +# This file tests nothing (yet) except for being able to import ceph_brag +# correctly and thus ensuring somewhat that it will work under different Python +# versions. You must write unittests here so that code has adequate coverage. + +class TestCephBrag(object): + + def test_basic(self): + assert True diff --git a/src/test/python/brag-client/tox.ini b/src/test/python/brag-client/tox.ini new file mode 100644 index 00000000..c94e0d2f --- /dev/null +++ b/src/test/python/brag-client/tox.ini @@ -0,0 +1,16 @@ +[tox] +envlist = py26, py27, flake8 +skipsdist=True + +[testenv] +deps= + pytest + +commands= + python setup.py develop + py.test -v + +[testenv:flake8] +deps= + flake8 +commands=flake8 --select=F ceph_brag.py diff --git a/src/test/python/ceph/.gitignore b/src/test/python/ceph/.gitignore new file mode 100644 index 00000000..88c7fe6f --- /dev/null +++ b/src/test/python/ceph/.gitignore @@ -0,0 +1,3 @@ +# this is a generated file used for testing and symlinked and should be ignored +# as paths are absolute to the test machine +ceph.py diff --git a/src/test/python/ceph/setup.py b/src/test/python/ceph/setup.py new file mode 100644 index 00000000..90dbb59e --- /dev/null +++ b/src/test/python/ceph/setup.py @@ -0,0 +1,27 @@ +import os +from setuptools import setup, find_packages + +# link ceph script here so we can "install" it +current_dir = os.path.abspath(os.path.dirname(__file__)) +src_dir = os.path.dirname(os.path.dirname(os.path.dirname(current_dir))) +script_path = os.path.join(src_dir, 'ceph.in') + + +def link_target(source, destination): + if not os.path.exists(destination): + try: + os.symlink(source, destination) + except (IOError, OSError) as error: + print('Ignoring linking of target: %s' % str(error)) + +link_target(script_path, 'ceph.py') + +setup( + name='ceph', + version='0.1', + description='', + author='', + author_email='', + zip_safe=False, + packages=find_packages(), +) diff --git a/src/test/python/ceph/tests/test_ceph.py b/src/test/python/ceph/tests/test_ceph.py new file mode 100644 index 00000000..d26493ea --- /dev/null +++ b/src/test/python/ceph/tests/test_ceph.py @@ -0,0 +1,10 @@ +import ceph + +# This file tests nothing (yet) except for being able to import ceph +# correctly and thus ensuring somewhat that it will work under different Python +# versions. You must write unittests here so that code has adequate coverage. + +class TestCeph(object): + + def test_basic(self): + assert True diff --git a/src/test/python/ceph/tox.ini b/src/test/python/ceph/tox.ini new file mode 100644 index 00000000..6f28f577 --- /dev/null +++ b/src/test/python/ceph/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = py26, py27, flake8 +skipsdist=True + +[testenv] +deps= + pytest +setenv = + PYTHONPATH = {toxinidir}/../../../pybind + +commands= + python setup.py develop + py.test -v + +[testenv:flake8] +deps= + flake8 +commands=flake8 --select=F ceph.py |