test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] framework/pmd_output: fix issue of start_testpmd
@ 2019-12-11 23:59 lihong
  2019-12-12  7:27 ` Ma, LihongX
  2019-12-17  7:06 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: lihong @ 2019-12-11 23:59 UTC (permalink / raw)
  To: dts; +Cc: lihong

1. fix the regular match about file prefix string
2. fix issue about params analysis

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 framework/pmd_output.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 762f335..dd1e40d 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -110,7 +110,7 @@ class PmdOutput():
         :return:
         """
         re_w_pci_str = '\s?-w\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-w\\s+.+?:.+?\\..+?[,.*=\d+]?\s'
-        re_file_prefix_str = '--file-prefix[=\s+].+\s'
+        re_file_prefix_str = '--file-prefix[\s*=]\S+\s'
         re_b_pci_str = '\s?-b\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-b\\s+.+?:.+?\\..+?[,.*=\d+]?\s'
         eal_param = eal_param + ' '
         # pci_str_list eg: ['-w   0000:1a:00.0 ', '-w 0000:1a:00.1,queue-num-per-vf=4 ', '-w 0000:aa:bb.1,queue-num-per-vf=4 ']
@@ -156,21 +156,25 @@ class PmdOutput():
     def start_testpmd(self, cores='default', param='', eal_param='', socket=0, fixed_prefix=False, **config):
         config['cores'] = cores
         if eal_param == '':
-            # use configured ports
-            config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))]
+            # use configured ports if not set
+            if 'ports' not in config.keys():
+                config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))]
             all_eal_param = self.dut.create_eal_parameters(fixed_prefix=fixed_prefix, socket=socket, **config)
         else:
             w_pci_list, port_options, b_pci_list, file_prefix, no_pci, other_eal_str = self.split_eal_param(eal_param)
             if no_pci:
                 config['no_pci'] = no_pci
-            elif not w_pci_list and not b_pci_list:
-                config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))]
-                config['prefix'] = file_prefix
-            else:
+            if w_pci_list:
                 config['ports'] = w_pci_list
+            if port_options:
                 config['port_options'] = port_options
+            if b_pci_list:
                 config['b_ports'] = b_pci_list
+            if file_prefix:
                 config['prefix'] = file_prefix
+
+            if not w_pci_list and not b_pci_list and 'ports' not in config.keys():
+                config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))]
             part_eal_param = self.dut.create_eal_parameters(fixed_prefix=fixed_prefix, socket=socket, **config)
             all_eal_param = part_eal_param + ' ' + other_eal_str
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-17  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 23:59 [dts] [PATCH V2] framework/pmd_output: fix issue of start_testpmd lihong
2019-12-12  7:27 ` Ma, LihongX
2019-12-17  7:06 ` Tu, Lijuan

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).