Skip to content

Commit fd5635a

Browse files
committed
Fix imports
1 parent 68b9623 commit fd5635a

File tree

9 files changed

+54
-44
lines changed

9 files changed

+54
-44
lines changed

lisa/microsoft/testsuites/core/provisioning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,5 +466,5 @@ def check_sriov(self, log: Logger, node: RemoteNode) -> None:
466466
)
467467
assert_that(len(node_nic_info.get_pci_nics())).described_as(
468468
f"VF count inside VM is {len(node_nic_info.get_pci_nics())},"
469-
f"actual sriov nic count is {sriov_count}"
469+
f" actual sriov nic count is {sriov_count}"
470470
).is_equal_to(sriov_count)

lisa/microsoft/testsuites/kselftest/kselftest-suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from typing import Any, Dict
22

3-
from microsoft.testsuites.kselftest.kselftest import Kselftest
4-
53
from lisa import Node, TestCaseMetadata, TestSuite, TestSuiteMetadata
64
from lisa.testsuite import TestResult, simple_requirement
75
from lisa.util import SkippedException, UnsupportedDistroException
86

7+
from microsoft.testsuites.kselftest.kselftest import Kselftest
8+
99

1010
@TestSuiteMetadata(
1111
area="kselftest",

lisa/microsoft/testsuites/ltp/ltpsuite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from logging import Logger
55
from typing import Any, Dict
66

7-
from microsoft.testsuites.ltp.ltp import Ltp
8-
97
from lisa import (
108
Node,
119
TestCaseMetadata,
@@ -19,6 +17,8 @@
1917
from lisa.testsuite import TestResult
2018
from lisa.tools import Lsblk, Swap
2119

20+
from microsoft.testsuites.ltp.ltp import Ltp
21+
2222

2323
@TestSuiteMetadata(
2424
area="ltp",

lisa/microsoft/testsuites/network/networksettings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Any, Dict, List, Tuple, Union, cast
77

88
from assertpy import assert_that
9+
from microsoft.testsuites.network.common import cleanup_iperf3
910

1011
from lisa import (
1112
Environment,
@@ -25,7 +26,6 @@
2526
from lisa.operating_system import BSD, Debian, Redhat, Suse, Ubuntu, Windows
2627
from lisa.tools import Ethtool, Iperf3, KernelConfig, Ls, Modinfo, Nm
2728
from lisa.util import parse_version
28-
from microsoft.testsuites.network.common import cleanup_iperf3
2929

3030

3131
@TestSuiteMetadata(

lisa/microsoft/testsuites/network/sriov.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
from typing import Any, Dict, List, cast
66

77
from assertpy import assert_that
8+
from microsoft.testsuites.network.common import (
9+
cleanup_iperf3,
10+
disable_enable_devices,
11+
initialize_nic_info,
12+
reload_modules,
13+
remove_extra_nics,
14+
restore_extra_nics,
15+
sriov_basic_test,
16+
sriov_disable_enable,
17+
sriov_vf_connection_test,
18+
)
819

920
from lisa import (
1021
Environment,
@@ -45,17 +56,6 @@
4556
check_till_timeout,
4657
)
4758
from lisa.util.shell import wait_tcp_port_ready
48-
from microsoft.testsuites.network.common import (
49-
cleanup_iperf3,
50-
disable_enable_devices,
51-
initialize_nic_info,
52-
reload_modules,
53-
remove_extra_nics,
54-
restore_extra_nics,
55-
sriov_basic_test,
56-
sriov_disable_enable,
57-
sriov_vf_connection_test,
58-
)
5959

6060

6161
@TestSuiteMetadata(
@@ -276,8 +276,8 @@ def verify_sriov_disable_enable(self, environment: Environment) -> None:
276276
for nic in node.nics.nics.values():
277277
if nic.is_pci_only_nic:
278278
raise SkippedException(
279-
f"SRIOV disable/enable test not applicable for PCI-only NIC {nic.name} "
280-
f"on node {node.name}."
279+
f"SRIOV disable/enable test not applicable for "
280+
f"PCI-only NIC {nic.name} on node {node.name}."
281281
)
282282

283283
sriov_disable_enable(environment)
@@ -304,8 +304,8 @@ def verify_sriov_disable_enable_pci(self, environment: Environment) -> None:
304304
for nic in node.nics.nics.values():
305305
if nic.is_pci_only_nic:
306306
raise SkippedException(
307-
f"SRIOV disable/enable PCI test not applicable for PCI-only NIC {nic.name} "
308-
f"on node {node.name}."
307+
f"SRIOV disable/enable PCI test not applicable for "
308+
f"PCI-only NIC {nic.name} on node {node.name}."
309309
)
310310

311311
disable_enable_devices(environment)
@@ -337,8 +337,8 @@ def verify_sriov_disable_enable_on_guest(self, environment: Environment) -> None
337337
for nic in node.nics.nics.values():
338338
if nic.is_pci_only_nic:
339339
raise SkippedException(
340-
f"SRIOV disable/enable on guest test not applicable for PCI-only NIC {nic.name} "
341-
f"on node {node.name}."
340+
f"SRIOV disable/enable on guest test not applicable "
341+
f"for PCI-only NIC {nic.name} on node {node.name}."
342342
)
343343

344344
vm_nics = initialize_nic_info(environment)

lisa/microsoft/testsuites/network/stress.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
from typing import Any, cast
44

55
from assertpy import assert_that
6+
from microsoft.testsuites.network.common import (
7+
cleanup_iperf3,
8+
initialize_nic_info,
9+
sriov_basic_test,
10+
sriov_disable_enable,
11+
sriov_vf_connection_test,
12+
)
613

714
from lisa import (
815
Environment,
@@ -21,13 +28,6 @@
2128
from lisa.nic import NicInfo
2229
from lisa.sut_orchestrator import AZURE
2330
from lisa.tools import Cat, Iperf3
24-
from microsoft.testsuites.network.common import (
25-
cleanup_iperf3,
26-
initialize_nic_info,
27-
sriov_basic_test,
28-
sriov_disable_enable,
29-
sriov_vf_connection_test,
30-
)
3131

3232

3333
@TestSuiteMetadata(
@@ -139,8 +139,8 @@ def stress_sriov_disable_enable(self, environment: Environment) -> None:
139139
for nic in node.nics.nics.values():
140140
if nic.is_pci_only_nic:
141141
raise SkippedException(
142-
f"SRIOV stress disable/enable test not applicable for PCI-only NIC {nic.name} "
143-
f"on node {node.name}."
142+
f"SRIOV stress disable/enable test not applicable "
143+
f"for PCI-only NIC {nic.name} on node {node.name}."
144144
)
145145

146146
sriov_disable_enable(environment, times=50)

lisa/microsoft/testsuites/xdp/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
from time import sleep
66
from typing import Dict, List, Pattern
77

8+
from microsoft.testsuites.xdp.xdpdump import XdpDump
9+
810
from lisa import Logger, Node, SkippedException, UnsupportedDistroException
911
from lisa.nic import NicInfo
1012
from lisa.tools import Echo, Ethtool, Ls, Mount
1113
from lisa.tools.mkfs import FileSystem
12-
from microsoft.testsuites.xdp.xdpdump import XdpDump
1314

1415
_rx_drop_patterns = [
1516
# rx_queue_0_xdp_drop
@@ -37,7 +38,7 @@
3738

3839
def get_xdpdump(node: Node) -> XdpDump:
3940
try:
40-
xdpdump = node.tools[XdpDump]
41+
xdpdump: XdpDump = node.tools[XdpDump]
4142
except UnsupportedDistroException as e:
4243
raise SkippedException(e)
4344

lisa/microsoft/testsuites/xfstests/xfstesting.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from pathlib import Path
55
from typing import Any, Dict, Union, cast
66

7-
from microsoft.testsuites.xfstests.xfstests import Xfstests
8-
97
from lisa import (
108
Logger,
119
Node,
@@ -27,7 +25,13 @@
2725
from lisa.sut_orchestrator.azure.platform_ import AzurePlatform
2826
from lisa.testsuite import TestResult
2927
from lisa.tools import Echo, FileSystem, KernelConfig, Mkfs, Mount, Parted
30-
from lisa.util import BadEnvironmentStateException, LisaException, generate_random_chars
28+
from lisa.util import (
29+
BadEnvironmentStateException,
30+
LisaException,
31+
generate_random_chars,
32+
)
33+
34+
from microsoft.testsuites.xfstests.xfstests import Xfstests
3135

3236
# Global variables
3337
# Section : NFS options. <TODO>

lisa/nic.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ def is_pci_device(self) -> bool:
8383
@property
8484
def is_pci_only_nic(self) -> bool:
8585
"""
86-
Check if this is an Accelerated Networking (AN) NIC without synthetic NIC pairing.
86+
Check if this is an Accelerated Networking (AN) NIC without
87+
synthetic NIC pairing.
8788
"""
88-
return not self.lower and self.is_pci_device and self.module_name != "hv_netvsc"
89+
return (
90+
not self.lower and self.is_pci_device and self.module_name != "hv_netvsc"
91+
)
8992

9093
@property
9194
def pci_device_name(self) -> str:
@@ -171,7 +174,8 @@ def get_synthetic_devices(self) -> List[str]:
171174
for nic in self.nics.values():
172175
is_synthetic = not nic.lower and not nic.is_pci_device
173176
self._node.log.debug(
174-
f" NIC {nic.name}: lower='{nic.lower}', is_pci_device={nic.is_pci_device}, "
177+
f" NIC {nic.name}: lower='{nic.lower}', "
178+
f"is_pci_device={nic.is_pci_device}, "
175179
f"pci_slot='{nic.pci_slot}', module_name='{nic.module_name}', "
176180
f"is_synthetic={is_synthetic}"
177181
)
@@ -342,7 +346,8 @@ def load_nics_info(self, nic_name: Optional[str] = None) -> None:
342346
if not nic_name:
343347
assert_that(sorted(found_nics)).described_as(
344348
f"Could not locate nic info for all nics. "
345-
f"Nic set was {self.nics.keys()} and only found info for {found_nics}"
349+
f"Nic set was {self.nics.keys()} and only found info for "
350+
f"{found_nics}"
346351
).is_equal_to(sorted(self.nics.keys()))
347352

348353
def reload(self) -> None:
@@ -512,8 +517,9 @@ def is_mana_driver_enabled(self) -> bool:
512517

513518
def _discover_standalone_pci_nics(self, lspci: Lspci) -> None:
514519
"""
515-
Discover standalone PCI NICs by checking device paths for PCI information.
516-
This handles scenarios where NICs operate as standalone PCI devices without synthetic pairing.
520+
Discover standalone PCI NICs by checking device paths for PCI
521+
information. This handles scenarios where NICs operate as standalone
522+
PCI devices without synthetic pairing.
517523
"""
518524
# Get unpaired NICs that might have PCI devices
519525
unpaired_nics = self.get_unpaired_devices()
@@ -562,7 +568,6 @@ def _discover_standalone_pci_nics(self, lspci: Lspci) -> None:
562568
f"{device_path}"
563569
)
564570

565-
566571
def _get_default_nic(self) -> None:
567572
self.default_nic: str = ""
568573
self.default_nic_route: str = ""

0 commit comments

Comments
 (0)