test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [dpdk-dts] [PATCH] tests/multiprocess: disable ASLR for multiprocess tests.
@ 2017-12-05 12:42 Jogarao Nartu
  0 siblings, 0 replies; only message in thread
From: Jogarao Nartu @ 2017-12-05 12:42 UTC (permalink / raw)
  To: yong.liu; +Cc: dts, jerin.jacob, Jogarao Nartu

Address-Space Layout Randomization can interfere hugepages memory
mapping so disable this feature to run multi-process applications.

Re-enable ASLR after tests completed.

Signed-off-by: Jogarao Nartu <njogarao@caviumnetworks.com>
---
 tests/TestSuite_multiprocess.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index 1bac35c..6479082 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -55,6 +55,15 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         """
         #self.verify('bsdapp' not in self.target, "Multiprocess not support freebsd")
 
+        # Get aslr(Addressspace layout randomization) value from /proc entries.
+        self.aslr_path = "/proc/sys/kernel/randomize_va_space"
+        cmd = "cat %s" % self.aslr_path
+        self.randomize_va_space = int(self.dut.send_expect("%s" % cmd, "#"))
+
+        # Disable aslr to run multiprocess test
+        cmd = "echo 0 > %s" % self.aslr_path
+        self.dut.send_expect("%s" %cmd, "#")
+
         self.verify(len(self.dut.get_all_cores()) >= 4, "Not enough Cores")
         self.tester.extend_external_packet_generator(TestMultiprocess, self)
 
@@ -273,6 +282,10 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         """
         Run after each test suite.
         """
+        # Reset original aslr value
+        cmd = "echo %d > %s" % (self.randomize_va_space,self.aslr_path)
+        self.dut.send_expect("%s" %cmd, "#")
+
         self.dut.kill_all()
         self.dut.close_session(self.session_secondary)
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-05 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 12:42 [dts] [dpdk-dts] [PATCH] tests/multiprocess: disable ASLR for multiprocess tests Jogarao Nartu

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