From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E37CA04F7; Wed, 25 Dec 2019 07:28:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 146951B203; Wed, 25 Dec 2019 07:28:29 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 16B6534EF for ; Wed, 25 Dec 2019 07:28:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Dec 2019 22:28:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,353,1571727600"; d="scan'208";a="419175212" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by fmsmga006.fm.intel.com with ESMTP; 24 Dec 2019 22:28:25 -0800 From: lihong To: dts@dpdk.org Cc: lihong Date: Wed, 25 Dec 2019 07:01:30 +0800 Message-Id: <1577228490-25826-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] framework/dts: close session if init pktgen failed 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" Signed-off-by: lihong --- framework/dts.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/framework/dts.py b/framework/dts.py index f1e57bd..634a569 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -304,7 +304,14 @@ def dts_crbs_init(crbInsts, skip_setup, read_cache, project, base_dir, serialize tester.duts = duts show_speedup_options_messages(read_cache, skip_setup) tester.set_speedup_options(read_cache, skip_setup) - tester.init_ext_gen() + try: + tester.init_ext_gen() + except Exception as e: + log_handler.error(str(e)) + tester.close() + for dutobj in duts: + dutobj.close() + raise e nic = settings.load_global_setting(settings.HOST_NIC_SETTING) for dutobj in duts: -- 2.7.4