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 9FBB2A2EFC for ; Wed, 18 Sep 2019 09:28:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DAD111C119; Wed, 18 Sep 2019 09:28:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 35BBF1BF78 for ; Wed, 18 Sep 2019 09:27:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2019 00:27:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,519,1559545200"; d="scan'208";a="202006467" Received: from dpdk-xinfengx-dut242.sh.intel.com ([10.67.117.34]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2019 00:27:53 -0700 From: Xinfeng Zhao To: dts@dpdk.org Cc: Xinfeng Zhao Date: Wed, 18 Sep 2019 07:19:23 +0800 Message-Id: <1568762365-19112-3-git-send-email-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568762365-19112-1-git-send-email-xinfengx.zhao@intel.com> References: <1568762365-19112-1-git-send-email-xinfengx.zhao@intel.com> Subject: [dts] [PATCH V1 3/5] tests/TestSuite_ddp_gtp_qregion.py: load the local dep module in scapy command 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: Xinfeng Zhao --- 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