From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 461412C06 for ; Fri, 28 Oct 2016 04:08:49 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 27 Oct 2016 19:08:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,406,1473145200"; d="scan'208";a="894925406" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 27 Oct 2016 19:08:47 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u9S28gjH029287; Fri, 28 Oct 2016 10:08:42 +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 u9S28euB028335; Fri, 28 Oct 2016 10:08:42 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u9S28eNG028331; Fri, 28 Oct 2016 10:08:40 +0800 From: Marvin Liu To: dts@dpdk.org Date: Fri, 28 Oct 2016 10:08:39 +0800 Message-Id: <1477620519-28299-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH] framework test_case: recover all dut ports before execution 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: Fri, 28 Oct 2016 02:08:49 -0000 Bind all dut ports to configured driver before suite execution. This will help when some suites forgot to recover nic driver. Signed-off-by: Marvin Liu diff --git a/framework/test_case.py b/framework/test_case.py index 85fdb70..7a14d4d 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -60,12 +60,20 @@ class TestCase(object): self.logger.config_suite(class_name) # local variable self._requested_tests = None + self.drivername = load_global_setting(HOST_DRIVER_SETTING) # check session and reconnect if possible for dutobj in self.duts: self._check_and_reconnect(crb=dutobj) self._check_and_reconnect(crb=self.tester) + # try to recover all dut ports + for portid in range(len(self.dut.ports_info)): + port = self.dut.ports_info[portid]['port'] + if len(port.get_sriov_vfs_pci()): + port.destroy_sriov_vfs() + port.bind_driver(self.drivername) + # covert netdevice to codename self.nics = [] for portid in range(len(self.dut.ports_info)): @@ -107,7 +115,6 @@ class TestCase(object): else: self._debug_case = False - self.drivername = load_global_setting(HOST_DRIVER_SETTING) # create rst format report for this suite self._rst_obj = RstReport('rst_report', target, self.nic, self.suite_name, self._enable_perf) -- 1.9.1