test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xinfeng Zhao <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: Xinfeng Zhao <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1 3/5] tests/TestSuite_ddp_gtp_qregion.py: load the local dep module in scapy command
Date: Wed, 18 Sep 2019 07:19:23 +0800	[thread overview]
Message-ID: <1568762365-19112-3-git-send-email-xinfengx.zhao@intel.com> (raw)
In-Reply-To: <1568762365-19112-1-git-send-email-xinfengx.zhao@intel.com>

Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
---
 tests/TestSuite_ddp_gtp_qregion.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_ddp_gtp_qregion.py b/tests/TestSuite_ddp_gtp_qregion.py
index 4963f5f..c79082a 100644
--- a/tests/TestSuite_ddp_gtp_qregion.py
+++ b/tests/TestSuite_ddp_gtp_qregion.py
@@ -2,12 +2,18 @@
 
 import time
 import re
+import os
 import sys
 import utils
-from scapy.all import *
+from scapy.all import Ether, IP, UDP, IPv6, IPv6
 from test_case import TestCase
 from pmd_output import PmdOutput
-from settings import get_nic_name
+from settings import get_nic_name, FOLDERS
+import random
+from gtp import *
+
+CWD = os.getcwd()
+DIR_DEPEND = os.path.join(CWD, FOLDERS['Depends'])
 
 
 class TestDdpGtpQregion(TestCase):
@@ -148,6 +154,8 @@ class TestDdpGtpQregion(TestCase):
         """
         pkts = self.gtp_pkts(flowtype, keyword, opt)
         for packet_type in pkts.keys():
+            self.tester.scapy_append("sys.path.append('%s')" % DIR_DEPEND)
+            self.tester.scapy_append("from gtp import *")
             self.tester.scapy_append(
                 'sendp([%s], iface="%s")'
                 % (pkts[packet_type], self.tester_intf))
@@ -210,6 +218,8 @@ class TestDdpGtpQregion(TestCase):
                     keyword = 'src_ipv6'
             pkts = self.gtp_pkts(flowtype, keyword, opt)
             for packet_type in pkts.keys():
+                self.tester.scapy_append("sys.path.append('%s')" % DIR_DEPEND)
+                self.tester.scapy_append("from gtp import *")
                 self.tester.scapy_append(
                     'sendp([%s], iface="%s")'
                     % (pkts[packet_type], self.tester_intf))
-- 
2.17.1


  parent reply	other threads:[~2019-09-18  7:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 23:19 [dts] [PATCH V1 1/5] dep: add dependency modules for ddp suites Xinfeng Zhao
2019-09-17 23:19 ` [dts] [PATCH V1 2/5] tests/TestSuite_ddp_gtp.py: load the local dep module in scapy command Xinfeng Zhao
2019-09-17 23:19 ` Xinfeng Zhao [this message]
2019-09-17 23:19 ` [dts] [PATCH V1 4/5] tests/TestSuite_ddp_mpls.py: " Xinfeng Zhao
2019-09-17 23:19 ` [dts] [PATCH V1 5/5] tests/TestSuite_ddp_ppp_l2tp.py: " Xinfeng Zhao
2019-09-18  7:28 ` [dts] [PATCH V1 1/5] dep: add dependency modules for ddp suites Zhao, XinfengX

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=1568762365-19112-3-git-send-email-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@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).