test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/unit_tests_lpm: fix set hugepage failed
@ 2017-09-01  5:42 lu,peipei
  2017-09-05  2:41 ` Lu, PeipeiX
  0 siblings, 1 reply; 3+ messages in thread
From: lu,peipei @ 2017-09-01  5:42 UTC (permalink / raw)
  To: dts; +Cc: lu,peipei

jubge hugepage size and the number of hugepages,if allocate enough hugepage was pass, Otherwise need to adjust.

Signed-off-by: lu,peipei <peipeix.lu@intel.com>
---
 tests/TestSuite_unit_tests_lpm.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/TestSuite_unit_tests_lpm.py b/tests/TestSuite_unit_tests_lpm.py
index e8149ff..53e65d9 100644
--- a/tests/TestSuite_unit_tests_lpm.py
+++ b/tests/TestSuite_unit_tests_lpm.py
@@ -81,14 +81,17 @@ class TestUnitTestsLpmIpv6(TestCase):
         """
         [arch, machine, env, toolchain] = self.target.split('-')
         self.verify(arch in ["x86_64", "arm64"], "lpm6 request huge memory")
+	hugepages_size = int(self.dut.send_expect("awk '/Hugepagesize/ {print $2}' /proc/meminfo", "# "))
+	hugepage_ori = self.dut.get_total_huge_pages()
         if env == 'bsdapp':
             pass
         else:
-            hugepage_ori = self.dut.get_total_huge_pages()
-            self.dut.set_huge_pages(4096)
-            hugepage_num = self.dut.get_total_huge_pages()
-            self.verify(hugepage_num >= 4096, "failed to request huge memory")
-
+	   1G_hugepage = 1024 * 1024
+           8G_hugepage = 8 * 1G_hugepage
+	   if (hugepages_size * hugepage_ori) < 8G_hugepage and hugepage_size != 1G_hugepage:
+	      self.dut.set_huge_pages(8G_hugepage / hugepages_size)
+	   else:
+	      pass
         self.dut.send_expect("./%s/app/test -n 1 -c f" % self.target, "R.*T.*E.*>.*>", 60)
         out = self.dut.send_expect("lpm6_autotest", "RTE>>", 3600)
         self.dut.send_expect("quit", "# ")
-- 
1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-06  3:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01  5:42 [dts] [PATCH V1] tests/unit_tests_lpm: fix set hugepage failed lu,peipei
2017-09-05  2:41 ` Lu, PeipeiX
2017-09-06  3:15   ` Liu, Yong

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).