test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 3/4] Load configuration file replace of import object
Date: Mon, 10 Aug 2015 16:50:23 +0800	[thread overview]
Message-ID: <1439196624-10377-4-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1439196624-10377-1-git-send-email-yong.liu@intel.com>

From: Marvin Liu <yong.liu@intel.com>

Support configuration file based ixia options.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/etgen.py b/framework/etgen.py
index 1803a1f..508439b 100644
--- a/framework/etgen.py
+++ b/framework/etgen.py
@@ -33,7 +33,7 @@ import re
 import string
 import time
 import dts
-import ixiacfg
+from config import IxiaConf
 from ssh_connection import SSHConnection
 from settings import SCAPY2IXIA
 from logger import getLogger
@@ -147,16 +147,19 @@ class IxiaPacketGenerator(SSHConnection):
         self.conRelation = {}
 
         ixiaRef = self.tester.get_external_traffic_generator()
-        if ixiaRef is None or ixiaRef not in ixiacfg.ixiaPorts:
+
+        ixiacfg = IxiaConf()
+        ixiaPorts = ixiacfg.load_ixia_config()
+        if ixiaRef is None or ixiaRef not in ixiaPorts:
             return
 
-        self.ixiaVersion = ixiacfg.ixiaPorts[ixiaRef]["Version"]
-        self.ports = ixiacfg.ixiaPorts[ixiaRef]["Ports"]
+        self.ixiaVersion = ixiaPorts[ixiaRef]["Version"]
+        self.ports = ixiaPorts[ixiaRef]["Ports"]
 
         self.logger.info(self.ixiaVersion)
         self.logger.info(self.ports)
 
-        self.tclServerIP = ixiacfg.ixiaPorts[ixiaRef]["IP"]
+        self.tclServerIP = ixiaPorts[ixiaRef]["IP"]
 
         # prepare tcl shell and ixia library
         self.send_expect("tclsh", "% ")
-- 
1.9.3

  parent reply	other threads:[~2015-08-10  8:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10  8:50 [dts] [PATCH 0/4] Load Ixia information for configuration file Yong Liu
2015-08-10  8:50 ` [dts] [PATCH 1/4] Support load ixia " Yong Liu
2015-08-10  8:50 ` [dts] [PATCH 2/4] Add " Yong Liu
2015-08-10  8:50 ` Yong Liu [this message]
2015-08-10  8:50 ` [dts] [PATCH 4/4] Remove useless file ixiacfg.py Yong Liu

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=1439196624-10377-4-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).