From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D357A2E8B for ; Sat, 1 Apr 2017 09:41:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491032473; x=1522568473; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=DKvyHUcH+MkVBYE2eRlfMxW3fCO2axPd0qLL4vq1KGU=; b=G7enoNZ9cySA2y37oaUTGhb+53tVXO50nstquY/m//+qlOdWMzbVFLqZ 4LrRS0XC3aZkbj2e2scGxXptnX2Chg==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2017 00:41:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,256,1486454400"; d="scan'208";a="1114257775" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 01 Apr 2017 00:41:11 -0700 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Sat, 1 Apr 2017 15:42:32 +0800 Message-Id: <1491032552-118473-5-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1491032552-118473-1-git-send-email-huilongx.xu@intel.com> References: <1491032552-118473-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [PATCH 4/4] add example for test suite 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: Sat, 01 Apr 2017 07:41:13 -0000 add two example for how to use compile config for tests. 1. queque start stop: use dpdk patch 2. core mask: use different compile switch Signed-off-by: xu,huilong --- tests/TestSuite_coremask.py | 12 ++---------- tests/TestSuite_queue_start_stop.py | 28 +++------------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/tests/TestSuite_coremask.py b/tests/TestSuite_coremask.py index a28266a..c33a193 100644 --- a/tests/TestSuite_coremask.py +++ b/tests/TestSuite_coremask.py @@ -39,11 +39,7 @@ class TestCoremask(TestCase): self.mem_channel = self.dut.get_memory_channels() self.all_cores = self.dut.get_core_list("all") - self.dut.send_expect("sed -i -e 's/CONFIG_RTE_LOG_LEVEL=.*$/" - + "CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG/' config/common_base", "# ", 30) - - self.dut.skip_setup = False - self.dut.build_install_dpdk(self.target) + self.dut.reset_compile_target(self.target + '_log_level') def set_up(self): """ @@ -178,8 +174,4 @@ class TestCoremask(TestCase): """ Run after each test suite. """ - self.dut.send_expect("sed -i -e 's/CONFIG_RTE_LOG_LEVEL=.*$/" - + "CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO/' config/common_base", "# ", 30) - - #self.dut.skip_setup = False - self.dut.build_install_dpdk(self.target) + self.dut.reset_compile_target() diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py index d1df66b..b24f47b 100644 --- a/tests/TestSuite_queue_start_stop.py +++ b/tests/TestSuite_queue_start_stop.py @@ -70,22 +70,7 @@ class TestQueueStartStop(TestCase): """ Run before each test case. """ - try: - patch_file = FOLDERS["Depends"] + r'/macfwd_log.patch' - except: - self.logger.warning(str(FOLDERS)) - patch_file = r'dep/macfwd_log.patch' - FOLDERS["Depends"] = 'dep' - patch_dst = "/tmp/" - - # dpdk patch and build - try: - self.dut.session.copy_file_to(patch_file, patch_dst) - self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", True) - self.dut.build_dpdk_apps('./app/test-pmd') - except Exception, e: - raise IOError("dpdk setup failure: %s" % e) - + self.dut.reset_compile_target(self.target + '_queue_start_stop') def check_forwarding(self, ports, nic, pktSize=64, received=True): self.send_packet(ports[0], ports[1], self.nic, pktSize, received) @@ -130,7 +115,7 @@ class TestQueueStartStop(TestCase): """ #dpdk start try: - self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120) + self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop" % self.target, "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("start", "testpmd>") self.check_forwarding([0, 0], self.nic) @@ -182,16 +167,9 @@ class TestQueueStartStop(TestCase): self.dut.kill_all() - try: - self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", False) - except Exception, e: - print "patch_hotfix_dpdk remove failure :%s" %e - def tear_down_all(self): """ Run after each test suite. """ self.dut.kill_all() - self.dut.send_expect("rm -rf ./app/test-pmd/testpmd", "#") - self.dut.send_expect("rm -rf ./app/test-pmd/*.o", "#") - self.dut.send_expect("rm -rf ./app/test-pmd/build", "#") + self.dut.reset_compile_target() -- 1.9.3