From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C9BFCA045E for ; Thu, 30 May 2019 09:22:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6AE222B9A; Thu, 30 May 2019 09:22:06 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id A8AF01B05 for ; Thu, 30 May 2019 09:22:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 00:22:03 -0700 X-ExtLoop1: 1 Received: from ubuntu.sh.intel.com ([10.67.118.150]) by FMSMGA003.fm.intel.com with ESMTP; 30 May 2019 00:22:03 -0700 From: lihong To: dts@dpdk.org Cc: zhaoyan.chen@intel.com, lihong Date: Thu, 30 May 2019 08:00:41 +0800 Message-Id: <1559174441-16091-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] framework: add set_env_variable when reconnet dut 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" When dts lost the session with DUT, it will try to reconnet to DUT, but it will lose the env config, so add the env config when reconnet to DUT. Signed-off-by: lihong --- framework/project_dpdk.py | 11 +++++++---- framework/test_case.py | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 6035c68..f113f3e 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -64,10 +64,7 @@ class DPDKdut(Dut): self.set_toolchain(target) # set env variable - # These have to be setup all the time. Some tests need to compile - # example apps by themselves and will fail otherwise. - self.send_expect("export RTE_TARGET=" + target, "#") - self.send_expect("export RTE_SDK=`pwd`", "#") + self.set_env_variable() self.set_rxtx_mode() @@ -88,6 +85,12 @@ class DPDKdut(Dut): self.bind_interfaces_linux(drivername) self.extra_nic_setup() + def set_env_variable(self): + # These have to be setup all the time. Some tests need to compile + # example apps by themselves and will fail otherwise. + self.send_expect("export RTE_TARGET=" + self.target, "#") + self.send_expect("export RTE_SDK=`pwd`", "#") + def setup_modules(self, target, drivername, drivermode): """ Install DPDK required kernel module on DUT. diff --git a/framework/test_case.py b/framework/test_case.py index 27d236b..c028492 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -135,6 +135,7 @@ class TestCase(object): crb.reconnect_session() if 'dut' in str(type(crb)): crb.send_expect("cd %s" % crb.base_dir, "#") + crb.set_env_variable() try: result = crb.alt_session.check_available() -- 2.7.4