Make SFC test a python call to main() 45/31545/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 21 Mar 2017 14:17:46 +0000 (15:17 +0100)
committerJose Lausuch <jose.lausuch@ericsson.com>
Thu, 23 Mar 2017 09:47:59 +0000 (09:47 +0000)
Instead of python -> bash -> python, call
the SFC test using the execute() method that
is inherited from FeatureBase and it's a bash
call by default.
With this change, we call the SFC test using main()
of run_tests.py of SFC repo and will have
real time output.

Change-Id: I6d59821e603c88697a82b95c5626c5b703c11026
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
(cherry picked from commit d5820bef80ea4bdb871380dbfe41db12290fc5f8)

functest/opnfv_tests/features/odl_sfc.py

index 1956c9c..431cd47 100644 (file)
@@ -8,6 +8,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #
 import functest.core.feature_base as base
+from sfc.tests.functest import run_tests
 
 
 class OpenDaylightSFC(base.FeatureBase):
@@ -16,5 +17,6 @@ class OpenDaylightSFC(base.FeatureBase):
         super(OpenDaylightSFC, self).__init__(project='sfc',
                                               case='functest-odl-sfc',
                                               repo='dir_repo_sfc')
-        dir_sfc_functest = '{}/sfc/tests/functest'.format(self.repo)
-        self.cmd = 'cd %s && python ./run_tests.py' % dir_sfc_functest
+
+    def execute(self):
+        return run_tests.main()