test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jogarao Nartu <njogarao@caviumnetworks.com>
To: yong.liu@intel.com
Cc: dts@dpdk.org, jerin.jacob@caviumnetworks.com,
	Jogarao Nartu <njogarao@caviumnetworks.com>
Subject: [dts] [dpdk-dts] [PATCH] tests/multiprocess: disable ASLR for multiprocess tests.
Date: Tue,  5 Dec 2017 18:12:17 +0530	[thread overview]
Message-ID: <1512477737-21653-1-git-send-email-njogarao@caviumnetworks.com> (raw)

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

                 reply	other threads:[~2017-12-05 12:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512477737-21653-1-git-send-email-njogarao@caviumnetworks.com \
    --to=njogarao@caviumnetworks.com \
    --cc=dts@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).