From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BA80037A6 for ; Tue, 27 Dec 2016 06:59:52 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP; 26 Dec 2016 21:59:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,414,1477983600"; d="scan'208";a="43555720" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 26 Dec 2016 21:59:51 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 26 Dec 2016 21:59:48 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Tue, 27 Dec 2016 13:59:47 +0800 From: "Xu, Qian Q" To: "Xu, HuilongX" , "dts@dpdk.org" , "Liu, Yong" , "Liu, Yuanhan" CC: "Xu, HuilongX" , "Xu, Qian Q" Thread-Topic: [dts] [PATCH V2] disable ASLR for multi process test Thread-Index: AQHSXyW0wNjWmAItBECdIBDjletJaaEbTjzg Date: Tue, 27 Dec 2016 05:59:46 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E3B4BD3E4@shsmsx102.ccr.corp.intel.com> References: <1482721910-13233-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1482721910-13233-1-git-send-email-huilongx.xu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2] disable ASLR for multi process test 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: Tue, 27 Dec 2016 05:59:53 -0000 + Yuanhan here for some comments on multi process test.=20 When test the application of multiprocess, do we need to disable ASLR? I am= not sure if it's a point that we need to handle well in multi-process case= .=20 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Monday, December 26, 2016 11:12 AM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V2] disable ASLR for multi process test >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_multiprocess.py | 8 +++++++- > tests/TestSuite_unit_tests_eal.py | 7 +++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) >=20 > diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiproce= ss.py > index b305437..00e8e27 100644 > --- a/tests/TestSuite_multiprocess.py > +++ b/tests/TestSuite_multiprocess.py > @@ -57,7 +57,12 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): >=20 > self.verify(len(self.dut.get_all_cores()) >=3D 4, "Not enough Co= res") > self.tester.extend_external_packet_generator(TestMultiprocess, s= elf) > - > + try: > + self.aslr_flag =3D int(self.dut.send_expect("cat > /proc/sys/kernel/randomize_va_space", "# ")) > + if self.aslr_flag: > + self.dut.send_expect("echo 0 > > /proc/sys/kernel/randomize_va_space", "# ") > + except: > + print "This machine not support disable ASLR, maybe multi pr= ocess will > failed" > out =3D self.dut.build_dpdk_apps("./examples/multi_process/") > self.verify('Error' not in out, "Compilation failed") >=20 > @@ -274,6 +279,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator)= : > Run after each test suite. > """ > self.dut.kill_all() > + self.dut.send_expect("echo %d > > + /proc/sys/kernel/randomize_va_space" % self.aslr_flag, "# ") > self.dut.close_session(self.session_secondary) >=20 > pass > diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tes= ts_eal.py > index d27ba39..e5c0384 100644 > --- a/tests/TestSuite_unit_tests_eal.py > +++ b/tests/TestSuite_unit_tests_eal.py > @@ -332,11 +332,18 @@ class TestUnitTestsEal(TestCase): > """ > Run multiprocess autotest. > """ > + try: > + aslr_flag =3D int(self.dut.send_expect("cat > /proc/sys/kernel/randomize_va_space", "# ")) > + if aslr_flag: > + self.dut.send_expect("echo 0 > > /proc/sys/kernel/randomize_va_space", "# ") > + except: > + print "This machine not support disable ASLR, maybe multi pr= ocess will > failed" >=20 > self.dut.send_expect(self.test_app_cmdline + ' -m 64', "R.*T.*E.= *>.*>", > self.start_test_time) > out =3D self.dut.send_expect("multiprocess_autotest", "RTE>>", > self.run_cmd_time) > self.dut.send_expect("quit", "# ") > self.verify("Test OK" in out, "Test failed") > + self.dut.send_expect("echo %d > > + /proc/sys/kernel/randomize_va_space" % aslr_flag, "# ") >=20 > def test_string(self): > """ > -- > 1.9.3