aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests')
-rw-r--r--[-rwxr-xr-x]functest/opnfv_tests/openstack/refstack_client/refstack_client.py6
-rw-r--r--[-rwxr-xr-x]functest/opnfv_tests/openstack/refstack_client/tempest_conf.py2
-rw-r--r--[-rwxr-xr-x]functest/opnfv_tests/openstack/vping/vping_ssh.py2
-rw-r--r--[-rwxr-xr-x]functest/opnfv_tests/openstack/vping/vping_userdata.py17
-rw-r--r--[-rwxr-xr-x]functest/opnfv_tests/sdn/onos/sfc/sfc.py6
5 files changed, 8 insertions, 25 deletions
diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py
index c4618894..9edbab5a 100755..100644
--- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py
+++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py
@@ -218,7 +218,7 @@ class RefstackClientParser(object):
return vars(self.parser.parse_args(argv))
-if __name__ == '__main__':
+def main():
logging.basicConfig()
refstackclient = RefstackClient()
parser = RefstackClientParser()
@@ -226,6 +226,6 @@ if __name__ == '__main__':
try:
result = refstackclient.main(**args)
if result != testcase.TestCase.EX_OK:
- sys.exit(result)
+ return result
except Exception:
- sys.exit(testcase.TestCase.EX_RUN_ERROR)
+ return testcase.TestCase.EX_RUN_ERROR
diff --git a/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py
index 5d429e7c..30590b9e 100755..100644
--- a/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py
+++ b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py
@@ -49,7 +49,7 @@ class TempestConf(object):
logger.error('Error with run: %s', e)
-if __name__ == '__main__':
+def main():
logging.basicConfig()
tempestconf = TempestConf()
tempestconf.main()
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py
index eacccb98..d4c39ad2 100755..100644
--- a/functest/opnfv_tests/openstack/vping/vping_ssh.py
+++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py
@@ -23,8 +23,8 @@ from snaps.openstack.utils import deploy_utils
from functest.core.testcase import TestCase
from functest.opnfv_tests.openstack.snaps import snaps_utils
+from functest.opnfv_tests.openstack.vping import vping_base
from functest.utils.constants import CONST
-import vping_base
class VPingSSH(vping_base.VPingBase):
diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py
index 718f47f0..9aed4c10 100755..100644
--- a/functest/opnfv_tests/openstack/vping/vping_userdata.py
+++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py
@@ -7,17 +7,14 @@
#
# http://www.apache.org/licenses/LICENSE-2.0
-import argparse
-import sys
import time
-from functest.core.testcase import TestCase
-
from snaps.openstack.utils import deploy_utils
from snaps.openstack.create_instance import VmInstanceSettings
from snaps.openstack.create_network import PortSettings
-import vping_base
+from functest.core.testcase import TestCase
+from functest.opnfv_tests.openstack.vping import vping_base
class VPingUserdata(vping_base.VPingBase):
@@ -142,13 +139,3 @@ def _get_userdata(test_ip):
" sleep 1\n"
"done\n" % test_ip)
return None
-
-
-if __name__ == '__main__':
- args_parser = argparse.ArgumentParser()
- args_parser.add_argument("-r", "--report",
- help="Create json result file",
- action="store_true")
- args = vars(args_parser.parse_args())
-
- sys.exit(vping_base.VPingMain(VPingUserdata).main(**args))
diff --git a/functest/opnfv_tests/sdn/onos/sfc/sfc.py b/functest/opnfv_tests/sdn/onos/sfc/sfc.py
index a2dd7e9a..2bb9082c 100755..100644
--- a/functest/opnfv_tests/sdn/onos/sfc/sfc.py
+++ b/functest/opnfv_tests/sdn/onos/sfc/sfc.py
@@ -165,14 +165,10 @@ def PushDB(status, info):
def main():
"""Script to Test the SFC scenarios in ONOS."""
+ logging.basicConfig()
PreConfig()
CreateNodes()
ConfigSfc()
VerifySfcTraffic()
CleanUp()
PushDB("PASS", "")
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- main()