summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2015-08-10 16:50:23 +0800
committerMarvin Liu <yong.liu@intel.com>2015-08-13 16:19:49 +0800
commite27debaa8d5b40938bb2a60da850623fdf0a40f4 (patch)
treeafff01cbda677e6b3c9de3784c6eb1863e4847ad
parent9fd13739eae2cd992099acaa4f89b37b6c3500cc (diff)
downloaddts-e27debaa8d5b40938bb2a60da850623fdf0a40f4.zip
dts-e27debaa8d5b40938bb2a60da850623fdf0a40f4.tar.gz
dts-e27debaa8d5b40938bb2a60da850623fdf0a40f4.tar.xz
Load configuration file replace of import object
Support configuration file based ixia options. Signed-off-by: Marvin Liu <yong.liu@intel.com>
-rw-r--r--framework/etgen.py13
1 files changed, 8 insertions, 5 deletions
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", "% ")