Skip to content

Commit

Permalink
Fixing nic initialization for freebsd nodes (#3280)
Browse files Browse the repository at this point in the history
* Updated the nic initialization for nodes and provisioning
  • Loading branch information
r-dailey authored Apr 30, 2024
1 parent 788bbe6 commit 5e6a41d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lisa/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from lisa.executable import Tools
from lisa.feature import Features
from lisa.nic import Nics, NicsBSD
from lisa.operating_system import BSD, OperatingSystem
from lisa.operating_system import OperatingSystem
from lisa.secret import add_secret
from lisa.tools import Chmod, Df, Echo, Lsblk, Mkfs, Mount, Reboot, Uname, Wsl
from lisa.tools.mkfs import FileSystem
Expand Down Expand Up @@ -1215,7 +1215,10 @@ def create_nics(node: Node) -> Nics:
"""
Returns a Nics object for the node based on the OS type.
"""
if isinstance(node.os, BSD):
# Uses uname instead of the node.os because sometimes node.os has not been
# populated when this is called.
os = node.execute(cmd="uname", no_error_log=True).stdout
if "FreeBSD" in os:
return NicsBSD(node)

return Nics(node)
3 changes: 1 addition & 2 deletions microsoft/testsuites/core/provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
StartStop,
Synthetic,
)
from lisa.nic import Nics
from lisa.tools import Lspci
from lisa.util import constants
from lisa.util.shell import wait_tcp_port_ready
Expand Down Expand Up @@ -342,7 +341,7 @@ def is_mana_device_discovered(self, node: RemoteNode) -> bool:
return all_mana_devices

def check_sriov(self, log: Logger, node: RemoteNode) -> None:
node_nic_info = Nics(node)
node_nic_info = node.nics
node_nic_info.initialize()

network_interface_feature = node.features[NetworkInterface]
Expand Down

0 comments on commit 5e6a41d

Please sign in to comment.