From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 547EA8D9B for ; Sun, 13 Dec 2015 05:58:04 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 12 Dec 2015 20:58:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,420,1444719600"; d="scan'208";a="859643034" Received: from shilc102.sh.intel.com ([10.239.39.44]) by fmsmga001.fm.intel.com with ESMTP; 12 Dec 2015 20:58:03 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shilc102.sh.intel.com with ESMTP id tBD4w1CO003205; Sun, 13 Dec 2015 12:58:01 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tBD4vxxK004440; Sun, 13 Dec 2015 12:58:01 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id tBD4vxxO004436; Sun, 13 Dec 2015 12:57:59 +0800 From: Yong Liu To: dts@dpdk.org Date: Sun, 13 Dec 2015 12:57:42 +0800 Message-Id: <1449982664-4362-7-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1449982664-4362-1-git-send-email-yong.liu@intel.com> References: <1449982664-4362-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 6/8] framework dts: close netdevice related session after exit 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: Sun, 13 Dec 2015 04:58:04 -0000 From: Marvin Liu Net device will also created sessions. dts module should also close those sessions. Signed-off-by: Marvin Liu diff --git a/framework/dts.py b/framework/dts.py index 30c39ab..8e0be62 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -41,9 +41,10 @@ import signal # signal module for debug mode import time # time module for unique output folder import rst # rst file support +import sys # system module +from settings import FOLDERS, NICS from tester import Tester from dut import Dut -from settings import FOLDERS, NICS, DRIVERS from serializer import Serializer from exception import VerifyFailure from test_case import TestCase @@ -99,10 +100,15 @@ def report(text, frame=False, annex=False): rst.write_text(text, annex) -def close_crb_sessions(): +def close_all_sessions(): """ Close session to DUT and tester. """ + # close all nics + for port_info in dut.ports_info: + netdev = port_info['port'] + netdev.close() + # close all session if dut is not None: dut.close() if tester is not None: @@ -418,8 +424,6 @@ def run_all(config_file, pkgName, git, patch, skip_setup, os.mkdir(output_dir) # add python module search path - for folder in FOLDERS.values(): - sys.path.append(folder) sys.path.append(suite_dir) # enable debug mode @@ -446,7 +450,7 @@ def run_all(config_file, pkgName, git, patch, skip_setup, raise ConfigParseException(config_file) # register exit action - atexit.register(close_crb_sessions) + atexit.register(close_all_sessions) os.environ["TERM"] = "dumb" -- 1.9.3