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 A4E77A2EFC for ; Mon, 14 Oct 2019 07:15:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A8E31C196; Mon, 14 Oct 2019 07:15:33 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A9FB01C18E for ; Mon, 14 Oct 2019 07:15:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2019 22:15:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,294,1566889200"; d="scan'208";a="395074597" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2019 22:15:28 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 13 Oct 2019 22:15:29 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 13 Oct 2019 22:15:28 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX153.ccr.corp.intel.com ([10.239.6.53]) with mapi id 14.03.0439.000; Mon, 14 Oct 2019 13:15:26 +0800 From: "Ma, LihongX" To: "Mo, YufengX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from current dep Thread-Index: AQHVgJwQ8tvPSP04jEm6ynxf02IYQqdVusCAgAPguzA= Date: Mon, 14 Oct 2019 05:15:26 +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: 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, yufeng Thanks for you suggest. -----Original Message----- From: Mo, YufengX=20 Sent: Saturday, October 12, 2019 10:02 AM To: Mo, YufengX ; Ma, LihongX ;= dts@dpdk.org Cc: Ma, LihongX Subject: RE: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from curre= nt dep 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=20 > current 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=20 > > current 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=20 > > 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