test suite reviews and discussions
 help / color / mirror / Atom feed
From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from current dep
Date: Fri, 11 Oct 2019 08:25:06 +0800	[thread overview]
Message-ID: <1570753506-1810-3-git-send-email-lihongx.ma@intel.com> (raw)
In-Reply-To: <1570753506-1810-1-git-send-email-lihongx.ma@intel.com>

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 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


  parent reply	other threads:[~2019-10-11  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11  0:25 [dts] [PATCH V1 1/3][nsh] framwork/packet: add support of mpls and nsh lihong
2019-10-11  0:25 ` [dts] [PATCH V1 2/3][nsh] dep: " lihong
2019-10-11  0:25 ` lihong [this message]
2019-10-12  1:26   ` [dts] [PATCH V1 3/3][nsh] tests/uni_pkt: import nsh from current dep Mo, YufengX
2019-10-12  2:02     ` Mo, YufengX
2019-10-14  5:15       ` Ma, LihongX
2019-10-14  5:04     ` Ma, LihongX
2019-10-12  6:10   ` Tu, Lijuan

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=1570753506-1810-3-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    /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).