[dts] [PATCH 18/26] tests: pmdpcap - modifying the right config file + importing utils after scapy
Angela Czubak
aczubak at caviumnetworks.com
Thu Apr 6 19:51:24 CEST 2017
This test used to modify config/common_linuxapp or config/common_bsdapp
to compile DPDK with PCAP, however, this config may lie as well in
config/common_base. If the PCAP variable is not found in OS specific
files, then it is assumed that config/common_base should be modified.
Scapy may contain utils itself, therefore importing dts utils is moved
after importing from scapy (so as to override utils).
Signed-off-by: Angela Czubak <aczubak at caviumnetworks.com>
---
tests/TestSuite_pmdpcap.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_pmdpcap.py b/tests/TestSuite_pmdpcap.py
index 0a79e96..a51eb31 100644
--- a/tests/TestSuite_pmdpcap.py
+++ b/tests/TestSuite_pmdpcap.py
@@ -32,10 +32,10 @@
'''
'''
from test_case import TestCase
-import utils
from time import sleep
from scapy.all import *
+import utils
#
@@ -73,8 +73,11 @@ class TestPmdPcap(TestCase):
else:
raise Exception(
"Unknow os type, please check to make sure pcap can work in OS [ %s ]" % os_type)
-
- return config_head + config_tail
+ out = self.dut.send_command("cat config/%s" % (config_head + config_tail))
+ if "CONFIG_RTE_LIBRTE_PMD_PCAP" in out:
+ return config_head + config_tail
+ else:
+ return config_head + "base"
def create_pcap_file(self, filename, number_of_packets):
flow = []
--
2.7.4
More information about the dts
mailing list