[2/2] tests/blocklist: optimize case of bl_one_port to adapt to more scenarios
Checks
Context |
Check |
Description |
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
ci/Intel-dts-suite-test |
success
|
Testing OK
|
Commit Message
From: Qin Ke <qin.ke@corigine.com>
when one port blocked, the port with same PCIADRESS will also be blocked,
optimize it to adapt to more scenarios whether the PCIADRESS of ports are
same or not.
Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by Dano Teixeira <dano.teixeira@corigine.com>
---
tests/TestSuite_blocklist.py | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
@@ -78,10 +78,25 @@ class TestBlockList(TestCase):
Run testpmd with one port blocklisted.
"""
self.dut.kill_all()
+ blocked_pci_address = self.dut.ports_info[0]["pci"]
out = self.pmdout.start_testpmd(
- "Default", eal_param="-b %s" % self.dut.ports_info[0]["pci"]
+ "Default", eal_param="-b %s" % blocked_pci_address
)
- self.check_blocklisted_ports(out, self.ports[1:])
+
+ """
+ To multi-port NIC with one PCIADRESS, port has same PCIADRESS will also
+ be blocked when selected port blocked.
+ """
+ ports_to_blocklist = []
+ ports_no_blocklist = []
+ for port in self.ports:
+ if self.dut.ports_info[port]["pci"] == blocked_pci_address:
+ ports_to_blocklist.append(port)
+ else:
+ ports_no_blocklist.append(port)
+
+ self.check_blocklisted_ports(out, ports_to_blocklist, True)
+ self.check_blocklisted_ports(out, ports_no_blocklist)
def test_bl_all_but_one_port_blocklisted(self):
"""