Skip to content

Commit

Permalink
fix failure ValueError: could not convert string to float: '7.9.2009'
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Oct 17, 2024
1 parent 72de027 commit eca0b70
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions microsoft/testsuites/dpdk/dpdktestpmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
Timeout,
Wget,
)
from lisa.util import LisaException, SkippedException, UnsupportedDistroException
from lisa.util import (
LisaException,
SkippedException,
UnsupportedDistroException,
parse_version,
)
from lisa.util.constants import DEVICE_TYPE_SRIOV, SIGINT
from microsoft.testsuites.dpdk.common import (
DependencyInstaller,
Expand Down Expand Up @@ -66,7 +71,7 @@
),
OsPackageDependencies(
matcher=lambda x: isinstance(x, Suse)
and float(x.information.release) == 15.5,
and parse_version(x.information.release) == "15.5.0",
packages=["dpdk22", "dpdk22-devel"],
stop_on_match=True,
),
Expand Down Expand Up @@ -172,13 +177,17 @@ def _setup_node(self) -> None:

def get_installed_version(self) -> VersionInfo:
package_name = (
"dpdk22" if float(self._os.information.release) == 15.5 else "dpdk"
"dpdk22"
if parse_version(self._os.information.release) == "15.5.0"
else "dpdk"
)
return self._os.get_package_information(package_name, use_cached=False)

def _check_if_installed(self) -> bool:
package_name = (
"dpdk22" if float(self._os.information.release) == 15.5 else "dpdk"
"dpdk22"
if parse_version(self._os.information.release) == "15.5.0"
else "dpdk"
)
return self._os.package_exists(package_name)

Expand Down

0 comments on commit eca0b70

Please sign in to comment.