Skip to content

Commit 5e6a41d

Browse files
authored
Fixing nic initialization for freebsd nodes (#3280)
* Updated the nic initialization for nodes and provisioning
1 parent 788bbe6 commit 5e6a41d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lisa/node.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from lisa.executable import Tools
2323
from lisa.feature import Features
2424
from lisa.nic import Nics, NicsBSD
25-
from lisa.operating_system import BSD, OperatingSystem
25+
from lisa.operating_system import OperatingSystem
2626
from lisa.secret import add_secret
2727
from lisa.tools import Chmod, Df, Echo, Lsblk, Mkfs, Mount, Reboot, Uname, Wsl
2828
from lisa.tools.mkfs import FileSystem
@@ -1215,7 +1215,10 @@ def create_nics(node: Node) -> Nics:
12151215
"""
12161216
Returns a Nics object for the node based on the OS type.
12171217
"""
1218-
if isinstance(node.os, BSD):
1218+
# Uses uname instead of the node.os because sometimes node.os has not been
1219+
# populated when this is called.
1220+
os = node.execute(cmd="uname", no_error_log=True).stdout
1221+
if "FreeBSD" in os:
12191222
return NicsBSD(node)
12201223

12211224
return Nics(node)

microsoft/testsuites/core/provisioning.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
StartStop,
3232
Synthetic,
3333
)
34-
from lisa.nic import Nics
3534
from lisa.tools import Lspci
3635
from lisa.util import constants
3736
from lisa.util.shell import wait_tcp_port_ready
@@ -342,7 +341,7 @@ def is_mana_device_discovered(self, node: RemoteNode) -> bool:
342341
return all_mana_devices
343342

344343
def check_sriov(self, log: Logger, node: RemoteNode) -> None:
345-
node_nic_info = Nics(node)
344+
node_nic_info = node.nics
346345
node_nic_info.initialize()
347346

348347
network_interface_feature = node.features[NetworkInterface]

0 commit comments

Comments
 (0)