test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 6/8] framework dts: close netdevice related session after exit
Date: Sun, 13 Dec 2015 12:57:42 +0800	[thread overview]
Message-ID: <1449982664-4362-7-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1449982664-4362-1-git-send-email-yong.liu@intel.com>

From: Marvin Liu <yong.liu@intel.com>

Net device will also created sessions. dts module should also close
those sessions.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

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

  parent reply	other threads:[~2015-12-13  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13  4:57 [dts] [RFC PATCH 0/8] support fm10k family nics Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 1/8] framework settings: rename nic_name_from_type to get_nic_name Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 2/8] framework crb: add function to retrieve port information Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 3/8] framework: create independent foler for nic modules Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 4/8] nics: add fm10k module for RedRockCanYou family nic Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 5/8] framework: net device object get from net_device module Yong Liu
2015-12-13  4:57 ` Yong Liu [this message]
2015-12-13  4:57 ` [dts] [PATCH 7/8] conf: add sample for RedRockCanYou family nic Yong Liu
2015-12-13  4:57 ` [dts] [PATCH 8/8] framework project_dpdk: add extra setup after bind driver Yong Liu
2015-12-14  1:34 ` [dts] [RFC PATCH 0/8] support fm10k family nics Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449982664-4362-7-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).