Adding vRouter test codes using TestCasesBase
authorh-hayashi <hideyasu.hayashi@okinawaopenlabs.org>
Tue, 14 Feb 2017 13:27:29 +0000 (22:27 +0900)
committerh-hayashi <hideyasu.hayashi@okinawaopenlabs.org>
Fri, 24 Feb 2017 10:00:40 +0000 (19:00 +0900)
JIRA: FUNCTEST-530

1.setting "nosdn-nofeature" scinario in testcase.yaml.
1.adding process of setting result details for push DB
2.Delete of  define "vrouter_data" in config_functest.yaml.
3.modify of vrouter git tag's name  "stable".
4.modrify of testcase name "vyos_vrouter" In order to more specific.

Change-Id: I0602c01dbf9a5e71bf85943c2b5e40ef51269ffd
Signed-off-by: Hideyasu Hayashi <hideyasu.hayashi@okinawaopenlabs.org>
docker/Dockerfile
functest/ci/config_functest.yaml
functest/ci/testcases.yaml
functest/opnfv_tests/vnf/router/__init__.py [new file with mode: 0755]
functest/opnfv_tests/vnf/router/vyos_vrouter.py [new file with mode: 0755]

index bb469ae..98162f3 100644 (file)
@@ -19,6 +19,7 @@ ARG ODL_TAG=release/beryllium-sr4
 ARG OPENSTACK_TAG=stable/mitaka
 ARG KINGBIRD_TAG=0.2.2
 ARG VIMS_TAG=stable
+ARG VROUTER_TAG=stable
 ARG REPOS_DIR=/home/opnfv/repos
 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
@@ -96,6 +97,7 @@ RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git
 # other repositories
 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
+RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter
 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
 
 RUN pip install -r ${REPOS_DIR}/rally/requirements.txt
index d0442cf..b5ce6c1 100755 (executable)
@@ -27,6 +27,7 @@ general:
         repo_domino:        /home/opnfv/repos/domino
         repo_snaps:         /home/opnfv/repos/snaps
         repo_securityscan:  /home/opnfv/repos/securityscanning
+        repo_vrouter:       /home/opnfv/repos/vrouter
         functest:           /home/opnfv/functest
         functest_test:      /home/opnfv/repos/functest/functest/opnfv_tests
         results:            /home/opnfv/functest/results
index 4d02fe7..4458fdd 100755 (executable)
@@ -443,3 +443,16 @@ tiers:
                 run:
                     module: 'functest.opnfv_tests.vnf.ims.opera_ims'
                     class: 'ImsVnf'
+
+            -
+                name: vyos_vrouter
+                criteria: 'status == "PASS"'
+                blocking: false
+                description: >-
+                    This test case is vRouter testing.
+                dependencies:
+                    installer: 'fuel'
+                    scenario: 'nosdn-nofeature'
+                run:
+                    module: 'functest.opnfv_tests.vnf.router.vyos_vrouter'
+                    class: 'VrouterVnf'
diff --git a/functest/opnfv_tests/vnf/router/__init__.py b/functest/opnfv_tests/vnf/router/__init__.py
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/functest/opnfv_tests/vnf/router/vyos_vrouter.py b/functest/opnfv_tests/vnf/router/vyos_vrouter.py
new file mode 100755 (executable)
index 0000000..94a3ecf
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+#
+#  Copyright 2017 Okinawa Open Laboratory
+#
+# 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
+import functest.core.feature_base as base
+import json
+import os
+
+RESULT_DETAILS_FILE = "test_result.json"
+
+
+class VrouterVnf(base.FeatureBase):
+    def __init__(self):
+        super(VrouterVnf, self).__init__(project='vRouter',
+                                         case='vyos_vrouter',
+                                         repo='dir_repo_vrouter')
+        self.cmd = 'cd %s && ./run.sh' % self.repo
+
+    def set_result_details(self):
+        filepath = os.path.join(self.repo, RESULT_DETAILS_FILE)
+        if os.path.exists(filepath):
+            f = open(filepath, 'r')
+            self.details = json.load(f)
+            f.close()
+
+    def log_results(self):
+        if self.criteria == 'PASS':
+            self.set_result_details()
+        super(VrouterVnf, self).log_results()