FIX: Pylint reduce
[csit.git] / resources / libraries / python / DUTSetup.py
index ec0a796..712da63 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -33,7 +33,7 @@ class DUTSetup:
         :type node: dict
         :type service: str
         """
-        command = u"echo $(< /tmp/*supervisor*.log)"\
+        command = u"cat /tmp/*supervisor*.log"\
             if DUTSetup.running_in_container(node) \
             else f"journalctl --no-pager _SYSTEMD_INVOCATION_ID=$(systemctl " \
             f"show -p InvocationID --value {service})"
@@ -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.