summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpanageo2 <panageo@intracom-telecom.com>2017-07-25 11:09:34 +0000
committerpanageo2 <panageo@intracom-telecom.com>2017-07-25 11:22:32 +0000
commit9815cc6597daa6f50a38a04579036e3eeb5c79a2 (patch)
tree21ff71d6e4e43b5d447b68b5b3eced9d6dc42fe3
parent3752ba88c0abdf35f3a4f5e20849ddd4dcf3277a (diff)
Refactor imports and invocation of main function
In all testcases there are some inconcistencies of import statements. Additionally the main function of each testcase should be called through sys.exit(main()) JIRA: SDNVPN-173 Change-Id: I6fdf0dc6598ca4789b6de6b50d1b8b85a8de923c Signed-off-by: panageo2 <panageo@intracom-telecom.com>
-rw-r--r--sdnvpn/test/functest/testcase_1.py10
-rw-r--r--sdnvpn/test/functest/testcase_2.py11
-rw-r--r--sdnvpn/test/functest/testcase_3.py16
-rw-r--r--sdnvpn/test/functest/testcase_4.py10
-rw-r--r--sdnvpn/test/functest/testcase_7.py8
-rw-r--r--sdnvpn/test/functest/testcase_8.py10
-rw-r--r--sdnvpn/test/functest/testcase_9.py6
7 files changed, 35 insertions, 36 deletions
diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py
index 8291151..540fe9a 100644
--- a/sdnvpn/test/functest/testcase_1.py
+++ b/sdnvpn/test/functest/testcase_1.py
@@ -10,12 +10,12 @@
import argparse
import logging
-from random import randint
-
-import functest.utils.openstack_utils as os_utils
+import sys
-from sdnvpn.lib import utils as test_utils
+from functest.utils import openstack_utils as os_utils
+from random import randint
from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
parser = argparse.ArgumentParser()
@@ -222,4 +222,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_2.py b/sdnvpn/test/functest/testcase_2.py
index 0265aee..cea93ce 100644
--- a/sdnvpn/test/functest/testcase_2.py
+++ b/sdnvpn/test/functest/testcase_2.py
@@ -10,14 +10,13 @@
import argparse
import logging
-from random import randint
import sys
-import functest.utils.openstack_utils as os_utils
-
-import sdnvpn.lib.utils as test_utils
+from functest.utils import openstack_utils as os_utils
+from random import randint
+from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
-import sdnvpn.lib.config as sdnvpn_config
parser = argparse.ArgumentParser()
@@ -262,4 +261,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_3.py b/sdnvpn/test/functest/testcase_3.py
index 24d413c..058a270 100644
--- a/sdnvpn/test/functest/testcase_3.py
+++ b/sdnvpn/test/functest/testcase_3.py
@@ -11,17 +11,17 @@
# - Start a BGP router with OpenDaylight
# - Add the functest Quagga as a neighbor
# - Verify that the OpenDaylight and gateway Quagga peer
+
+import argparse
import logging
import os
-import argparse
+import sys
+from functest.utils import functest_utils as ft_utils
+from functest.utils import openstack_utils as os_utils
from sdnvpn.lib import quagga
-import sdnvpn.lib.utils as test_utils
-import sdnvpn.lib.config as sdnvpn_config
-
-import functest.utils.openstack_utils as os_utils
-import functest.utils.functest_utils as ft_utils
-
+from sdnvpn.lib import utils as test_utils
+from sdnvpn.lib import config as sdnvpn_config
from sdnvpn.lib.results import Results
COMMON_CONFIG = sdnvpn_config.CommonConfig()
@@ -287,4 +287,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py
index cff60f1..0ca1563 100644
--- a/sdnvpn/test/functest/testcase_4.py
+++ b/sdnvpn/test/functest/testcase_4.py
@@ -10,12 +10,12 @@
import argparse
import logging
-from random import randint
-
-import functest.utils.openstack_utils as os_utils
+import sys
-from sdnvpn.lib import utils as test_utils
+from functest.utils import openstack_utils as os_utils
+from random import randint
from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
parser = argparse.ArgumentParser()
@@ -228,4 +228,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_7.py b/sdnvpn/test/functest/testcase_7.py
index 21bc12b..607a299 100644
--- a/sdnvpn/test/functest/testcase_7.py
+++ b/sdnvpn/test/functest/testcase_7.py
@@ -20,11 +20,11 @@ network associated:
"""
import argparse
import logging
+import sys
-import functest.utils.openstack_utils as os_utils
-
-from sdnvpn.lib import utils as test_utils
+from functest.utils import openstack_utils as os_utils
from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
parser = argparse.ArgumentParser()
@@ -174,4 +174,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py
index 7738c75..11f13bb 100644
--- a/sdnvpn/test/functest/testcase_8.py
+++ b/sdnvpn/test/functest/testcase_8.py
@@ -20,12 +20,12 @@ Test whether router assoc can coexist with floating IP
"""
import argparse
import logging
+import sys
-import functest.utils.openstack_utils as os_utils
-
-import sdnvpn.lib.utils as test_utils
+from functest.utils import openstack_utils as os_utils
+from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
-import sdnvpn.lib.config as sdnvpn_config
parser = argparse.ArgumentParser()
@@ -176,4 +176,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())
diff --git a/sdnvpn/test/functest/testcase_9.py b/sdnvpn/test/functest/testcase_9.py
index 482ff48..053c02e 100644
--- a/sdnvpn/test/functest/testcase_9.py
+++ b/sdnvpn/test/functest/testcase_9.py
@@ -15,10 +15,10 @@
# - Verify that the OpenDaylight and gateway Quagga peer
import argparse
import logging
+import sys
-from sdnvpn.lib import utils as test_utils
from sdnvpn.lib import config as sdnvpn_config
-
+from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
COMMON_CONFIG = sdnvpn_config.CommonConfig()
@@ -75,4 +75,4 @@ def main():
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
- main()
+ sys.exit(main())