From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0045EA3160 for ; Sat, 12 Oct 2019 04:02:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBC241EB7A; Sat, 12 Oct 2019 04:02:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 822211EB79 for ; Sat, 12 Oct 2019 04:02:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2019 19:02:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,286,1566889200"; d="scan'208";a="193710358" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 11 Oct 2019 19:02:05 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Oct 2019 19:02:05 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Oct 2019 19:02:05 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.176]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.165]) with mapi id 14.03.0439.000; Sat, 12 Oct 2019 10:02:03 +0800 From: "Mo, YufengX" To: "Mo, YufengX" , "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from current dep Thread-Index: AQHVgAiNE6HwHP2deUeAak6wSg841adWN8uggAAID8A= Date: Sat, 12 Oct 2019 02:02:03 +0000 Message-ID: References: <1570753506-1810-1-git-send-email-lihongx.ma@intel.com> <1570753506-1810-3-git-send-email-lihongx.ma@intel.com> In-Reply-To: Accept-Language: zh-CN, 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 V1 3/3][nsh] tests/uni_pkt: import nsh from current dep 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Hi, ma, lihong You can use 'from packet import DEP_FOLDER'.=20 When os.chdir is ran by other script, os.getcwd will be uncertain. BRs Yufen, Mo > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Mo, YufengX > Sent: Saturday, October 12, 2019 9:26 AM > To: Ma, LihongX ; dts@dpdk.org > Cc: Ma, LihongX > Subject: Re: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from cur= rent dep >=20 > Hi,ma lihong >=20 > > + cwd =3D os.getcwd() > > + dir_module =3D cwd + r"/" + "dep" >=20 > It will be '/xxx/dts/tests/dep'. Are you sure? >=20 >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > > Sent: Friday, October 11, 2019 8:25 AM > > To: dts@dpdk.org > > Cc: Ma, LihongX > > Subject: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from curre= nt dep > > > > Signed-off-by: lihong > > --- > > tests/TestSuite_uni_pkt.py | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/tests/TestSuite_uni_pkt.py b/tests/TestSuite_uni_pkt.py > > index 9a75061..cdc5849 100644 > > --- a/tests/TestSuite_uni_pkt.py > > +++ b/tests/TestSuite_uni_pkt.py > > @@ -47,6 +47,7 @@ import utils > > from test_case import TestCase > > from exception import VerifyFailure > > from packet import Packet > > +import os > > import time > > > > > > @@ -442,10 +443,12 @@ class TestUniPacket(TestCase): > > "ether+nsh+ipv6+udp": "L2_ETHER_NSH L3_I= PV6_EXT_UNKNOWN L4_UDP", \ > > "ether+nsh+ipv6+sctp": "L2_ETHER_NSH L3_= IPV6_EXT_UNKNOWN L4_SCTP" > > } > > - > > + cwd =3D os.getcwd() > > + dir_module =3D cwd + r"/" + "dep" > > for packet in nsh_packets: > > self.tester.scapy_foreground() > > - self.tester.scapy_append("from scapy.contrib.nsh import *"= ) > > + self.tester.scapy_append("sys.path.append('%s')" % dir_mod= ule) > > + self.tester.scapy_append("from nsh import NSH") > > self.tester.scapy_append("sendp([%s],iface=3D'%s')" % (nsh= _packets[packet], self.tester_iface)) > > self.tester.scapy_execute() > > out =3D self.dut.get_session_output(timeout=3D2) > > -- > > 2.7.4