X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FDUTSetup.py;h=712da63893bb77db0f303ef1e611b511c1ca7daf;hp=ec0a79620282ebc848789bf41f05b562dce9d412;hb=7829fea4a2c8936513fa95215b7d84997f814a69;hpb=b340b5c9925b43869b91197850504760757a0bfe diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py index ec0a796202..712da63893 100644 --- a/resources/libraries/python/DUTSetup.py +++ b/resources/libraries/python/DUTSetup.py @@ -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.