From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] Change output folder path and optimize virt dut log
Date: Mon, 6 Jul 2015 13:04:16 +0800 [thread overview]
Message-ID: <1436159056-1443-1-git-send-email-yong.liu@intel.com> (raw)
From: Marvin Liu <yong.liu@intel.com>
Previously all output files will be saved in output folder dts.log and
"suite.log". The log information will be appended in the log file. The log
file will be huge and difficult to trace after running dts several times.
Now log files will be saved in output/folder_name_by_time.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/framework/dts.py b/framework/dts.py
index b843f22..c4f4663 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -38,6 +38,7 @@ import inspect # load attribute
import atexit # register callback when exit
import json # json format
import signal # signal module for debug mode
+import time # time module for unique output folder
import rst # rst file support
from crbs import crbs
@@ -74,6 +75,7 @@ functional_only = False
nic = None
requested_tests = None
dut = None
+duts = None
tester = None
result = None
excel_report = None
@@ -192,11 +194,15 @@ def dts_log_testsuite(test_suite, log_handler, test_classname):
"""
Change to SUITE self logger handler.
"""
+ global duts
test_suite.logger = getLogger(test_classname)
test_suite.logger.config_suite(test_classname)
log_handler.config_suite(test_classname, 'dts')
dut.logger.config_suite(test_classname, 'dut')
tester.logger.config_suite(test_classname, 'tester')
+ if duts and len(duts):
+ for crb in duts:
+ crb.logger.config_suite(test_classname, 'virtdut')
try:
if tester.it_uses_external_generator():
getattr(tester, 'ixia_packet_gen')
@@ -212,6 +218,9 @@ def dts_log_execution(log_handler):
log_handler.config_execution('dts')
dut.logger.config_execution('dut')
tester.logger.config_execution('tester')
+ if duts and len(duts):
+ for crb in duts:
+ crb.logger.config_execution('virtdut')
try:
if tester.it_uses_external_generator():
getattr(tester, 'ixia_packet_gen')
@@ -279,8 +288,8 @@ def dts_run_target(crbInst, targets, test_suites, nic, scenario):
scene = None
if scene:
- scene.load_config()
- scene.create_scene()
+ scene.load_config()
+ scene.create_scene()
for target in targets:
log_handler.info("\nTARGET " + target)
@@ -332,6 +341,7 @@ def dts_run_suite(crbInst, test_suites, target, nic, scene):
for test_classname, test_class in get_subclasses(test_module, TestCase):
if scene and scene.vm_dut_enable:
+ global duts
duts = scene.get_vm_duts()
tester.dut = duts[0]
test_suite = test_class(duts[0], tester, target, test_suite)
@@ -389,6 +399,9 @@ def run_all(config_file, pkgName, git, patch, skip_setup,
Patches = patch
# prepare the output folder
+ if output_dir == '':
+ output_dir = time.strftime("output/%Y_%m_%d_%H_%M_%S")
+
if not os.path.exists(output_dir):
os.mkdir(output_dir)
diff --git a/framework/main.py b/framework/main.py
index 6b771a5..69d2318 100755
--- a/framework/main.py
+++ b/framework/main.py
@@ -84,7 +84,7 @@ parser.add_argument('--snapshot',
help='snapshot .tgz file to use as input')
parser.add_argument('--output',
- default='output',
+ default='',
help='Output directory where dts log and result saved')
parser.add_argument('-s', '--skip-setup',
diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index 2edbf6f..5e4d212 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -63,7 +63,7 @@ class VirtDut(DPDKdut):
# load port config from suite cfg
self.suite = suite
self.logger = getLogger(self.NAME)
- self.logger.config_execution('vmdut')
+ self.logger.config_suite(suite, 'virtdut')
self.session = SSHConnection(self.vm_ip, self.NAME,
self.get_password())
self.session.init_log(self.logger)
--
1.9.3
next reply other threads:[~2015-07-06 5:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 5:04 Yong Liu [this message]
2015-07-09 7:58 ` Tang, HaifengX
2015-07-09 7:59 ` Liu, Yong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436159056-1443-1-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).