Merge "Implement trunk ports testcase"
authorLinda Wang <wangwulin@huawei.com>
Wed, 14 Mar 2018 03:05:12 +0000 (03:05 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 14 Mar 2018 03:05:12 +0000 (03:05 +0000)
docker/restapi/Dockerfile
docker/smoke/Dockerfile
docker/smoke/testcases.yaml
functest/ci/testcases.yaml
functest/opnfv_tests/openstack/tempest/conf_utils.py
functest/opnfv_tests/openstack/tempest/tempest.py
functest/tests/unit/openstack/tempest/test_tempest.py

index 32a8b39..3286c87 100644 (file)
@@ -51,6 +51,12 @@ RUN apk --no-cache add --update python3 sshpass \
         juju-wait && \
     go get github.com/rogpeppe/godeps && \
     (cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system) && \
+    pip install --no-cache-dir --src /src -cupper-constraints.txt \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+        -e git+https://github.com/openstack/neutron.git@$OPENSTACK_TAG#egg=neutron && \
+    pip install --no-cache-dir --src /src -cupper-constraints.txt \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+        -r /src/neutron/test-requirements.txt && \
     mkdir -p /etc/rally && \
     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
     mkdir -p /var/lib/rally/database && rally db create && \
index ad0ae9f..e09ea1c 100644 (file)
@@ -34,6 +34,12 @@ RUN apk --no-cache add --virtual .build-deps --update \
     git clone https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
     (cd /src/odl_test && git checkout $ODL_TAG) && \
     virtualenv --system-site-packages /src/tempest/.venv && \
+    pip install --no-cache-dir --src /src -cupper-constraints.txt \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+        -e git+https://github.com/openstack/neutron.git@$OPENSTACK_TAG#egg=neutron && \
+    pip install --no-cache-dir --src /src -cupper-constraints.txt \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+        -r /src/neutron/test-requirements.txt && \
     rm -r upper-constraints.txt thirdparty-requirements.txt /src/odl_test/.git \
         /src/os-faults /src/rally && \
     mkdir -p /etc/rally && \
index 9f017e5..44539c9 100644 (file)
@@ -171,3 +171,20 @@ tiers:
                 run:
                     module: 'functest.opnfv_tests.openstack.snaps.smoke'
                     class: 'SnapsSmoke'
+
+            -
+                case_name: neutron_trunk
+                project_name: functest
+                criteria: 100
+                blocking: false
+                description: >-
+                    This test case runs the neutron trunk subtest of the
+                    OpenStack Tempest suite. The list of test cases is
+                    generated by Tempest having as input the relevant
+                    testcase list file.
+                dependencies:
+                    installer: '(fuel)|(apex)|(compass)'
+                    scenario: ''
+                run:
+                    module: 'functest.opnfv_tests.openstack.tempest.tempest'
+                    class: 'TempestNeutronTrunk'
index 7cbe0e6..1ebeef7 100644 (file)
@@ -234,6 +234,23 @@ tiers:
                     module: 'functest.opnfv_tests.openstack.snaps.smoke'
                     class: 'SnapsSmoke'
 
+            -
+                case_name: neutron_trunk
+                project_name: functest
+                criteria: 100
+                blocking: false
+                description: >-
+                    This test case runs the neutron trunk subtest of the
+                    OpenStack Tempest suite. The list of test cases is
+                    generated by Tempest having as input the relevant
+                    testcase list file.
+                dependencies:
+                    installer: '(fuel)|(apex)|(compass)'
+                    scenario: ''
+                run:
+                    module: 'functest.opnfv_tests.openstack.tempest.tempest'
+                    class: 'TempestNeutronTrunk'
+
     -
         name: features
         order: 2
index 57a3fcd..95777ea 100644 (file)
@@ -266,6 +266,8 @@ def configure_tempest_update_params(tempest_conf_file, res_dir,
         rconfig.set('identity', 'v3_endpoint_type',
                     os.environ.get('OS_ENDPOINT_TYPE'))
 
+    rconfig.set('network-feature-enabled', 'api_extensions', 'all')
+
     if os.environ.get('OS_ENDPOINT_TYPE') is not None:
         sections = rconfig.sections()
         services_list = [
index 1d85e68..059def3 100644 (file)
@@ -289,6 +289,19 @@ class TempestSmokeSerial(TempestCommon):
         self.option = ["--concurrency", "1"]
 
 
+class TempestNeutronTrunk(TempestCommon):
+    """Tempest neutron trunk testcase implementation."""
+    def __init__(self, **kwargs):
+        if "case_name" not in kwargs:
+            kwargs["case_name"] = 'neutron_trunk'
+        TempestCommon.__init__(self, **kwargs)
+        self.mode = "'neutron.tests.tempest.(api|scenario).test_trunk'"
+        self.res_dir = os.path.join(
+            getattr(config.CONF, 'dir_results'), 'neutron_trunk')
+        self.raw_list = os.path.join(self.res_dir, 'test_raw_list.txt')
+        self.list = os.path.join(self.res_dir, 'test_list.txt')
+
+
 class TempestSmokeParallel(TempestCommon):
     """Tempest smoke parallel testcase implementation."""
     def __init__(self, **kwargs):
index 7a23949..52d9846 100644 (file)
@@ -47,6 +47,7 @@ class OSTempestTesting(unittest.TestCase):
             self.tempestfull_parallel = tempest.TempestFullParallel()
             self.tempestcustom = tempest.TempestCustom()
             self.tempestdefcore = tempest.TempestDefcore()
+            self.tempestneutrontrunk = tempest.TempestNeutronTrunk()
 
     @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.error')
     @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.debug')
@@ -79,7 +80,7 @@ class OSTempestTesting(unittest.TestCase):
         elif self.tempestcommon.mode == 'full':
             testr_mode = r"'^tempest\.'"
         else:
-            testr_mode = 'tempest.api.' + self.tempestcommon.mode
+            testr_mode = self.tempestcommon.mode
         verifier_repo_dir = 'test_verifier_repo_dir'
         cmd = ("cd {0};"
                "testr list-tests {1} > {2};"
@@ -94,6 +95,9 @@ class OSTempestTesting(unittest.TestCase):
     def test_gen_tl_full_mode(self):
         self._test_gen_tl_mode_default('full')
 
+    def test_gen_tl_neutron_trunk_mode(self):
+        self._test_gen_tl_mode_default('neutron_trunk')
+
     def test_verif_res_missing_verif_id(self):
         self.tempestcommon.verification_id = None
         with self.assertRaises(Exception):