aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/check_os.sh24
-rw-r--r--functest/ci/config_functest.yaml2
-rw-r--r--[-rwxr-xr-x]functest/ci/generate_report.py9
-rw-r--r--functest/ci/logging.ini70
-rw-r--r--functest/ci/logging.json29
-rwxr-xr-xfunctest/ci/prepare_env.py7
-rwxr-xr-xfunctest/ci/run_tests.py10
7 files changed, 84 insertions, 67 deletions
diff --git a/functest/ci/check_os.sh b/functest/ci/check_os.sh
index 83f9f476..ce0bc20c 100755
--- a/functest/ci/check_os.sh
+++ b/functest/ci/check_os.sh
@@ -86,30 +86,6 @@ if [ $RETVAL -ne 0 ]; then
fi
echo " ...OK"
-adminURL=$(openstack catalog show identity |awk '/admin/ {print $4}')
-if [ -z ${adminURL} ]; then
- echo "ERROR: Cannot determine the admin URL."
- openstack catalog show identity
- exit 1
-fi
-adminIP=$(echo $adminURL|sed 's/^.*http.*\:\/\///'|sed 's/.[^:]*$//')
-adminPort=$(echo $adminURL|grep -Po '(?<=:)\d+')
-https_enabled=$(echo $adminURL | grep 'https')
-if [[ -n $https_enabled ]]; then
- echo ">>Verifying SSL connectivity to the admin endpoint $adminIP:$adminPort..."
- verify_SSL_connectivity $adminIP $adminPort
-else
- echo ">>Verifying connectivity to the admin endpoint $adminIP:$adminPort..."
- verify_connectivity $adminIP $adminPort
-fi
-RETVAL=$?
-if [ $RETVAL -ne 0 ]; then
- echo "ERROR: Cannot talk to the admin endpoint $adminIP:$adminPort ."
- echo "$adminURL"
- exit 1
-fi
-echo " ...OK"
-
echo "Checking Required OpenStack services:"
for service in $MANDATORY_SERVICES; do
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index f291cf1f..fd663abc 100644
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -34,7 +34,7 @@ general:
functest: /home/opnfv/functest
functest_test: /home/opnfv/repos/functest/functest/opnfv_tests
results: /home/opnfv/functest/results
- functest_logging_cfg: /home/opnfv/repos/functest/functest/ci/logging.json
+ functest_logging_cfg: /home/opnfv/repos/functest/functest/ci/logging.ini
functest_conf: /home/opnfv/functest/conf
functest_data: /home/opnfv/functest/data
ims_data: /home/opnfv/functest/data/ims/
diff --git a/functest/ci/generate_report.py b/functest/ci/generate_report.py
index 3872a07e..7a25fd95 100755..100644
--- a/functest/ci/generate_report.py
+++ b/functest/ci/generate_report.py
@@ -6,10 +6,10 @@
# http://www.apache.org/licenses/LICENSE-2.0
#
import json
+import logging
import re
import urllib2
-import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
from functest.utils.constants import CONST
@@ -23,7 +23,7 @@ COL_5_LEN = 75
# and then we can print the url to the specific test result
-logger = ft_logger.Logger("generate_report").getLogger()
+logger = logging.getLogger(__name__)
def init(tiers_to_run=[]):
@@ -146,8 +146,3 @@ def main(args=[]):
str += print_separator('-')
logger.info("\n\n\n%s" % str)
-
-
-if __name__ == '__main__':
- import sys
- main(sys.argv[1:])
diff --git a/functest/ci/logging.ini b/functest/ci/logging.ini
new file mode 100644
index 00000000..8036ed29
--- /dev/null
+++ b/functest/ci/logging.ini
@@ -0,0 +1,70 @@
+[loggers]
+keys=root,functest,ci,cli,core,opnfv_tests,utils
+
+[handlers]
+keys=console,wconsole,file,null
+
+[formatters]
+keys=standard
+
+[logger_root]
+level=NOTSET
+handlers=null
+
+[logger_functest]
+level=NOTSET
+handlers=file
+qualname=functest
+
+[logger_ci]
+level=NOTSET
+handlers=console
+qualname=functest.ci
+
+[logger_cli]
+level=NOTSET
+handlers=wconsole
+qualname=functest.cli
+
+[logger_core]
+level=NOTSET
+handlers=console
+qualname=functest.core
+
+[logger_opnfv_tests]
+level=NOTSET
+handlers=wconsole
+qualname=functest.opnfv_tests
+
+[logger_utils]
+level=NOTSET
+handlers=wconsole
+qualname=functest.utils
+
+[handler_null]
+class=NullHandler
+level=NOTSET
+formatter=standard
+args=()
+
+[handler_console]
+class=StreamHandler
+level=INFO
+formatter=standard
+args=(sys.stdout,)
+
+[handler_wconsole]
+class=StreamHandler
+level=WARN
+formatter=standard
+args=(sys.stdout,)
+
+[handler_file]
+class=FileHandler
+level=DEBUG
+formatter=standard
+args=("/home/opnfv/functest/results/functest.log",)
+
+[formatter_standard]
+format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+datefmt=
diff --git a/functest/ci/logging.json b/functest/ci/logging.json
deleted file mode 100644
index 2a2399d3..00000000
--- a/functest/ci/logging.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "version": 1,
- "disable_existing_loggers": false,
- "formatters": {
- "standard": {
- "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
- }
- },
- "handlers": {
- "console": {
- "level": "INFO",
- "class": "logging.StreamHandler",
- "formatter": "standard"
- },
- "file": {
- "level": "DEBUG",
- "class": "logging.FileHandler",
- "formatter": "standard",
- "filename": "/home/opnfv/functest/results/functest.log"
- }
- },
- "loggers": {
- "": {
- "handlers": ["console", "file"],
- "level": "DEBUG",
- "propagate": "yes"
- }
- }
-}
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py
index e9a470f9..08badf17 100755
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -8,6 +8,8 @@
import argparse
import json
+import logging
+import logging.config
import os
import re
import subprocess
@@ -16,7 +18,6 @@ import fileinput
import yaml
-import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
from functest.utils.constants import CONST
@@ -27,7 +28,7 @@ from opnfv.deployment import factory
actions = ['start', 'check']
""" logging configuration """
-logger = ft_logger.Logger("prepare_env").getLogger()
+logger = logging.getLogger('functest.ci.prepare_env')
handler = None
# set the architecture to default
pod_arch = None
@@ -377,6 +378,8 @@ def main(**kwargs):
if __name__ == '__main__':
+ logging.config.fileConfig(
+ CONST.__getattribute__('dir_functest_logging_cfg'))
parser = PrepareEnvParser()
args = parser.parse_args(sys.argv[1:])
sys.exit(main(**args))
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index e68901b8..d1361260 100755
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -12,6 +12,8 @@ import argparse
import datetime
import enum
import importlib
+import logging
+import logging.config
import os
import re
import sys
@@ -19,16 +21,14 @@ import sys
import functest.ci.generate_report as generate_report
import functest.ci.tier_builder as tb
import functest.core.testcase as testcase
-import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_clean as os_clean
import functest.utils.openstack_snapshot as os_snapshot
import functest.utils.openstack_utils as os_utils
from functest.utils.constants import CONST
-
-""" logging configuration """
-logger = ft_logger.Logger("run_tests").getLogger()
+# __name__ cannot be used here
+logger = logging.getLogger('functest.ci.run_tests')
class Result(enum.Enum):
@@ -270,6 +270,8 @@ def main(**kwargs):
if __name__ == '__main__':
+ logging.config.fileConfig(
+ CONST.__getattribute__('dir_functest_logging_cfg'))
parser = RunTestsParser()
args = parser.parse_args(sys.argv[1:])
sys.exit(main(**args).value)