From patchwork Thu Nov 10 01:42:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 119689 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79220A04FD; Thu, 10 Nov 2022 02:47:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65EBA400EF; Thu, 10 Nov 2022 02:47:07 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 3B2C6400D4 for ; Thu, 10 Nov 2022 02:47:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668044825; x=1699580825; h=from:to:cc:subject:date:message-id; bh=Utws/HBqzxR6gt4YRKkPl0Pu0rVczrxTdDtpmujK2Qs=; b=GxektlkuCIfDNJg9xoLI7VLhM39t4B/Ye2KjwGsOBqp6UZ+OPmu1Kzj7 zKPTCFOA0aS1L57b3IPi+jtoEniatw21iv+E43tk4rZHqMI45rjPHiJ/p Wkz+AcGp43e3RXjgrZzO+iFi6N4hYUOadS1frskqLrhYCk2k5NHBr3EXY Y6yDHxc48XfPE8emxkaYLbrhoHljRpoOyqaf9opMq/Y+5jzlB4gqZ9Y9k gVeSb4Nmknj0szAVM7KtNfWYXrvYHFdS41DI0e/gctjxqc4zPo+2rk/SY etjO3z3/z5KIz/MmRcNx5iTIsUC/mc8o/b83Xpiqb5x8UK8b6sZ+hzZpw A==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="291573750" X-IronPort-AV: E=Sophos;i="5.96,152,1665471600"; d="scan'208";a="291573750" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 17:46:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="966221286" X-IronPort-AV: E=Sophos;i="5.96,152,1665471600"; d="scan'208";a="966221286" Received: from unknown (HELO localhost.localdomain) ([10.239.252.15]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 17:46:55 -0800 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V2] tests/hotplug modify code to support 2M hugepages Date: Thu, 10 Nov 2022 09:42:34 +0800 Message-Id: <20221110014234.29418-1-dukaix.yuan@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Add `--single-file-segments` parameter when start virtio-user side to support running in 2M hugepage size testbed. Signed-off-by: Dukai Yuan Tested-by: Lingli Chen --- tests/TestSuite_hotplug.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py index 0f1e17fd..5cf0e933 100644 --- a/tests/TestSuite_hotplug.py +++ b/tests/TestSuite_hotplug.py @@ -36,6 +36,7 @@ class TestPortHotPlug(TestCase): else: self.driver_name = self.drivername self.path = self.dut.apps_name["test-pmd"] + self.session2 = self.dut.create_session(name="virtio_user") def set_up(self): """ @@ -122,6 +123,13 @@ class TestPortHotPlug(TestCase): ) pkt.send_pkt(self.tester, tx_port=self.txItf) + @property + def check_2M_env(self): + out = self.session2.send_expect( + "cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# " + ) + return True if out == "2048" else False + def test_before_attach(self): """ first attach port after run testpmd @@ -185,6 +193,8 @@ class TestPortHotPlug(TestCase): eal_param = self.dut.create_eal_parameters( no_pci=True, fixed_prefix="virtio1", cores=cores[5:9] ) + if self.check_2M_env: + eal_param += "--single-file-segments" testpmd_cmd2 = "%s/%s " % (self.dut.base_dir, self.path) + eal_param + " -- -i" self.session2.send_expect(testpmd_cmd2, "testpmd>", timeout=60) self.session2.send_expect( @@ -207,11 +217,11 @@ class TestPortHotPlug(TestCase): self.verify( rx_pkts != 0 and tx_pkts != 0, "not received packets or transport packets" ) - self.session2.send_expect("show port stats 0", "testpmd", timeout=2) - self.session2.send_expect("stop", "testpmd", timeout=2) - self.session2.send_expect("quit", "#", timeout=2) - self.dut.send_expect("stop", "testpmd", timeout=2) - self.dut.send_expect("quit", "#", timeout=2) + self.session2.send_expect("show port stats 0", "testpmd") + self.session2.send_expect("stop", "testpmd") + self.session2.send_expect("quit", "#") + self.dut.send_expect("stop", "testpmd") + self.dut.send_expect("quit", "#") self.session2.close() def tear_down(self):