Change debug mode for commands that generate too much output in sec_scan
authorjose.lausuch <jose.lausuch@ericsson.com>
Thu, 1 Sep 2016 16:03:25 +0000 (18:03 +0200)
committerJose Lausuch <jose.lausuch@ericsson.com>
Thu, 1 Sep 2016 16:07:31 +0000 (16:07 +0000)
The security scan test case generates sometimes too much output
messages and makes Jenkins unreadable.
For example:
https://build.opnfv.org/ci/job/functest-apex-apex-daily-colorado-daily-colorado/65/console

80% of the output belongs to this test case.
This patch will reduce it since debug information is not
showed in Jenkins but it is pushed as part of
functest.log to artifacts.

Change-Id: I56b3adf87d302d118ee5c15eb86bc10237a7cc4e
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
testcases/security_scan/security_scan.py

index 7b92502..ac7b78e 100755 (executable)
 # nominated node. Post scan a report is downloaded and if '--clean' is passed
 # all trace of the scan is removed from the remote system.
 
+
+import argparse
+import connect
 import datetime
 import os
 import sys
-from ConfigParser import SafeConfigParser
 
-import argparse
+from ConfigParser import SafeConfigParser
 from functest.utils.functest_utils import FUNCTEST_REPO as FUNCTEST_REPO
 from keystoneclient import session
 from keystoneclient.auth.identity import v2
 from novaclient import client
 
-import connect
 
 __version__ = 0.1
 __author__ = 'Luke Hinds (lhinds@redhat.com)'
@@ -80,16 +81,16 @@ def run_tests(host, nodetype):
         connect.logger.info("Internet Connection OK.")
         connect.logger.info("Creating temp file structure..")
         createfiles(host, port, user, localkey)
-        connect.logger.info("Installing OpenSCAP...")
+        connect.logger.debug("Installing OpenSCAP...")
         install_pkg(host, port, user, localkey)
-        connect.logger.info("Running scan...")
+        connect.logger.debug("Running scan...")
         run_scanner(host, port, user, localkey, nodetype)
         clean = cfgparse.get(nodetype, 'clean')
         connect.logger.info("Post installation tasks....")
         post_tasks(host, port, user, localkey, nodetype)
         if clean:
             connect.logger.info("Cleaning down environment....")
-            connect.logger.info("Removing OpenSCAP....")
+            connect.logger.debug("Removing OpenSCAP....")
             removepkg(host, port, user, localkey, nodetype)
             connect.logger.info("Deleting tmp file and reports (remote)...")
             cleandir(host, port, user, localkey, nodetype)