From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0D833568C for ; Mon, 10 Aug 2015 10:50:37 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Aug 2015 01:50:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,644,1432623600"; d="scan'208";a="780342133" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 10 Aug 2015 01:50:37 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t7A8oZRE002158; Mon, 10 Aug 2015 16:50:35 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t7A8oWGv010434; Mon, 10 Aug 2015 16:50:35 +0800 Received: (from yliu84x@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t7A8oWcI010430; Mon, 10 Aug 2015 16:50:32 +0800 From: Yong Liu To: dts@dpdk.org Date: Mon, 10 Aug 2015 16:50:23 +0800 Message-Id: <1439196624-10377-4-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1439196624-10377-1-git-send-email-yong.liu@intel.com> References: <1439196624-10377-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 3/4] Load configuration file replace of import object X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2015 08:50:38 -0000 From: Marvin Liu Support configuration file based ixia options. Signed-off-by: Marvin Liu 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