summaryrefslogtreecommitdiffstats
path: root/sfc/tests
diff options
context:
space:
mode:
authorPanagiotis Karalis <pkaralis@intracom-telecom.com>2018-05-25 11:53:57 +0300
committerPanagiotis Karalis <pkaralis@intracom-telecom.com>2018-06-05 16:44:22 +0300
commit7d4bbcc9fe1819f11c7b757f8c074db488baee4b (patch)
treef21353c0318bdee7985df80e86a309025ec42708 /sfc/tests
parent7f8a775dec72e03d6cae2400b7a49d7a097c8957 (diff)
Fix the logging to be compatible with functest
In order to collect logs from SFC test scenarios running through functest framework (mainly for troubleshooting purposes), the logging mechanism has been updated accordingly. JIRA: SFC-125 Change-Id: Ide7c32519afa6ece299d0ac1dcb168609a2e3945 Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
Diffstat (limited to 'sfc/tests')
-rw-r--r--sfc/tests/functest/run_sfc_tests.py12
-rw-r--r--sfc/tests/functest/sfc_chain_deletion.py5
-rw-r--r--sfc/tests/functest/sfc_one_chain_two_service_functions.py5
-rw-r--r--sfc/tests/functest/sfc_symmetric_chain.py5
-rw-r--r--sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py6
5 files changed, 19 insertions, 14 deletions
diff --git a/sfc/tests/functest/run_sfc_tests.py b/sfc/tests/functest/run_sfc_tests.py
index dba73b98..be407514 100644
--- a/sfc/tests/functest/run_sfc_tests.py
+++ b/sfc/tests/functest/run_sfc_tests.py
@@ -11,20 +11,19 @@
import importlib
import os
import time
-import yaml
+import logging
import sys
+import yaml
-from xtesting.core import testcase
+from collections import OrderedDict
from opnfv.utils import ovs_logger as ovs_log
-from opnfv.utils import opnfv_logger as logger
from opnfv.deployment.factory import Factory as DeploymentFactory
from sfc.lib import cleanup as sfc_cleanup
from sfc.lib import config as sfc_config
from sfc.lib import odl_utils as odl_utils
+from xtesting.core import testcase
-from collections import OrderedDict
-
-logger = logger.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
COMMON_CONFIG = sfc_config.CommonConfig()
@@ -188,5 +187,6 @@ class SfcFunctest(testcase.TestCase):
def main():
+ logging.basicConfig(level=logging.INFO)
SFC = SfcFunctest()
sys.exit(SFC.run())
diff --git a/sfc/tests/functest/sfc_chain_deletion.py b/sfc/tests/functest/sfc_chain_deletion.py
index 700b39a3..623bca77 100644
--- a/sfc/tests/functest/sfc_chain_deletion.py
+++ b/sfc/tests/functest/sfc_chain_deletion.py
@@ -11,6 +11,8 @@
import os
import sys
import threading
+import logging
+
import sfc.lib.openstack_utils as os_sfc_utils
import sfc.lib.odl_utils as odl_utils
import opnfv.utils.ovs_logger as ovs_log
@@ -18,11 +20,10 @@ import sfc.lib.topology_shuffler as topo_shuffler
import sfc.lib.config as sfc_config
import sfc.lib.test_utils as test_utils
-from opnfv.utils import opnfv_logger as logger
from sfc.lib.results import Results
from opnfv.deployment.factory import Factory as DeploymentFactory
-logger = logger.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
CLIENT = "client"
SERVER = "server"
diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions.py b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
index e2f423ef..21d37d18 100644
--- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py
+++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
@@ -10,6 +10,8 @@
import os
import sys
import threading
+import logging
+
import sfc.lib.openstack_utils as os_sfc_utils
import sfc.lib.odl_utils as odl_utils
import opnfv.utils.ovs_logger as ovs_log
@@ -17,12 +19,11 @@ import sfc.lib.config as sfc_config
import sfc.lib.test_utils as test_utils
import sfc.lib.topology_shuffler as topo_shuffler
-from opnfv.utils import opnfv_logger as logger
from sfc.lib.results import Results
from opnfv.deployment.factory import Factory as DeploymentFactory
""" logging configuration """
-logger = logger.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
CLIENT = "client"
SERVER = "server"
diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py
index 4ee45047..1085e071 100644
--- a/sfc/tests/functest/sfc_symmetric_chain.py
+++ b/sfc/tests/functest/sfc_symmetric_chain.py
@@ -12,6 +12,8 @@
import os
import sys
import threading
+import logging
+
import sfc.lib.openstack_utils as os_sfc_utils
import sfc.lib.odl_utils as odl_utils
import opnfv.utils.ovs_logger as ovs_log
@@ -19,12 +21,11 @@ import sfc.lib.config as sfc_config
import sfc.lib.test_utils as test_utils
import sfc.lib.topology_shuffler as topo_shuffler
-from opnfv.utils import opnfv_logger as logger
from sfc.lib.results import Results
from opnfv.deployment.factory import Factory as DeploymentFactory
""" logging configuration """
-logger = logger.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
CLIENT = "client"
SERVER = "server"
diff --git a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
index a57fa745..b9a22baf 100644
--- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
+++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
@@ -11,6 +11,8 @@
import os
import sys
import threading
+import logging
+
import sfc.lib.openstack_utils as os_sfc_utils
import sfc.lib.odl_utils as odl_utils
import opnfv.utils.ovs_logger as ovs_log
@@ -18,12 +20,12 @@ import sfc.lib.config as sfc_config
import sfc.lib.test_utils as test_utils
import sfc.lib.topology_shuffler as topo_shuffler
-from opnfv.utils import opnfv_logger as logger
from sfc.lib.results import Results
from opnfv.deployment.factory import Factory as DeploymentFactory
+
""" logging configuration """
-logger = logger.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
CLIENT = "client"
SERVER = "server"