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 08652A3160 for ; Fri, 11 Oct 2019 09:50:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 405D11E98D; Fri, 11 Oct 2019 09:50:11 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5BBAA1E974 for ; Fri, 11 Oct 2019 09:50:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2019 00:50:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,283,1566889200"; d="scan'208";a="198628092" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by orsmga006.jf.intel.com with ESMTP; 11 Oct 2019 00:50:07 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Fri, 11 Oct 2019 08:25:06 +0800 Message-Id: <1570753506-1810-3-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1570753506-1810-1-git-send-email-lihongx.ma@intel.com> References: <1570753506-1810-1-git-send-email-lihongx.ma@intel.com> Subject: [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" 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_IPV6_EXT_UNKNOWN L4_UDP", \ "ether+nsh+ipv6+sctp": "L2_ETHER_NSH L3_IPV6_EXT_UNKNOWN L4_SCTP" } - + cwd = os.getcwd() + dir_module = 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_module) + self.tester.scapy_append("from nsh import NSH") self.tester.scapy_append("sendp([%s],iface='%s')" % (nsh_packets[packet], self.tester_iface)) self.tester.scapy_execute() out = self.dut.get_session_output(timeout=2) -- 2.7.4