From: Yujun Zhang Date: Thu, 17 Nov 2016 05:52:03 +0000 (+0800) Subject: Architecture evolution skeleton X-Git-Tag: danube.1.0~171^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F24469%2F2;p=qtip.git Architecture evolution skeleton - benchmarks will be driven by qtip.runner - qtip.runner is used by both qtip.cli and qtip.api - unit test for each module will be placed under tests/unit - functional tests will be moved to tests/functional - data as testing sample will be moved to tests/data NOTE: this patch moves files only, it may fails many tests. To be followed up in next step. JIRA: QTIP-148 Change-Id: I27e8169a74783970a1f7818456eb76a7311fb60c Signed-off-by: Yujun Zhang --- diff --git a/qtip/runner/__init__.py b/qtip/runner/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/qtip/runner/perftest.py b/qtip/runner/perftest.py new file mode 100644 index 00000000..835f2a81 --- /dev/null +++ b/qtip/runner/perftest.py @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class PerfTest: + """A perf test collects raw performance metrics by running test tools""" + + def __init__(self): + pass + + @staticmethod + def list_all(): + """list all available perf tests""" + pass + + def desc(self): + """description of the perf test""" + pass + + def run(self): + pass diff --git a/qtip/runner/suite.py b/qtip/runner/suite.py new file mode 100644 index 00000000..f0f2f63e --- /dev/null +++ b/qtip/runner/suite.py @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class Suite: + """A suite is consist of one or several perf tests and produces one QPI""" + + def __init__(self): + pass + + @staticmethod + def list_all(): + """list all available suites""" + pass + + def desc(self): + """description of the suite""" + pass + + def run(self): + """run included perftests in the suite""" + pass diff --git a/qtip/runner/test_plan.py b/qtip/runner/test_plan.py new file mode 100644 index 00000000..d20221df --- /dev/null +++ b/qtip/runner/test_plan.py @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class TestPlan: + """A test plan is consist of test configuration and selected test suites""" + + def __init__(self): + pass + + @staticmethod + def list_all(): + """list all available test plans""" + pass + + def desc(self): + """description of the test plan""" + pass + + def run(self): + """run included suites""" + pass diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/output/hosts b/tests/data/output/hosts similarity index 100% rename from tests/output/hosts rename to tests/data/output/hosts diff --git a/tests/schema/test_bm_schema.yaml b/tests/data/schema/test_bm_schema.yaml similarity index 100% rename from tests/schema/test_bm_schema.yaml rename to tests/data/schema/test_bm_schema.yaml diff --git a/tests/schema/test_vm_schema.yaml b/tests/data/schema/test_vm_schema.yaml similarity index 100% rename from tests/schema/test_vm_schema.yaml rename to tests/data/schema/test_vm_schema.yaml diff --git a/tests/test_case/bm_ping.yaml b/tests/data/test_plan/bm_ping.yaml similarity index 100% rename from tests/test_case/bm_ping.yaml rename to tests/data/test_plan/bm_ping.yaml diff --git a/tests/test_case/bm_with_proxy.yaml b/tests/data/test_plan/bm_with_proxy.yaml similarity index 100% rename from tests/test_case/bm_with_proxy.yaml rename to tests/data/test_plan/bm_with_proxy.yaml diff --git a/tests/test_case/bm_without_proxy.yaml b/tests/data/test_plan/bm_without_proxy.yaml similarity index 100% rename from tests/test_case/bm_without_proxy.yaml rename to tests/data/test_plan/bm_without_proxy.yaml diff --git a/tests/test_case/vm.yaml b/tests/data/test_plan/vm.yaml similarity index 100% rename from tests/test_case/vm.yaml rename to tests/data/test_plan/vm.yaml diff --git a/tests/test_case/vm_error.yaml b/tests/data/test_plan/vm_error.yaml similarity index 100% rename from tests/test_case/vm_error.yaml rename to tests/data/test_plan/vm_error.yaml diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/yaml_schema_test.py b/tests/functional/yaml_schema_test.py similarity index 100% rename from tests/yaml_schema_test.py rename to tests/functional/yaml_schema_test.py diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/api/__init__.py b/tests/unit/api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/qtip_server_test.py b/tests/unit/api/qtip_server_test.py similarity index 100% rename from tests/qtip_server_test.py rename to tests/unit/api/qtip_server_test.py diff --git a/tests/unit/cli/__init__.py b/tests/unit/cli/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/runner/__init__.py b/tests/unit/runner/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/runner/perftest_test.py b/tests/unit/runner/perftest_test.py new file mode 100644 index 00000000..798afadd --- /dev/null +++ b/tests/unit/runner/perftest_test.py @@ -0,0 +1,13 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class TestPerfTest: + def test_list(self): + assert True diff --git a/tests/unit/runner/suite_test.py b/tests/unit/runner/suite_test.py new file mode 100644 index 00000000..a2023cf8 --- /dev/null +++ b/tests/unit/runner/suite_test.py @@ -0,0 +1,13 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class TestSuite: + def test_list(self): + assert True diff --git a/tests/unit/runner/test_plan_test.py b/tests/unit/runner/test_plan_test.py new file mode 100644 index 00000000..81f618c7 --- /dev/null +++ b/tests/unit/runner/test_plan_test.py @@ -0,0 +1,13 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +class TestTestPlan: + def test_list(self): + assert True diff --git a/tests/unit/utils/__init__.py b/tests/unit/utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/ansible_api_test.py b/tests/unit/utils/ansible_api_test.py similarity index 100% rename from tests/ansible_api_test.py rename to tests/unit/utils/ansible_api_test.py diff --git a/tests/args_handler_test.py b/tests/unit/utils/args_handler_test.py similarity index 100% rename from tests/args_handler_test.py rename to tests/unit/utils/args_handler_test.py diff --git a/tests/cli_test.py b/tests/unit/utils/cli_test.py similarity index 100% rename from tests/cli_test.py rename to tests/unit/utils/cli_test.py diff --git a/tests/create_zones_test.py b/tests/unit/utils/create_zones_test.py similarity index 100% rename from tests/create_zones_test.py rename to tests/unit/utils/create_zones_test.py diff --git a/tests/driver_test.py b/tests/unit/utils/driver_test.py similarity index 100% rename from tests/driver_test.py rename to tests/unit/utils/driver_test.py diff --git a/tests/env_setup_test.py b/tests/unit/utils/env_setup_test.py similarity index 100% rename from tests/env_setup_test.py rename to tests/unit/utils/env_setup_test.py diff --git a/tests/spawn_vm_test.py b/tests/unit/utils/spawn_vm_test.py similarity index 100% rename from tests/spawn_vm_test.py rename to tests/unit/utils/spawn_vm_test.py