diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | INFO | 40 | ||||
-rw-r--r-- | api/Makefile | 8 | ||||
-rw-r--r-- | api/apidoc/functest.core.feature.rst | 7 | ||||
-rw-r--r-- | api/apidoc/functest.core.robotframework.rst | 7 | ||||
-rw-r--r-- | api/apidoc/functest.core.rst | 19 | ||||
-rw-r--r-- | api/apidoc/functest.core.testcase.rst | 7 | ||||
-rw-r--r-- | api/apidoc/functest.core.unit.rst | 7 | ||||
-rw-r--r-- | api/apidoc/functest.core.vnf.rst | 7 | ||||
-rw-r--r-- | api/apidoc/functest.rst | 14 | ||||
-rw-r--r-- | api/apidoc/modules.rst | 4 | ||||
-rw-r--r-- | api/apidoc/xtesting.ci.rst | 17 | ||||
-rw-r--r-- | api/apidoc/xtesting.ci.run_tests.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.ci.tier_builder.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.ci.tier_handler.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.feature.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.robotframework.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.rst | 19 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.testcase.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.unit.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.core.vnf.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.energy.energy.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.energy.rst | 15 | ||||
-rw-r--r-- | api/apidoc/xtesting.rst | 18 | ||||
-rw-r--r-- | api/apidoc/xtesting.utils.constants.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.utils.decorators.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.utils.env.rst | 7 | ||||
-rw-r--r-- | api/apidoc/xtesting.utils.rst | 17 | ||||
-rw-r--r-- | api/conf.py | 16 | ||||
-rw-r--r-- | api/index.rst | 4 | ||||
-rw-r--r-- | functest/utils/constants.py | 10 | ||||
-rw-r--r-- | setup.cfg | 6 | ||||
-rw-r--r-- | tox.ini | 36 | ||||
-rw-r--r-- | xtesting/__init__.py (renamed from functest/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/ci/__init__.py (renamed from functest/ci/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/ci/logging.ini (renamed from functest/ci/logging.ini) | 31 | ||||
-rw-r--r-- | xtesting/ci/run_tests.py (renamed from functest/ci/run_tests.py) | 26 | ||||
-rw-r--r-- | xtesting/ci/testcases.yaml (renamed from functest/ci/testcases.yaml) | 86 | ||||
-rw-r--r-- | xtesting/ci/tier_builder.py (renamed from functest/ci/tier_builder.py) | 2 | ||||
-rw-r--r-- | xtesting/ci/tier_handler.py (renamed from functest/ci/tier_handler.py) | 0 | ||||
-rw-r--r-- | xtesting/core/__init__.py (renamed from functest/core/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/core/feature.py (renamed from functest/core/feature.py) | 12 | ||||
-rw-r--r-- | xtesting/core/robotframework.py (renamed from functest/core/robotframework.py) | 4 | ||||
-rw-r--r-- | xtesting/core/testcase.py (renamed from functest/core/testcase.py) | 8 | ||||
-rw-r--r-- | xtesting/core/unit.py (renamed from functest/core/unit.py) | 2 | ||||
-rw-r--r-- | xtesting/core/vnf.py (renamed from functest/core/vnf.py) | 4 | ||||
-rw-r--r-- | xtesting/energy/__init__.py (renamed from functest/energy/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/energy/energy.py (renamed from functest/energy/energy.py) | 4 | ||||
-rw-r--r-- | xtesting/tests/__init__.py (renamed from functest/tests/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/__init__.py (renamed from functest/tests/unit/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/ci/__init__.py (renamed from functest/tests/unit/ci/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/ci/test_run_tests.py (renamed from functest/tests/unit/ci/test_run_tests.py) | 56 | ||||
-rw-r--r-- | xtesting/tests/unit/ci/test_tier_builder.py (renamed from functest/tests/unit/ci/test_tier_builder.py) | 4 | ||||
-rw-r--r-- | xtesting/tests/unit/ci/test_tier_handler.py (renamed from functest/tests/unit/ci/test_tier_handler.py) | 2 | ||||
-rw-r--r-- | xtesting/tests/unit/core/__init__.py (renamed from functest/tests/unit/core/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/core/test_feature.py (renamed from functest/tests/unit/core/test_feature.py) | 6 | ||||
-rw-r--r-- | xtesting/tests/unit/core/test_robotframework.py (renamed from functest/tests/unit/core/test_robotframework.py) | 6 | ||||
-rw-r--r-- | xtesting/tests/unit/core/test_testcase.py (renamed from functest/tests/unit/core/test_testcase.py) | 8 | ||||
-rw-r--r-- | xtesting/tests/unit/core/test_unit.py (renamed from functest/tests/unit/core/test_unit.py) | 8 | ||||
-rw-r--r-- | xtesting/tests/unit/core/test_vnf.py (renamed from functest/tests/unit/core/test_vnf.py) | 24 | ||||
-rw-r--r-- | xtesting/tests/unit/energy/__init__.py (renamed from functest/tests/unit/energy/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/energy/test_functest_energy.py (renamed from functest/tests/unit/energy/test_functest_energy.py) | 52 | ||||
-rw-r--r-- | xtesting/tests/unit/utils/__init__.py (renamed from functest/tests/unit/utils/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/tests/unit/utils/test_decorators.py (renamed from functest/tests/unit/utils/test_decorators.py) | 6 | ||||
-rw-r--r-- | xtesting/tests/unit/utils/test_env.py (renamed from functest/tests/unit/utils/test_env.py) | 2 | ||||
-rw-r--r-- | xtesting/utils/__init__.py (renamed from functest/utils/__init__.py) | 0 | ||||
-rw-r--r-- | xtesting/utils/constants.py | 5 | ||||
-rw-r--r-- | xtesting/utils/decorators.py (renamed from functest/utils/decorators.py) | 0 | ||||
-rw-r--r-- | xtesting/utils/env.py (renamed from functest/utils/env.py) | 0 |
69 files changed, 381 insertions, 342 deletions
@@ -3,7 +3,6 @@ .*.sw? .project .pydevproject -rally_conf.json /docs_build/ _build /docs_output/ @@ -13,7 +12,7 @@ _build cover coverage.xml nosetests.xml -functest.egg-info +*.egg-info *venv .tox *.out @@ -1,40 +0,0 @@ -Project: Base System Functionality Testing Project (functest) -Project Creation Date: January 20, 2015 -Project Category: Integration & Testing -Lifecycle State: Incubation -Primary Contact: Cedric Ollivier (cedric.ollivier@orange.com) -Project Lead: Cedric Ollivier (cedric.ollivier@orange.com) -Jira Project Name: Base System Functionality Testing Project -Jira Project Prefix: FUNCTEST -Mailing list tag: [functest] -IRC: Server:freenode.net Channel:#opnfv-functest -Repository: functest - -Committers: -Morgan Richomme <morgan.richomme@orange.com> -Jose Lausuch <jalausuch@suse.com> -Cedric Ollivier <cedric.ollivier@orange.com> -Helen Yao <helanyao@gmail.com> -Serena Feng <feng.xiaowei@zte.com.cn> -Juha Kosonen <juha.kosonen@nokia.com> -Valentin Boucher <valentin.boucher@kontron.com> -Viktor Tikkanen <viktor.tikkanen@nokia.com> -Mei Mei <meimei@huawei.com> -Linda Wang <wangwulin@huawei.com> - -Additional contributors: -Georgios Paraskevopoulos <georgepar.91@gmail.com> -Romanos Skiadas <rom.skiad@gmail.com> -Michael Polenchuk <mpolenchuk@mirantis.com> -Cristina Pauna <cristina.pauna@enea.com> -Steven Pisarski <s.pisarski@cablelabs.com> - -Link to TSC approval of the project: http://meetbot.opnfv.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-01-20-14.57.html - -Link(s) to approval of additional committers: - -http://lists.opnfv.org/pipermail/opnfv-tech-discuss/2015-April/001971.html -http://ircbot.wl.linuxfoundation.org/meetings/opnfv-testperf/2015/opnfv-testperf.2015-09-29-13.00.html -http://ircbot.wl.linuxfoundation.org/meetings/opnfv-testperf/2016/opnfv-testperf.2016-03-01-08.00.html -http://ircbot.wl.linuxfoundation.org/meetings/opnfv-functest/2016/opnfv-functest.2016-10-11-08.01.html - diff --git a/api/Makefile b/api/Makefile index ca9cfdc0..ba974605 100644 --- a/api/Makefile +++ b/api/Makefile @@ -91,9 +91,9 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OPNFVFunctest.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Xtesting.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OPNFVFunctest.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Xtesting.qhc" .PHONY: applehelp applehelp: @@ -110,8 +110,8 @@ devhelp: @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/OPNFVFunctest" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OPNFVFunctest" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Xtesting" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Xtesting" @echo "# devhelp" .PHONY: epub diff --git a/api/apidoc/functest.core.feature.rst b/api/apidoc/functest.core.feature.rst deleted file mode 100644 index a80e38da..00000000 --- a/api/apidoc/functest.core.feature.rst +++ /dev/null @@ -1,7 +0,0 @@ -functest.core.feature module -============================ - -.. automodule:: functest.core.feature - :members: - :undoc-members: - :show-inheritance: diff --git a/api/apidoc/functest.core.robotframework.rst b/api/apidoc/functest.core.robotframework.rst deleted file mode 100644 index 5404912c..00000000 --- a/api/apidoc/functest.core.robotframework.rst +++ /dev/null @@ -1,7 +0,0 @@ -functest.core.robotframework module -=================================== - -.. automodule:: functest.core.robotframework - :members: - :undoc-members: - :show-inheritance: diff --git a/api/apidoc/functest.core.rst b/api/apidoc/functest.core.rst deleted file mode 100644 index a610fa6f..00000000 --- a/api/apidoc/functest.core.rst +++ /dev/null @@ -1,19 +0,0 @@ -functest.core package -===================== - -.. automodule:: functest.core - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -.. toctree:: - - functest.core.feature - functest.core.robotframework - functest.core.testcase - functest.core.vnf - functest.core.unit - diff --git a/api/apidoc/functest.core.testcase.rst b/api/apidoc/functest.core.testcase.rst deleted file mode 100644 index 2f947a1b..00000000 --- a/api/apidoc/functest.core.testcase.rst +++ /dev/null @@ -1,7 +0,0 @@ -functest.core.testcase module -============================= - -.. automodule:: functest.core.testcase - :members: - :undoc-members: - :show-inheritance: diff --git a/api/apidoc/functest.core.unit.rst b/api/apidoc/functest.core.unit.rst deleted file mode 100644 index 5dd6880e..00000000 --- a/api/apidoc/functest.core.unit.rst +++ /dev/null @@ -1,7 +0,0 @@ -functest.core.unit module -========================= - -.. automodule:: functest.core.unit - :members: - :undoc-members: - :show-inheritance: diff --git a/api/apidoc/functest.core.vnf.rst b/api/apidoc/functest.core.vnf.rst deleted file mode 100644 index 9fd6b375..00000000 --- a/api/apidoc/functest.core.vnf.rst +++ /dev/null @@ -1,7 +0,0 @@ -functest.core.vnf module -======================== - -.. automodule:: functest.core.vnf - :members: - :undoc-members: - :show-inheritance: diff --git a/api/apidoc/functest.rst b/api/apidoc/functest.rst deleted file mode 100644 index 0fb6e791..00000000 --- a/api/apidoc/functest.rst +++ /dev/null @@ -1,14 +0,0 @@ -functest package -================ - -.. automodule:: functest - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - - functest.core diff --git a/api/apidoc/modules.rst b/api/apidoc/modules.rst index b8f33304..c23e273e 100644 --- a/api/apidoc/modules.rst +++ b/api/apidoc/modules.rst @@ -1,7 +1,7 @@ -functest +xtesting ======== .. toctree:: :maxdepth: 4 - functest + xtesting diff --git a/api/apidoc/xtesting.ci.rst b/api/apidoc/xtesting.ci.rst new file mode 100644 index 00000000..8bbe7b7e --- /dev/null +++ b/api/apidoc/xtesting.ci.rst @@ -0,0 +1,17 @@ +xtesting\.ci package +==================== + +.. automodule:: xtesting.ci + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + xtesting.ci.run_tests + xtesting.ci.tier_builder + xtesting.ci.tier_handler + diff --git a/api/apidoc/xtesting.ci.run_tests.rst b/api/apidoc/xtesting.ci.run_tests.rst new file mode 100644 index 00000000..b3782578 --- /dev/null +++ b/api/apidoc/xtesting.ci.run_tests.rst @@ -0,0 +1,7 @@ +xtesting\.ci\.run\_tests module +=============================== + +.. automodule:: xtesting.ci.run_tests + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.ci.tier_builder.rst b/api/apidoc/xtesting.ci.tier_builder.rst new file mode 100644 index 00000000..fd31c87b --- /dev/null +++ b/api/apidoc/xtesting.ci.tier_builder.rst @@ -0,0 +1,7 @@ +xtesting\.ci\.tier\_builder module +================================== + +.. automodule:: xtesting.ci.tier_builder + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.ci.tier_handler.rst b/api/apidoc/xtesting.ci.tier_handler.rst new file mode 100644 index 00000000..9a6e7255 --- /dev/null +++ b/api/apidoc/xtesting.ci.tier_handler.rst @@ -0,0 +1,7 @@ +xtesting\.ci\.tier\_handler module +================================== + +.. automodule:: xtesting.ci.tier_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.core.feature.rst b/api/apidoc/xtesting.core.feature.rst new file mode 100644 index 00000000..635951f3 --- /dev/null +++ b/api/apidoc/xtesting.core.feature.rst @@ -0,0 +1,7 @@ +xtesting\.core\.feature module +============================== + +.. automodule:: xtesting.core.feature + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.core.robotframework.rst b/api/apidoc/xtesting.core.robotframework.rst new file mode 100644 index 00000000..0838f8ef --- /dev/null +++ b/api/apidoc/xtesting.core.robotframework.rst @@ -0,0 +1,7 @@ +xtesting\.core\.robotframework module +===================================== + +.. automodule:: xtesting.core.robotframework + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.core.rst b/api/apidoc/xtesting.core.rst new file mode 100644 index 00000000..ca38ef39 --- /dev/null +++ b/api/apidoc/xtesting.core.rst @@ -0,0 +1,19 @@ +xtesting\.core package +====================== + +.. automodule:: xtesting.core + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + xtesting.core.feature + xtesting.core.robotframework + xtesting.core.testcase + xtesting.core.unit + xtesting.core.vnf + diff --git a/api/apidoc/xtesting.core.testcase.rst b/api/apidoc/xtesting.core.testcase.rst new file mode 100644 index 00000000..b572faa0 --- /dev/null +++ b/api/apidoc/xtesting.core.testcase.rst @@ -0,0 +1,7 @@ +xtesting\.core\.testcase module +=============================== + +.. automodule:: xtesting.core.testcase + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.core.unit.rst b/api/apidoc/xtesting.core.unit.rst new file mode 100644 index 00000000..ff0e5322 --- /dev/null +++ b/api/apidoc/xtesting.core.unit.rst @@ -0,0 +1,7 @@ +xtesting\.core\.unit module +=========================== + +.. automodule:: xtesting.core.unit + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.core.vnf.rst b/api/apidoc/xtesting.core.vnf.rst new file mode 100644 index 00000000..a5450b4a --- /dev/null +++ b/api/apidoc/xtesting.core.vnf.rst @@ -0,0 +1,7 @@ +xtesting\.core\.vnf module +========================== + +.. automodule:: xtesting.core.vnf + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.energy.energy.rst b/api/apidoc/xtesting.energy.energy.rst new file mode 100644 index 00000000..05e42381 --- /dev/null +++ b/api/apidoc/xtesting.energy.energy.rst @@ -0,0 +1,7 @@ +xtesting\.energy\.energy module +=============================== + +.. automodule:: xtesting.energy.energy + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.energy.rst b/api/apidoc/xtesting.energy.rst new file mode 100644 index 00000000..efd6ed16 --- /dev/null +++ b/api/apidoc/xtesting.energy.rst @@ -0,0 +1,15 @@ +xtesting\.energy package +======================== + +.. automodule:: xtesting.energy + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + xtesting.energy.energy + diff --git a/api/apidoc/xtesting.rst b/api/apidoc/xtesting.rst new file mode 100644 index 00000000..7f7ee676 --- /dev/null +++ b/api/apidoc/xtesting.rst @@ -0,0 +1,18 @@ +xtesting package +================ + +.. automodule:: xtesting + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + xtesting.ci + xtesting.core + xtesting.energy + xtesting.utils + diff --git a/api/apidoc/xtesting.utils.constants.rst b/api/apidoc/xtesting.utils.constants.rst new file mode 100644 index 00000000..7036ae7d --- /dev/null +++ b/api/apidoc/xtesting.utils.constants.rst @@ -0,0 +1,7 @@ +xtesting\.utils\.constants module +================================= + +.. automodule:: xtesting.utils.constants + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.utils.decorators.rst b/api/apidoc/xtesting.utils.decorators.rst new file mode 100644 index 00000000..455ca69e --- /dev/null +++ b/api/apidoc/xtesting.utils.decorators.rst @@ -0,0 +1,7 @@ +xtesting\.utils\.decorators module +================================== + +.. automodule:: xtesting.utils.decorators + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.utils.env.rst b/api/apidoc/xtesting.utils.env.rst new file mode 100644 index 00000000..8629ad65 --- /dev/null +++ b/api/apidoc/xtesting.utils.env.rst @@ -0,0 +1,7 @@ +xtesting\.utils\.env module +=========================== + +.. automodule:: xtesting.utils.env + :members: + :undoc-members: + :show-inheritance: diff --git a/api/apidoc/xtesting.utils.rst b/api/apidoc/xtesting.utils.rst new file mode 100644 index 00000000..b4478c9e --- /dev/null +++ b/api/apidoc/xtesting.utils.rst @@ -0,0 +1,17 @@ +xtesting\.utils package +======================= + +.. automodule:: xtesting.utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + xtesting.utils.constants + xtesting.utils.decorators + xtesting.utils.env + diff --git a/api/conf.py b/api/conf.py index b5adb4ca..e197623d 100644 --- a/api/conf.py +++ b/api/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# OPNFV Functest documentation build configuration file, created by +# Xtesting documentation build configuration file, created by # sphinx-quickstart on Mon Apr 17 10:03:43 2017. # # This file is execfile()d with the current directory set to its @@ -50,7 +50,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'OPNFV Functest' +project = u'Xtesting' copyright = u'2017, #opnfv-functest (chat.freenode.net)' author = u'#opnfv-functest (chat.freenode.net)' @@ -135,7 +135,7 @@ html_theme = 'sphinx_rtd_theme' # The name for this set of Sphinx documents. # "<project> v<release> documentation" by default. # -# html_title = u'OPNFV Functest vmaster' +# html_title = u'Xtesting vmaster' # A shorter title for the navigation bar. Default is the same as html_title. # @@ -235,7 +235,7 @@ html_static_path = ['_static'] # html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'OPNFVFunctestdoc' +htmlhelp_basename = 'Xtestingdoc' # -- Options for LaTeX output --------------------------------------------- @@ -261,7 +261,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'OPNFVFunctest.tex', u'OPNFV Functest Documentation', + (master_doc, 'Xtesting.tex', u'Xtesting Documentation', u'\\#opnfv-functest (chat.freenode.net)', 'manual'), ] @@ -303,7 +303,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'opnfvfunctest', u'OPNFV Functest Documentation', + (master_doc, 'xtesting', u'Xtesting Documentation', [author], 1) ] @@ -318,8 +318,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'OPNFVFunctest', u'OPNFV Functest Documentation', - author, 'OPNFVFunctest', 'One line description of project.', + (master_doc, 'Xtesting', u'Xtesting Documentation', + author, 'Xtesting', 'One line description of project.', 'Miscellaneous'), ] diff --git a/api/index.rst b/api/index.rst index db223437..cc961041 100644 --- a/api/index.rst +++ b/api/index.rst @@ -1,5 +1,5 @@ -Welcome to OPNFV Functest's documentation! -========================================== +Welcome to Xtesting's documentation! +==================================== Contents: diff --git a/functest/utils/constants.py b/functest/utils/constants.py deleted file mode 100644 index 0bc00d80..00000000 --- a/functest/utils/constants.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -# pylint: disable=missing-docstring - -import pkg_resources - -CONFIG_FUNCTEST_YAML = pkg_resources.resource_filename( - 'functest', 'ci/config_functest.yaml') - -ENV_FILE = '/home/opnfv/functest/conf/env_file' @@ -1,14 +1,14 @@ [metadata] -name = functest +name = xtesting version = 5 home-page = https://wiki.opnfv.org/display/functest [files] -packages = functest +packages = xtesting [entry_points] console_scripts = - run_tests = functest.ci.run_tests:main + run_tests = xtesting.ci.run_tests:main [build_sphinx] all_files = 1 @@ -12,10 +12,10 @@ install_command = pip install {opts} {packages} commands = nosetests --with-xunit \ --with-coverage \ --cover-tests \ - --cover-package=functest \ + --cover-package=xtesting \ --cover-xml \ --cover-html \ - functest/tests/unit + xtesting/tests/unit [testenv:docs] basepython = python2.7 @@ -29,37 +29,37 @@ commands = flake8 basepython = python2.7 whitelist_externals = bash commands = - pylint --disable=locally-disabled --ignore-imports=y --reports=n functest + pylint --disable=locally-disabled --ignore-imports=y --reports=n xtesting [testenv:yamllint] basepython = python2.7 files = - functest/ci + xtesting/ci commands = yamllint -s {[testenv:yamllint]files} [testenv:py35] dirs = - functest/tests/unit/ci - functest/tests/unit/core - functest/tests/unit/energy - functest/tests/unit/utils + xtesting/tests/unit/ci + xtesting/tests/unit/core + xtesting/tests/unit/energy + xtesting/tests/unit/utils commands = nosetests {[testenv:py35]dirs} [testenv:cover] basepython = python2.7 dirs = - functest/tests/unit/ci - functest/tests/unit/core - functest/tests/unit/energy - functest/tests/unit/utils/test_decorators.py + xtesting/tests/unit/ci + xtesting/tests/unit/core + xtesting/tests/unit/energy + xtesting/tests/unit/utils/test_decorators.py commands = nosetests --with-coverage --cover-tests \ - --cover-package functest.ci.tier_builder \ - --cover-package functest.ci.tier_handler \ - --cover-package functest.core \ - --cover-package functest.energy \ - --cover-package functest.tests.unit \ - --cover-package functest.utils.decorators \ + --cover-package xtesting.ci.tier_builder \ + --cover-package xtesting.ci.tier_handler \ + --cover-package xtesting.core \ + --cover-package xtesting.energy \ + --cover-package xtesting.tests.unit \ + --cover-package xtesting.utils.decorators \ --cover-min-percentage 100 {[testenv:cover]dirs} [testenv:perm] diff --git a/functest/__init__.py b/xtesting/__init__.py index e69de29b..e69de29b 100644 --- a/functest/__init__.py +++ b/xtesting/__init__.py diff --git a/functest/ci/__init__.py b/xtesting/ci/__init__.py index e69de29b..e69de29b 100644 --- a/functest/ci/__init__.py +++ b/xtesting/ci/__init__.py diff --git a/functest/ci/logging.ini b/xtesting/ci/logging.ini index f1ab7241..ab82073f 100644 --- a/functest/ci/logging.ini +++ b/xtesting/ci/logging.ini @@ -1,5 +1,5 @@ [loggers] -keys=root,functest,api,ci,cli,core,energy,opnfv_tests,utils +keys=root,xtesting,api,ci,cli,core,energy,opnfv_tests,utils [handlers] keys=console,wconsole,file,null @@ -11,45 +11,30 @@ keys=standard level=NOTSET handlers=null -[logger_functest] +[logger_xtesting] level=NOTSET handlers=file -qualname=functest - -[logger_api] -level=NOTSET -handlers=wconsole -qualname=functest.api +qualname=xtesting [logger_ci] level=NOTSET handlers=console -qualname=functest.ci - -[logger_cli] -level=NOTSET -handlers=wconsole -qualname=functest.cli +qualname=xtesting.ci [logger_core] level=NOTSET handlers=console -qualname=functest.core +qualname=xtesting.core [logger_energy] level=NOTSET handlers=wconsole -qualname=functest.energy - -[logger_opnfv_tests] -level=NOTSET -handlers=wconsole -qualname=functest.opnfv_tests +qualname=xtesting.energy [logger_utils] level=NOTSET handlers=wconsole -qualname=functest.utils +qualname=xtesting.utils [handler_null] class=NullHandler @@ -73,7 +58,7 @@ args=(sys.stdout,) class=FileHandler level=DEBUG formatter=standard -args=("/home/opnfv/functest/results/functest.log",) +args=("/home/opnfv/xtesting/results/xtesting.log",) [formatter_standard] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s diff --git a/functest/ci/run_tests.py b/xtesting/ci/run_tests.py index 651a3851..5c9143a3 100644 --- a/functest/ci/run_tests.py +++ b/xtesting/ci/run_tests.py @@ -8,7 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 """ The entry of running tests: -1) Parses functest/ci/testcases.yaml to check which testcase(s) to be run +1) Parses xtesting/ci/testcases.yaml to check which testcase(s) to be run 2) Execute the common operations on every testcase (run, push results to db...) 3) Return the right status code """ @@ -27,12 +27,12 @@ import enum import prettytable import yaml -from functest.ci import tier_builder -from functest.core import testcase -from functest.utils import constants -from functest.utils import env +from xtesting.ci import tier_builder +from xtesting.core import testcase +from xtesting.utils import constants +from xtesting.utils import env -LOGGER = logging.getLogger('functest.ci.run_tests') +LOGGER = logging.getLogger('xtesting.ci.run_tests') class Result(enum.Enum): @@ -92,7 +92,7 @@ class Runner(object): self.tiers = tier_builder.TierBuilder( env.get('INSTALLER_TYPE'), env.get('DEPLOY_SCENARIO'), - pkg_resources.resource_filename('functest', 'ci/testcases.yaml')) + pkg_resources.resource_filename('xtesting', 'ci/testcases.yaml')) @staticmethod def source_envfile(rc_file=constants.ENV_FILE): @@ -118,7 +118,7 @@ class Runner(object): def get_dict_by_test(testname): # pylint: disable=bad-continuation,missing-docstring with open(pkg_resources.resource_filename( - 'functest', 'ci/testcases.yaml')) as tyaml: + 'xtesting', 'ci/testcases.yaml')) as tyaml: testcases_yaml = yaml.safe_load(tyaml) for dic_tier in testcases_yaml.get("tiers"): for dic_testcase in dic_tier['testcases']: @@ -163,7 +163,7 @@ class Runner(object): test_case.run() if self.report_flag: test_case.push_to_db() - if test.get_project() == "functest": + if test.get_project() == "xtesting": result = test_case.is_successful() else: result = testcase.TestCase.EX_OK @@ -193,7 +193,7 @@ class Runner(object): test_case = self.executed_test_cases[test.get_name()] if test_case.is_successful() != testcase.TestCase.EX_OK: LOGGER.error("The test case '%s' failed.", test.get_name()) - if test.get_project() == "functest": + if test.get_project() == "xtesting": self.overall_result = Result.EX_ERROR if test.is_blocking(): raise BlockingTestFailed( @@ -265,7 +265,7 @@ class Runner(object): return self.overall_result def summary(self, tier=None): - """To generate functest report showing the overall results""" + """To generate xtesting report showing the overall results""" msg = prettytable.PrettyTable( header_style='upper', padding_width=5, field_names=['test case', 'project', 'tier', @@ -288,13 +288,13 @@ class Runner(object): for test in each_tier.get_skipped_test(): msg.add_row([test.get_name(), test.get_project(), each_tier.get_name(), "00:00", "SKIP"]) - LOGGER.info("FUNCTEST REPORT:\n\n%s\n", msg) + LOGGER.info("Xtesting report:\n\n%s\n", msg) def main(): """Entry point""" logging.config.fileConfig(pkg_resources.resource_filename( - 'functest', 'ci/logging.ini')) + 'xtesting', 'ci/logging.ini')) logging.captureWarnings(True) parser = RunTestsParser() args = parser.parse_args(sys.argv[1:]) diff --git a/functest/ci/testcases.yaml b/xtesting/ci/testcases.yaml index 953d2aea..c338f57e 100644 --- a/functest/ci/testcases.yaml +++ b/xtesting/ci/testcases.yaml @@ -10,44 +10,44 @@ tiers: testcases: - case_name: connection_check - project_name: functest + project_name: xtesting criteria: 100 blocking: true description: >- This test case verifies the retrieval of OpenStack clients: Keystone, Glance, Neutron and Nova and may perform some simple queries. When the config value of - snaps.use_keystone is True, functest must have access to + snaps.use_keystone is True, xtesting must have access to the cloud's private network. dependencies: installer: '^((?!netvirt).)*$' scenario: '' run: module: - 'functest.opnfv_tests.openstack.snaps.connection_check' + 'xtesting.opnfv_tests.openstack.snaps.connection_check' class: 'ConnectionCheck' - case_name: api_check - project_name: functest + project_name: xtesting criteria: 100 blocking: true description: >- This test case verifies the retrieval of OpenStack clients: Keystone, Glance, Neutron and Nova and may perform some simple queries. When the config value of - snaps.use_keystone is True, functest must have access to + snaps.use_keystone is True, xtesting must have access to the cloud's private network. dependencies: installer: '^((?!netvirt).)*$' scenario: '^((?!lxd).)*$' run: - module: 'functest.opnfv_tests.openstack.snaps.api_check' + module: 'xtesting.opnfv_tests.openstack.snaps.api_check' class: 'ApiCheck' - case_name: snaps_health_check - project_name: functest + project_name: xtesting criteria: 100 blocking: true description: >- @@ -59,7 +59,7 @@ tiers: installer: '' scenario: '^((?!lxd).)*$' run: - module: 'functest.opnfv_tests.openstack.snaps.health_check' + module: 'xtesting.opnfv_tests.openstack.snaps.health_check' class: 'HealthCheck' - @@ -71,7 +71,7 @@ tiers: testcases: - case_name: vping_ssh - project_name: functest + project_name: xtesting criteria: 100 blocking: true description: >- @@ -82,12 +82,12 @@ tiers: installer: '' scenario: '^((?!odl_l3|odl-bgpvpn|gluon).)*$' run: - module: 'functest.opnfv_tests.openstack.vping.vping_ssh' + module: 'xtesting.opnfv_tests.openstack.vping.vping_ssh' class: 'VPingSSH' - case_name: vping_userdata - project_name: functest + project_name: xtesting criteria: 100 blocking: true description: >- @@ -98,12 +98,12 @@ tiers: scenario: '^((?!lxd).)*$' run: module: - 'functest.opnfv_tests.openstack.vping.vping_userdata' + 'xtesting.opnfv_tests.openstack.vping.vping_userdata' class: 'VPingUserdata' - case_name: tempest_smoke_serial - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -115,12 +115,12 @@ tiers: installer: '^((?!netvirt).)*$' scenario: '' run: - module: 'functest.opnfv_tests.openstack.tempest.tempest' + module: 'xtesting.opnfv_tests.openstack.tempest.tempest' class: 'TempestSmokeSerial' - case_name: rally_sanity - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -130,12 +130,12 @@ tiers: installer: '' scenario: '' run: - module: 'functest.opnfv_tests.openstack.rally.rally' + module: 'xtesting.opnfv_tests.openstack.rally.rally' class: 'RallySanity' - case_name: refstack_defcore - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -146,12 +146,12 @@ tiers: scenario: '' run: module: - 'functest.opnfv_tests.openstack.refstack_client.refstack_client' + 'xtesting.opnfv_tests.openstack.refstack_client.refstack_client' class: 'RefstackClient' - case_name: odl - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -162,7 +162,7 @@ tiers: installer: '' scenario: 'odl' run: - module: 'functest.opnfv_tests.sdn.odl.odl' + module: 'xtesting.opnfv_tests.sdn.odl.odl' class: 'ODLTests' args: suites: @@ -171,7 +171,7 @@ tiers: - case_name: odl_netvirt - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -183,7 +183,7 @@ tiers: installer: 'apex' scenario: 'os-odl_l3-nofeature' run: - module: 'functest.opnfv_tests.sdn.odl.odl' + module: 'xtesting.opnfv_tests.sdn.odl.odl' class: 'ODLTests' args: suites: @@ -193,7 +193,7 @@ tiers: - case_name: snaps_smoke - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -202,14 +202,14 @@ tiers: with a newly created user and project. Set the config value snaps.use_floating_ips (True|False) to toggle this functionality. When the config value of - snaps.use_keystone is True, functest must have access to + snaps.use_keystone is True, xtesting must have access to the cloud's private network. dependencies: installer: '^((?!netvirt).)*$' scenario: '^((?!lxd).)*$' run: - module: 'functest.opnfv_tests.openstack.snaps.smoke' + module: 'xtesting.opnfv_tests.openstack.snaps.smoke' class: 'SnapsSmoke' - @@ -218,7 +218,7 @@ tiers: ci_loop: '(daily)|(weekly)' description: >- Test suites from feature projects - integrated in functest + integrated in xtesting testcases: - case_name: doctor-notification @@ -231,7 +231,7 @@ tiers: installer: 'apex' scenario: '^((?!fdio).)*$' run: - module: 'functest.core.feature' + module: 'xtesting.core.feature' class: 'BashFeature' args: cmd: 'doctor-test' @@ -247,11 +247,11 @@ tiers: installer: '(fuel)|(apex)|(netvirt)' scenario: 'bgpvpn' run: - module: 'sdnvpn.test.functest.run_sdnvpn_tests' + module: 'sdnvpn.test.xtesting.run_sdnvpn_tests' class: 'SdnvpnFunctest' - - case_name: functest-odl-sfc + case_name: xtesting-odl-sfc project_name: sfc criteria: 100 blocking: false @@ -262,7 +262,7 @@ tiers: installer: '' scenario: 'odl.*sfc' run: - module: 'functest.core.feature' + module: 'xtesting.core.feature' class: 'BashFeature' args: cmd: 'run_sfc_tests.py' @@ -296,7 +296,7 @@ tiers: installer: 'apex' scenario: 'odl.*-fdio' run: - module: 'functest.opnfv_tests.sdn.odl.odl' + module: 'xtesting.opnfv_tests.sdn.odl.odl' class: 'ODLTests' args: suites: @@ -311,7 +311,7 @@ tiers: testcases: - case_name: tempest_full_parallel - project_name: functest + project_name: xtesting criteria: 80 blocking: false description: >- @@ -322,12 +322,12 @@ tiers: installer: '^((?!netvirt).)*$' scenario: '' run: - module: 'functest.opnfv_tests.openstack.tempest.tempest' + module: 'xtesting.opnfv_tests.openstack.tempest.tempest' class: 'TempestFullParallel' - case_name: rally_full - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -337,7 +337,7 @@ tiers: installer: '^((?!netvirt).)*$' scenario: '' run: - module: 'functest.opnfv_tests.openstack.rally.rally' + module: 'xtesting.opnfv_tests.openstack.rally.rally' class: 'RallyFull' - @@ -349,7 +349,7 @@ tiers: testcases: - case_name: cloudify_ims - project_name: functest + project_name: xtesting criteria: 80 blocking: false description: >- @@ -360,12 +360,12 @@ tiers: installer: '' scenario: 'os-nosdn-nofeature-.*ha' run: - module: 'functest.opnfv_tests.vnf.ims.cloudify_ims' + module: 'xtesting.opnfv_tests.vnf.ims.cloudify_ims' class: 'CloudifyIms' - case_name: vyos_vrouter - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -374,7 +374,7 @@ tiers: installer: '' scenario: 'os-nosdn-nofeature-.*ha' run: - module: 'functest.opnfv_tests.vnf.router.cloudify_vrouter' + module: 'xtesting.opnfv_tests.vnf.router.cloudify_vrouter' class: 'CloudifyVrouter' - @@ -389,7 +389,7 @@ tiers: installer: '' scenario: 'os-nosdn-nofeature-.*ha' run: - module: 'functest.opnfv_tests.vnf.ims.orchestra_openims' + module: 'xtesting.opnfv_tests.vnf.ims.orchestra_openims' class: 'OpenImsVnf' - @@ -405,12 +405,12 @@ tiers: scenario: 'os-nosdn-nofeature-.*ha' run: module: - 'functest.opnfv_tests.vnf.ims.orchestra_clearwaterims' + 'xtesting.opnfv_tests.vnf.ims.orchestra_clearwaterims' class: 'ClearwaterImsVnf' - case_name: juju_epc - project_name: functest + project_name: xtesting criteria: 100 blocking: false description: >- @@ -420,5 +420,5 @@ tiers: installer: '' scenario: 'os-nosdn-nofeature-.*ha' run: - module: 'functest.opnfv_tests.vnf.epc.juju_epc' + module: 'xtesting.opnfv_tests.vnf.epc.juju_epc' class: 'JujuEpc' diff --git a/functest/ci/tier_builder.py b/xtesting/ci/tier_builder.py index 370ab94d..2c7b0cab 100644 --- a/functest/ci/tier_builder.py +++ b/xtesting/ci/tier_builder.py @@ -11,7 +11,7 @@ import yaml -import functest.ci.tier_handler as th +import xtesting.ci.tier_handler as th class TierBuilder(object): diff --git a/functest/ci/tier_handler.py b/xtesting/ci/tier_handler.py index 9fc3f24d..9fc3f24d 100644 --- a/functest/ci/tier_handler.py +++ b/xtesting/ci/tier_handler.py diff --git a/functest/core/__init__.py b/xtesting/core/__init__.py index e69de29b..e69de29b 100644 --- a/functest/core/__init__.py +++ b/xtesting/core/__init__.py diff --git a/functest/core/feature.py b/xtesting/core/feature.py index 65fd5a08..d3f86c02 100644 --- a/functest/core/feature.py +++ b/xtesting/core/feature.py @@ -7,7 +7,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -"""Define the parent classes of all Functest Features. +"""Define the parent classes of all Xtesting Features. Feature is considered as TestCase offered by Third-party. It offers helpers to run any python method or any bash command. @@ -17,17 +17,17 @@ import logging import subprocess import time -import functest.core.testcase as base +from xtesting.core import testcase __author__ = ("Serena Feng <feng.xiaowei@zte.com.cn>, " "Cedric Ollivier <cedric.ollivier@orange.com>") -class Feature(base.TestCase): +class Feature(testcase.TestCase): """Base model for single feature.""" __logger = logging.getLogger(__name__) - dir_results = "/home/opnfv/functest/results" + dir_results = "/home/opnfv/xtesting/results" def __init__(self, **kwargs): super(Feature, self).__init__(**kwargs) @@ -91,11 +91,11 @@ class Feature(base.TestCase): TestCase.EX_RUN_ERROR otherwise. """ self.start_time = time.time() - exit_code = base.TestCase.EX_RUN_ERROR + exit_code = testcase.TestCase.EX_RUN_ERROR self.result = 0 try: if self.execute(**kwargs) == 0: - exit_code = base.TestCase.EX_OK + exit_code = testcase.TestCase.EX_OK self.result = 100 except Exception: # pylint: disable=broad-except self.__logger.exception("%s FAILED", self.project_name) diff --git a/functest/core/robotframework.py b/xtesting/core/robotframework.py index 54574a68..4d3746aa 100644 --- a/functest/core/robotframework.py +++ b/xtesting/core/robotframework.py @@ -21,7 +21,7 @@ import robot.run from robot.utils.robottime import timestamp_to_secs from six import StringIO -from functest.core import testcase +from xtesting.core import testcase __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>" @@ -53,7 +53,7 @@ class RobotFramework(testcase.TestCase): """RobotFramework runner.""" __logger = logging.getLogger(__name__) - dir_results = "/home/opnfv/functest/results" + dir_results = "/home/opnfv/xtesting/results" def __init__(self, **kwargs): self.res_dir = os.path.join(self.dir_results, 'robot') diff --git a/functest/core/testcase.py b/xtesting/core/testcase.py index e8bb1409..4effa932 100644 --- a/functest/core/testcase.py +++ b/xtesting/core/testcase.py @@ -7,7 +7,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -"""Define the parent class of all Functest TestCases.""" +"""Define the parent class of all Xtesting TestCases.""" from datetime import datetime import json @@ -16,8 +16,8 @@ import os import re import requests -from functest.utils import decorators -from functest.utils import env +from xtesting.utils import decorators +from xtesting.utils import env import prettytable @@ -47,7 +47,7 @@ class TestCase(object): def __init__(self, **kwargs): self.details = {} - self.project_name = kwargs.get('project_name', 'functest') + self.project_name = kwargs.get('project_name', 'xtesting') self.case_name = kwargs.get('case_name', '') self.criteria = kwargs.get('criteria', 100) self.result = 0 diff --git a/functest/core/unit.py b/xtesting/core/unit.py index 61b5a58d..27773679 100644 --- a/functest/core/unit.py +++ b/xtesting/core/unit.py @@ -17,7 +17,7 @@ import unittest import six -from functest.core import testcase +from xtesting.core import testcase __author__ = ("Steven Pisarski <s.pisarski@cablelabs.com>, " "Cedric Ollivier <cedric.ollivier@orange.com>") diff --git a/functest/core/vnf.py b/xtesting/core/vnf.py index cf20492b..95ebde04 100644 --- a/functest/core/vnf.py +++ b/xtesting/core/vnf.py @@ -19,8 +19,8 @@ from snaps.openstack.create_user import OpenStackUser from snaps.openstack.create_project import OpenStackProject from snaps.openstack.tests import openstack_tests -from functest.core import testcase -from functest.utils import constants +from xtesting.core import testcase +from xtesting.utils import constants __author__ = ("Morgan Richomme <morgan.richomme@orange.com>, " "Valentin Boucher <valentin.boucher@orange.com>") diff --git a/functest/energy/__init__.py b/xtesting/energy/__init__.py index e69de29b..e69de29b 100644 --- a/functest/energy/__init__.py +++ b/xtesting/energy/__init__.py diff --git a/functest/energy/energy.py b/xtesting/energy/energy.py index a2652211..76e4873c 100644 --- a/functest/energy/energy.py +++ b/xtesting/energy/energy.py @@ -18,7 +18,7 @@ from functools import wraps import requests from six.moves import urllib -from functest.utils import env +from xtesting.utils import env def finish_session(current_scenario): @@ -88,8 +88,6 @@ class EnergyRecorder(object): Load connectivity settings from yaml. Load connectivity settings to Energy recording API - Use functest global config yaml file - (see functest_utils.get_functest_config) """ # Singleton pattern for energy_recorder_api static member # Load only if not previouly done diff --git a/functest/tests/__init__.py b/xtesting/tests/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/__init__.py +++ b/xtesting/tests/__init__.py diff --git a/functest/tests/unit/__init__.py b/xtesting/tests/unit/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/unit/__init__.py +++ b/xtesting/tests/unit/__init__.py diff --git a/functest/tests/unit/ci/__init__.py b/xtesting/tests/unit/ci/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/unit/ci/__init__.py +++ b/xtesting/tests/unit/ci/__init__.py diff --git a/functest/tests/unit/ci/test_run_tests.py b/xtesting/tests/unit/ci/test_run_tests.py index b8dca20c..de2af66d 100644 --- a/functest/tests/unit/ci/test_run_tests.py +++ b/xtesting/tests/unit/ci/test_run_tests.py @@ -13,8 +13,8 @@ import os import mock -from functest.ci import run_tests -from functest.core.testcase import TestCase +from xtesting.ci import run_tests +from xtesting.core.testcase import TestCase class FakeModule(TestCase): @@ -54,15 +54,15 @@ class RunTestsTesting(unittest.TestCase): self.run_tests_parser = run_tests.RunTestsParser() - @mock.patch('functest.ci.run_tests.Runner.get_dict_by_test') + @mock.patch('xtesting.ci.run_tests.Runner.get_dict_by_test') def test_get_run_dict(self, *args): retval = {'run': mock.Mock()} args[0].return_value = retval self.assertEqual(self.runner.get_run_dict('test_name'), retval['run']) args[0].assert_called_once_with('test_name') - @mock.patch('functest.ci.run_tests.LOGGER.error') - @mock.patch('functest.ci.run_tests.Runner.get_dict_by_test', + @mock.patch('xtesting.ci.run_tests.LOGGER.error') + @mock.patch('xtesting.ci.run_tests.Runner.get_dict_by_test', return_value=None) def test_get_run_dict_config_ko(self, *args): testname = 'test_name' @@ -75,8 +75,8 @@ class RunTestsTesting(unittest.TestCase): mock.call("Cannot get %s's config options", testname)] args[1].assert_has_calls(calls) - @mock.patch('functest.ci.run_tests.LOGGER.exception') - @mock.patch('functest.ci.run_tests.Runner.get_dict_by_test', + @mock.patch('xtesting.ci.run_tests.LOGGER.exception') + @mock.patch('xtesting.ci.run_tests.Runner.get_dict_by_test', side_effect=Exception) def test_get_run_dict_exception(self, *args): testname = 'test_name' @@ -125,7 +125,7 @@ class RunTestsTesting(unittest.TestCase): run_tests.Runner.get_dict_by_test('testname'), testcase_dict) - @mock.patch('functest.ci.run_tests.Runner.get_run_dict', + @mock.patch('xtesting.ci.run_tests.Runner.get_run_dict', return_value=None) def test_run_tests_import_exception(self, *args): mock_test = mock.Mock() @@ -141,7 +141,7 @@ class RunTestsTesting(unittest.TestCase): @mock.patch('importlib.import_module', name="module", return_value=mock.Mock(test_class=mock.Mock( side_effect=FakeModule))) - @mock.patch('functest.ci.run_tests.Runner.get_dict_by_test') + @mock.patch('xtesting.ci.run_tests.Runner.get_dict_by_test') def test_run_tests_default(self, *args): mock_test = mock.Mock() kwargs = {'get_name.return_value': 'test_name', @@ -149,7 +149,7 @@ class RunTestsTesting(unittest.TestCase): mock_test.configure_mock(**kwargs) test_run_dict = {'module': 'test_module', 'class': 'test_class'} - with mock.patch('functest.ci.run_tests.Runner.get_run_dict', + with mock.patch('xtesting.ci.run_tests.Runner.get_run_dict', return_value=test_run_dict): self.runner.clean_flag = True self.runner.run_test(mock_test) @@ -158,39 +158,39 @@ class RunTestsTesting(unittest.TestCase): self.assertEqual(self.runner.overall_result, run_tests.Result.EX_OK) - @mock.patch('functest.ci.run_tests.Runner.run_test', + @mock.patch('xtesting.ci.run_tests.Runner.run_test', return_value=TestCase.EX_OK) def test_run_tier_default(self, *mock_methods): self.assertEqual(self.runner.run_tier(self.tier), run_tests.Result.EX_OK) mock_methods[0].assert_called_with(mock.ANY) - @mock.patch('functest.ci.run_tests.LOGGER.info') + @mock.patch('xtesting.ci.run_tests.LOGGER.info') def test_run_tier_missing_test(self, mock_logger_info): self.tier.get_tests.return_value = None self.assertEqual(self.runner.run_tier(self.tier), run_tests.Result.EX_ERROR) self.assertTrue(mock_logger_info.called) - @mock.patch('functest.ci.run_tests.LOGGER.info') - @mock.patch('functest.ci.run_tests.Runner.run_tier') - @mock.patch('functest.ci.run_tests.Runner.summary') + @mock.patch('xtesting.ci.run_tests.LOGGER.info') + @mock.patch('xtesting.ci.run_tests.Runner.run_tier') + @mock.patch('xtesting.ci.run_tests.Runner.summary') def test_run_all_default(self, *mock_methods): os.environ['CI_LOOP'] = 'test_ci_loop' self.runner.run_all() mock_methods[1].assert_not_called() self.assertTrue(mock_methods[2].called) - @mock.patch('functest.ci.run_tests.LOGGER.info') - @mock.patch('functest.ci.run_tests.Runner.summary') + @mock.patch('xtesting.ci.run_tests.LOGGER.info') + @mock.patch('xtesting.ci.run_tests.Runner.summary') def test_run_all_missing_tier(self, *mock_methods): os.environ['CI_LOOP'] = 'loop_re_not_available' self.runner.run_all() self.assertTrue(mock_methods[1].called) - @mock.patch('functest.ci.run_tests.Runner.source_envfile', + @mock.patch('xtesting.ci.run_tests.Runner.source_envfile', side_effect=Exception) - @mock.patch('functest.ci.run_tests.Runner.summary') + @mock.patch('xtesting.ci.run_tests.Runner.summary') def test_main_failed(self, *mock_methods): kwargs = {'test': 'test_name', 'noclean': True, 'report': True} args = {'get_tier.return_value': False, @@ -201,10 +201,10 @@ class RunTestsTesting(unittest.TestCase): run_tests.Result.EX_ERROR) mock_methods[1].assert_called_once_with() - @mock.patch('functest.ci.run_tests.Runner.source_envfile') - @mock.patch('functest.ci.run_tests.Runner.run_test', + @mock.patch('xtesting.ci.run_tests.Runner.source_envfile') + @mock.patch('xtesting.ci.run_tests.Runner.run_test', return_value=TestCase.EX_OK) - @mock.patch('functest.ci.run_tests.Runner.summary') + @mock.patch('xtesting.ci.run_tests.Runner.summary') def test_main_tier(self, *mock_methods): mock_tier = mock.Mock() test_mock = mock.Mock() @@ -221,8 +221,8 @@ class RunTestsTesting(unittest.TestCase): run_tests.Result.EX_OK) mock_methods[1].assert_called() - @mock.patch('functest.ci.run_tests.Runner.source_envfile') - @mock.patch('functest.ci.run_tests.Runner.run_test', + @mock.patch('xtesting.ci.run_tests.Runner.source_envfile') + @mock.patch('xtesting.ci.run_tests.Runner.run_test', return_value=TestCase.EX_OK) def test_main_test(self, *mock_methods): kwargs = {'test': 'test_name', 'noclean': True, 'report': True} @@ -235,9 +235,9 @@ class RunTestsTesting(unittest.TestCase): run_tests.Result.EX_OK) mock_methods[0].assert_called_once_with('test_name') - @mock.patch('functest.ci.run_tests.Runner.source_envfile') - @mock.patch('functest.ci.run_tests.Runner.run_all') - @mock.patch('functest.ci.run_tests.Runner.summary') + @mock.patch('xtesting.ci.run_tests.Runner.source_envfile') + @mock.patch('xtesting.ci.run_tests.Runner.run_all') + @mock.patch('xtesting.ci.run_tests.Runner.summary') def test_main_all_tier(self, *args): kwargs = {'get_tier.return_value': None, 'get_test.return_value': None} @@ -250,7 +250,7 @@ class RunTestsTesting(unittest.TestCase): args[1].assert_called_once_with() args[2].assert_called_once_with() - @mock.patch('functest.ci.run_tests.Runner.source_envfile') + @mock.patch('xtesting.ci.run_tests.Runner.source_envfile') def test_main_any_tier_test_ko(self, *args): kwargs = {'get_tier.return_value': None, 'get_test.return_value': None} diff --git a/functest/tests/unit/ci/test_tier_builder.py b/xtesting/tests/unit/ci/test_tier_builder.py index ef6a007b..22a44a58 100644 --- a/functest/tests/unit/ci/test_tier_builder.py +++ b/xtesting/tests/unit/ci/test_tier_builder.py @@ -12,7 +12,7 @@ import unittest import mock -from functest.ci import tier_builder +from xtesting.ci import tier_builder class TierBuilderTesting(unittest.TestCase): @@ -33,7 +33,7 @@ class TierBuilderTesting(unittest.TestCase): attrs = {'get.return_value': [self.dic_tier]} self.mock_yaml.configure_mock(**attrs) - with mock.patch('functest.ci.tier_builder.yaml.safe_load', + with mock.patch('xtesting.ci.tier_builder.yaml.safe_load', return_value=self.mock_yaml), \ mock.patch('six.moves.builtins.open', mock.mock_open()): self.tierbuilder = tier_builder.TierBuilder( diff --git a/functest/tests/unit/ci/test_tier_handler.py b/xtesting/tests/unit/ci/test_tier_handler.py index 5e784128..d1900103 100644 --- a/functest/tests/unit/ci/test_tier_handler.py +++ b/xtesting/tests/unit/ci/test_tier_handler.py @@ -12,7 +12,7 @@ import unittest import mock -from functest.ci import tier_handler +from xtesting.ci import tier_handler class TierHandlerTesting(unittest.TestCase): diff --git a/functest/tests/unit/core/__init__.py b/xtesting/tests/unit/core/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/unit/core/__init__.py +++ b/xtesting/tests/unit/core/__init__.py diff --git a/functest/tests/unit/core/test_feature.py b/xtesting/tests/unit/core/test_feature.py index 3219c726..9bbe5331 100644 --- a/functest/tests/unit/core/test_feature.py +++ b/xtesting/tests/unit/core/test_feature.py @@ -14,8 +14,8 @@ import unittest import mock -from functest.core import feature -from functest.core import testcase +from xtesting.core import feature +from xtesting.core import testcase class FeatureTestingBase(unittest.TestCase): @@ -24,7 +24,7 @@ class FeatureTestingBase(unittest.TestCase): _project_name = "bar" _repo = "dir_repo_bar" _cmd = "run_bar_tests.py" - _output_file = '/home/opnfv/functest/results/foo.log' + _output_file = '/home/opnfv/xtesting/results/foo.log' feature = None @mock.patch('time.time', side_effect=[1, 2]) diff --git a/functest/tests/unit/core/test_robotframework.py b/xtesting/tests/unit/core/test_robotframework.py index 28fd15f6..7131b7e2 100644 --- a/functest/tests/unit/core/test_robotframework.py +++ b/xtesting/tests/unit/core/test_robotframework.py @@ -19,7 +19,7 @@ from robot.errors import DataError, RobotError from robot.result import model from robot.utils.robottime import timestamp_to_secs -from functest.core import robotframework +from xtesting.core import robotframework __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>" @@ -66,7 +66,7 @@ class ParseResultTesting(unittest.TestCase): def setUp(self): self.test = robotframework.RobotFramework( - case_name='robot', project_name='functest') + case_name='robot', project_name='xtesting') @mock.patch('robot.api.ExecutionResult', side_effect=DataError) def test_raises_exc(self, mock_method): @@ -121,7 +121,7 @@ class RunTesting(unittest.TestCase): def setUp(self): self.test = robotframework.RobotFramework( - case_name='robot', project_name='functest') + case_name='robot', project_name='xtesting') def test_exc_key_error(self): self.assertEqual(self.test.run(), self.test.EX_RUN_ERROR) diff --git a/functest/tests/unit/core/test_testcase.py b/xtesting/tests/unit/core/test_testcase.py index e11e5ff7..e2f56f8f 100644 --- a/functest/tests/unit/core/test_testcase.py +++ b/xtesting/tests/unit/core/test_testcase.py @@ -15,7 +15,7 @@ import logging import os import unittest -from functest.core import testcase +from xtesting.core import testcase import mock import requests @@ -30,7 +30,7 @@ class TestCaseTesting(unittest.TestCase): # pylint: disable=missing-docstring,too-many-public-methods _case_name = "base" - _project_name = "functest" + _project_name = "xtesting" _published_result = "PASS" _test_db_url = "http://testresults.opnfv.org/test/api/v1/results" _headers = {'Content-Type': 'application/json'} @@ -235,12 +235,12 @@ class TestCaseTesting(unittest.TestCase): def test_str_project_name_ko(self): self.test.project_name = None - self.assertIn("<functest.core.testcase.TestCase object at", + self.assertIn("<xtesting.core.testcase.TestCase object at", str(self.test)) def test_str_case_name_ko(self): self.test.case_name = None - self.assertIn("<functest.core.testcase.TestCase object at", + self.assertIn("<xtesting.core.testcase.TestCase object at", str(self.test)) def test_str_pass(self): diff --git a/functest/tests/unit/core/test_unit.py b/xtesting/tests/unit/core/test_unit.py index ca73de67..8afe0bde 100644 --- a/functest/tests/unit/core/test_unit.py +++ b/xtesting/tests/unit/core/test_unit.py @@ -12,8 +12,8 @@ import unittest import mock -from functest.core import unit -from functest.core import testcase +from xtesting.core import unit +from xtesting.core import testcase class PyTestSuiteRunnerTesting(unittest.TestCase): @@ -25,7 +25,7 @@ class PyTestSuiteRunnerTesting(unittest.TestCase): @mock.patch('unittest.TestLoader') def _test_run(self, mock_class=None, result=mock.Mock(), status=testcase.TestCase.EX_OK): - with mock.patch('functest.core.unit.unittest.TextTestRunner.run', + with mock.patch('xtesting.core.unit.unittest.TextTestRunner.run', return_value=result): self.assertEqual(self.psrunner.run(), status) mock_class.assert_not_called() @@ -85,7 +85,7 @@ class PyTestSuiteRunnerTesting(unittest.TestCase): failures=[]) mock_obj = mock.Mock() mock_class.side_effect = mock_obj - with mock.patch('functest.core.unit.unittest.TextTestRunner.run', + with mock.patch('xtesting.core.unit.unittest.TextTestRunner.run', return_value=mock_result): self.assertEqual(self.psrunner.run(name='foo'), testcase.TestCase.EX_OK) diff --git a/functest/tests/unit/core/test_vnf.py b/xtesting/tests/unit/core/test_vnf.py index 0ac672f6..ec8a783e 100644 --- a/functest/tests/unit/core/test_vnf.py +++ b/xtesting/tests/unit/core/test_vnf.py @@ -14,9 +14,9 @@ import unittest import mock -from functest.core import vnf -from functest.core import testcase -from functest.utils import constants +from xtesting.core import vnf +from xtesting.core import testcase +from xtesting.utils import constants from snaps.openstack.os_credentials import OSCreds @@ -29,7 +29,7 @@ class VnfBaseTesting(unittest.TestCase): tenant_description = 'description' def setUp(self): - self.test = vnf.VnfOnBoarding(project='functest', case_name='foo') + self.test = vnf.VnfOnBoarding(project='xtesting', case_name='foo') def test_run_deploy_orch_exc(self): with mock.patch.object(self.test, 'prepare'), \ @@ -107,8 +107,8 @@ class VnfBaseTesting(unittest.TestCase): return_value=True): self.assertEqual(self.test.run(), testcase.TestCase.EX_OK) - @mock.patch('functest.core.vnf.OpenStackUser') - @mock.patch('functest.core.vnf.OpenStackProject') + @mock.patch('xtesting.core.vnf.OpenStackUser') + @mock.patch('xtesting.core.vnf.OpenStackProject') @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials', side_effect=Exception) def test_prepare_exc1(self, *args): @@ -118,8 +118,8 @@ class VnfBaseTesting(unittest.TestCase): args[1].assert_not_called() args[2].assert_not_called() - @mock.patch('functest.core.vnf.OpenStackUser') - @mock.patch('functest.core.vnf.OpenStackProject', side_effect=Exception) + @mock.patch('xtesting.core.vnf.OpenStackUser') + @mock.patch('xtesting.core.vnf.OpenStackProject', side_effect=Exception) @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials') def test_prepare_exc2(self, *args): with self.assertRaises(Exception): @@ -128,8 +128,8 @@ class VnfBaseTesting(unittest.TestCase): args[1].assert_called_with(mock.ANY, mock.ANY) args[2].assert_not_called() - @mock.patch('functest.core.vnf.OpenStackUser', side_effect=Exception) - @mock.patch('functest.core.vnf.OpenStackProject') + @mock.patch('xtesting.core.vnf.OpenStackUser', side_effect=Exception) + @mock.patch('xtesting.core.vnf.OpenStackProject') @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials') def test_prepare_exc3(self, *args): with self.assertRaises(Exception): @@ -138,8 +138,8 @@ class VnfBaseTesting(unittest.TestCase): args[1].assert_called_with(mock.ANY, mock.ANY) args[2].assert_called_with(mock.ANY, mock.ANY) - @mock.patch('functest.core.vnf.OpenStackUser') - @mock.patch('functest.core.vnf.OpenStackProject') + @mock.patch('xtesting.core.vnf.OpenStackUser') + @mock.patch('xtesting.core.vnf.OpenStackProject') @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials') def test_prepare_default(self, *args): self.assertEqual(self.test.prepare(), testcase.TestCase.EX_OK) diff --git a/functest/tests/unit/energy/__init__.py b/xtesting/tests/unit/energy/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/unit/energy/__init__.py +++ b/xtesting/tests/unit/energy/__init__.py diff --git a/functest/tests/unit/energy/test_functest_energy.py b/xtesting/tests/unit/energy/test_functest_energy.py index fd110432..ea83c1ea 100644 --- a/functest/tests/unit/energy/test_functest_energy.py +++ b/xtesting/tests/unit/energy/test_functest_energy.py @@ -17,8 +17,8 @@ import unittest import mock import requests -from functest.energy.energy import EnergyRecorder -import functest.energy.energy as energy +from xtesting.energy.energy import EnergyRecorder +import xtesting.energy.energy as energy CASE_NAME = "UNIT_TEST_CASE" STEP_NAME = "UNIT_TEST_STEP" @@ -84,7 +84,7 @@ class EnergyRecorderTest(unittest.TestCase): del os.environ["ENERGY_RECORDER_API_USER"] del os.environ["ENERGY_RECORDER_API_PASSWORD"] - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', return_value=RECORDER_OK) def test_start(self, post_mock=None, get_mock=None): """EnergyRecorder.start method (regular case).""" @@ -98,7 +98,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', side_effect=Exception("Internal execution error (MOCK)")) def test_start_error(self, post_mock=None): """EnergyRecorder.start method (error in method).""" @@ -112,14 +112,14 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.EnergyRecorder.load_config', + @mock.patch('xtesting.energy.energy.EnergyRecorder.load_config', side_effect=Exception("Internal execution error (MOCK)")) def test_start_exception(self, conf_loader_mock=None): """EnergyRecorder.start test with exception during execution.""" start_status = EnergyRecorder.start(CASE_NAME) self.assertFalse(start_status) - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', return_value=RECORDER_KO) def test_start_api_error(self, post_mock=None): """EnergyRecorder.start method (API error).""" @@ -133,7 +133,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', return_value=RECORDER_OK) def test_set_step(self, post_mock=None): """EnergyRecorder.set_step method (regular case).""" @@ -147,7 +147,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', return_value=RECORDER_KO) def test_set_step_api_error(self, post_mock=None): """EnergyRecorder.set_step method (API error).""" @@ -161,7 +161,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.post', + @mock.patch('xtesting.energy.energy.requests.post', side_effect=Exception("Internal execution error (MOCK)")) def test_set_step_error(self, post_mock=None): """EnergyRecorder.set_step method (method error).""" @@ -175,14 +175,14 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.EnergyRecorder.load_config', + @mock.patch('xtesting.energy.energy.EnergyRecorder.load_config', side_effect=requests.exceptions.ConnectionError()) def test_set_step_connection_error(self, conf_loader_mock=None): """EnergyRecorder.start test with exception during execution.""" step_status = EnergyRecorder.set_step(STEP_NAME) self.assertFalse(step_status) - @mock.patch('functest.energy.energy.requests.delete', + @mock.patch('xtesting.energy.energy.requests.delete', return_value=RECORDER_OK) def test_stop(self, delete_mock=None): """EnergyRecorder.stop method (regular case).""" @@ -195,7 +195,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.delete', + @mock.patch('xtesting.energy.energy.requests.delete', return_value=RECORDER_KO) def test_stop_api_error(self, delete_mock=None): """EnergyRecorder.stop method (API Error).""" @@ -208,7 +208,7 @@ class EnergyRecorderTest(unittest.TestCase): timeout=EnergyRecorder.CONNECTION_TIMEOUT ) - @mock.patch('functest.energy.energy.requests.delete', + @mock.patch('xtesting.energy.energy.requests.delete', side_effect=Exception("Internal execution error (MOCK)")) def test_stop_error(self, delete_mock=None): """EnergyRecorder.stop method (method error).""" @@ -231,9 +231,9 @@ class EnergyRecorderTest(unittest.TestCase): """Call with to energy recorder decorators.""" raise Exception(self.exception_message_to_preserve) - @mock.patch("functest.energy.energy.EnergyRecorder.get_current_scenario", + @mock.patch("xtesting.energy.energy.EnergyRecorder.get_current_scenario", return_value=None) - @mock.patch("functest.energy.energy.EnergyRecorder") + @mock.patch("xtesting.energy.energy.EnergyRecorder") def test_decorators(self, recorder_mock=None, cur_scenario_mock=None): @@ -243,10 +243,10 @@ class EnergyRecorderTest(unittest.TestCase): mock.call.stop()] recorder_mock.assert_has_calls(calls) - @mock.patch("functest.energy.energy.EnergyRecorder.get_current_scenario", + @mock.patch("xtesting.energy.energy.EnergyRecorder.get_current_scenario", return_value={"scenario": PREVIOUS_SCENARIO, "step": PREVIOUS_STEP}) - @mock.patch("functest.energy.energy.EnergyRecorder") + @mock.patch("xtesting.energy.energy.EnergyRecorder") def test_decorators_with_previous(self, recorder_mock=None, cur_scenario_mock=None): @@ -267,7 +267,7 @@ class EnergyRecorderTest(unittest.TestCase): ) @mock.patch( - "functest.energy.energy.finish_session") + "xtesting.energy.energy.finish_session") def test_decorator_preserve_ex(self, finish_mock=None): """Test that decorator preserve method exceptions.""" self.test_load_config() @@ -278,7 +278,7 @@ class EnergyRecorderTest(unittest.TestCase): ) self.assertTrue(finish_mock.called) - @mock.patch("functest.energy.energy.requests.get", + @mock.patch("xtesting.energy.energy.requests.get", return_value=API_OK) def test_load_config(self, loader_mock=None, get_mock=None): """Test load config.""" @@ -296,7 +296,7 @@ class EnergyRecorderTest(unittest.TestCase): "http://pod-uri:8888/recorders/environment/MOCK_POD" ) - @mock.patch("functest.energy.energy.requests.get", + @mock.patch("xtesting.energy.energy.requests.get", return_value=API_OK) def test_load_config_no_creds(self, loader_mock=None, get_mock=None): """Test load config without creds.""" @@ -310,7 +310,7 @@ class EnergyRecorderTest(unittest.TestCase): "http://pod-uri:8888/recorders/environment/MOCK_POD" ) - @mock.patch("functest.energy.energy.requests.get", + @mock.patch("xtesting.energy.energy.requests.get", return_value=API_OK) def test_load_config_ex(self, loader_mock=None, get_mock=None): """Test load config with exception.""" @@ -321,7 +321,7 @@ class EnergyRecorderTest(unittest.TestCase): EnergyRecorder.load_config() self.assertEquals(EnergyRecorder.energy_recorder_api, None) - @mock.patch("functest.energy.energy.requests.get", + @mock.patch("xtesting.energy.energy.requests.get", return_value=API_KO) def test_load_config_api_ko(self, loader_mock=None, get_mock=None): """Test load config with API unavailable.""" @@ -332,7 +332,7 @@ class EnergyRecorderTest(unittest.TestCase): self.assertEquals(EnergyRecorder.energy_recorder_api["available"], False) - @mock.patch('functest.energy.energy.requests.get', + @mock.patch('xtesting.energy.energy.requests.get', return_value=RECORDER_OK) def test_get_current_scenario(self, loader_mock=None, get_mock=None): """Test get_current_scenario.""" @@ -341,7 +341,7 @@ class EnergyRecorderTest(unittest.TestCase): scenario = EnergyRecorder.get_current_scenario() self.assertTrue(scenario is not None) - @mock.patch('functest.energy.energy.requests.get', + @mock.patch('xtesting.energy.energy.requests.get', return_value=RECORDER_NOT_FOUND) def test_current_scenario_not_found(self, get_mock=None): """Test get current scenario not existing.""" @@ -350,7 +350,7 @@ class EnergyRecorderTest(unittest.TestCase): scenario = EnergyRecorder.get_current_scenario() self.assertTrue(scenario is None) - @mock.patch('functest.energy.energy.requests.get', + @mock.patch('xtesting.energy.energy.requests.get', return_value=RECORDER_KO) def test_current_scenario_api_error(self, get_mock=None): """Test get current scenario with API error.""" @@ -359,7 +359,7 @@ class EnergyRecorderTest(unittest.TestCase): scenario = EnergyRecorder.get_current_scenario() self.assertTrue(scenario is None) - @mock.patch('functest.energy.energy.EnergyRecorder.load_config', + @mock.patch('xtesting.energy.energy.EnergyRecorder.load_config', side_effect=Exception("Internal execution error (MOCK)")) def test_current_scenario_exception(self, get_mock=None): """Test get current scenario with exception.""" diff --git a/functest/tests/unit/utils/__init__.py b/xtesting/tests/unit/utils/__init__.py index e69de29b..e69de29b 100644 --- a/functest/tests/unit/utils/__init__.py +++ b/xtesting/tests/unit/utils/__init__.py diff --git a/functest/tests/unit/utils/test_decorators.py b/xtesting/tests/unit/utils/test_decorators.py index b4cdf6ff..83b182a8 100644 --- a/functest/tests/unit/utils/test_decorators.py +++ b/xtesting/tests/unit/utils/test_decorators.py @@ -18,8 +18,8 @@ import unittest import mock -from functest.core import testcase -from functest.utils import decorators +from xtesting.core import testcase +from xtesting.utils import decorators __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>" @@ -32,7 +32,7 @@ class DecoratorsTesting(unittest.TestCase): # pylint: disable=missing-docstring _case_name = 'base' - _project_name = 'functest' + _project_name = 'xtesting' _start_time = 1.0 _stop_time = 2.0 _result = 'PASS' diff --git a/functest/tests/unit/utils/test_env.py b/xtesting/tests/unit/utils/test_env.py index 49d2d974..08601fa5 100644 --- a/functest/tests/unit/utils/test_env.py +++ b/xtesting/tests/unit/utils/test_env.py @@ -15,7 +15,7 @@ import unittest from six.moves import reload_module -from functest.utils import env +from xtesting.utils import env class EnvTesting(unittest.TestCase): diff --git a/functest/utils/__init__.py b/xtesting/utils/__init__.py index e69de29b..e69de29b 100644 --- a/functest/utils/__init__.py +++ b/xtesting/utils/__init__.py diff --git a/xtesting/utils/constants.py b/xtesting/utils/constants.py new file mode 100644 index 00000000..dae08ca6 --- /dev/null +++ b/xtesting/utils/constants.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +# pylint: disable=missing-docstring + +ENV_FILE = '/home/opnfv/xtesting/conf/env_file' diff --git a/functest/utils/decorators.py b/xtesting/utils/decorators.py index 230a99e7..230a99e7 100644 --- a/functest/utils/decorators.py +++ b/xtesting/utils/decorators.py diff --git a/functest/utils/env.py b/xtesting/utils/env.py index aa2da0b5..aa2da0b5 100644 --- a/functest/utils/env.py +++ b/xtesting/utils/env.py |