FIX: Race condition 41/29041/3
authorpmikus <pmikus@cisco.com>
Wed, 23 Sep 2020 12:44:06 +0000 (12:44 +0000)
committerPeter Mikus <pmikus@cisco.com>
Wed, 23 Sep 2020 13:26:27 +0000 (13:26 +0000)
avf tests works, but vfio-pci tests are following, the interfaces must
be in down state (ideally unbind, as vpp cannot pick them).

Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I77af85ec4239059a5455ef68683ca129548bd7bd

resources/libraries/python/DUTSetup.py
resources/libraries/robot/shared/interfaces.robot

index 28b3626..396029a 100644 (file)
@@ -429,6 +429,18 @@ class DUTSetup:
             node, command, timeout=120, sudo=True, message=message
         )
 
+    @staticmethod
+    def pci_driver_unbind_list(node, *pci_addrs):
+        """Unbind PCI devices from current driver on node.
+
+        :param node: DUT node.
+        :param pci_addrs: PCI device addresses.
+        :type node: dict
+        :type pci_addrs: list
+        """
+        for pci_addr in pci_addrs:
+            DUTSetup.pci_driver_unbind(node, pci_addr)
+
     @staticmethod
     def pci_driver_bind(node, pci_addr, driver):
         """Bind PCI device to driver on node.
index cd14e89..4fdc1ee 100644 (file)
 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
 | | Run Keyword If | ${index} >= 0 | Return From Keyword
 | | FOR | ${dut} | IN | @{duts}
+| | | Stop VPP Service | ${nodes['${dut}']}
+| | | PCI Driver Unbind List | ${nodes['${dut}']} | @{${dut}_pf_pci}
 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload