test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [next][PATCH V1 7/14] framework/pktgen: initialize pktgen logger
Date: Sun, 28 Apr 2019 10:49:04 +0800	[thread overview]
Message-ID: <1556419751-41723-8-git-send-email-yufengx.mo@intel.com> (raw)
In-Reply-To: <1556419751-41723-1-git-send-email-yufengx.mo@intel.com>


initialize pktgen logger

Set packet generator logger name and add check condition for ixia/etgen logger.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/dts.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/framework/dts.py b/framework/dts.py
index b6f91b7..7a1200b 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -1,6 +1,6 @@
 # BSD LICENSE
 #
-# Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+# Copyright(c) 2010-2019 Intel Corporation. All rights reserved.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,6 @@ import sys
 reload(sys)
 sys.setdefaultencoding('UTF8')
 
-
 requested_tests = None
 result = None
 excel_report = None
@@ -244,8 +243,13 @@ def dts_log_testsuite(duts, tester, suite_obj, log_handler, test_classname):
 
     try:
         if tester.it_uses_external_generator():
-            getattr(tester, 'ixia_packet_gen')
-            tester.ixia_packet_gen.logger.config_suite(test_classname, 'ixia')
+            if tester.is_pktgen and \
+               hasattr(tester, 'pktgen') and \
+               getattr(tester, 'pktgen'):
+                tester.pktgen.logger.config_suite(test_classname, 'pktgen')
+            elif hasattr(tester, 'ixia_packet_gen') and \
+                 getattr(tester, 'ixia_packet_gen'):
+                tester.ixia_packet_gen.logger.config_suite(test_classname, 'ixia')
     except Exception as ex:
         pass
 
@@ -262,8 +266,13 @@ def dts_log_execution(duts, tester, log_handler):
 
     try:
         if tester.it_uses_external_generator():
-            getattr(tester, 'ixia_packet_gen')
-            tester.ixia_packet_gen.logger.config_execution('ixia')
+            if tester.is_pktgen and \
+               hasattr(tester, 'pktgen') and \
+               getattr(tester, 'pktgen'):
+                tester.pktgen.logger.config_execution('pktgen')
+            elif hasattr(tester, 'ixia_packet_gen') and \
+                 getattr(tester, 'ixia_packet_gen'):
+                tester.ixia_packet_gen.logger.config_execution('ixia')
     except Exception as ex:
         pass
 
-- 
1.9.3


  parent reply	other threads:[~2019-04-28  2:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28  2:48 [dts] [next][PATCH V1 0/14] [dts/pktgen]: dts packet generator api yufengmx
2019-04-28  2:48 ` [dts] [next][PATCH V1 1/14] conf/pktgen: add pktgen key word in crbs.cfg yufengmx
2019-04-28  2:48 ` [dts] [next][PATCH V1 2/14] conf/pktgen: packet generator configure file definition yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 3/14] doc/pktgen: trex tool known issues yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 4/14] doc/pktgen: migrate from etgen api to pktgen api yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 5/14] doc/pktgen: pktgen api program guide document yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 6/14] framework/pktgen: packet generator configure file parse yufengmx
2019-04-28  2:49 ` yufengmx [this message]
2019-04-28  2:49 ` [dts] [next][PATCH V1 8/14] framework/pktgen: packet generator base class yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 9/14] framework/pktgen: ixia packet generator relevant classes yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 0/14] framework/pktgen: trex " yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 1/14] framework/pktgen: pktgen instance creation and helper yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 2/14] framework/pktgen: packet generator types definition yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 3/14] framework/pktgen: packet generator init and trex port yufengmx
2019-04-28  2:49 ` [dts] [next][PATCH V1 4/14] framework/pktgen: utils methods yufengmx
2019-05-29  2:45 ` [dts] [next][PATCH V1 0/14] [dts/pktgen]: dts packet generator api Tu, Lijuan

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=1556419751-41723-8-git-send-email-yufengx.mo@intel.com \
    --to=yufengx.mo@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).