Skip to content

Commit 9d07812

Browse files
committed
Downloader: request work path with space
1 parent 729a424 commit 9d07812

File tree

2 files changed

+39
-12
lines changed

2 files changed

+39
-12
lines changed

microsoft/testsuites/dpdk/common.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from typing import Any, Callable, Dict, List, Optional, Sequence, Type, Union
66
from urllib.parse import urlparse
77

8-
from assertpy import assert_that
8+
from assertpy import assert_that, fail
99
from semver import VersionInfo
1010
from urllib3.util.url import parse_url
1111

1212
from lisa import Node
13-
from lisa.executable import Tool
13+
from lisa.executable import ExecutableResult, Tool
1414
from lisa.operating_system import Debian, Fedora, Oracle, Posix, Suse, Ubuntu
1515
from lisa.tools import Git, Lscpu, Tar, Wget
1616
from lisa.tools.lscpu import CpuArchitecture
@@ -99,9 +99,10 @@ def download(self) -> PurePath:
9999
# NOTE: fail on exists is set to True.
100100
# The expectation is that the parent Installer class should
101101
# remove any lingering installations
102+
work_path = self._node.get_working_path_with_required_space(5)
102103
self.asset_path = self._node.tools[Git].clone(
103104
self._git_repo,
104-
cwd=self._node.get_working_path(),
105+
cwd=self._node.get_pure_path(work_path),
105106
ref=self._git_ref,
106107
fail_on_exists=False,
107108
)
@@ -123,7 +124,9 @@ def __init__(
123124
# then extract it
124125
def download(self) -> PurePath:
125126
node = self._node
126-
work_path = self._node.get_working_path()
127+
work_path = self._node.get_pure_path(
128+
self._node.get_working_path_with_required_space(5)
129+
)
127130
is_tarball = False
128131
for suffix in [".tar.gz", ".tar.bz2", ".tar"]:
129132
if self._tar_url.endswith(suffix):
@@ -137,7 +140,9 @@ def download(self) -> PurePath:
137140
).is_true()
138141
if self._is_remote_tarball:
139142
tarfile = node.tools[Wget].get(
140-
self._tar_url, overwrite=False, file_path=str(node.get_working_path())
143+
self._tar_url,
144+
overwrite=False,
145+
file_path=str(work_path),
141146
)
142147
remote_path = node.get_pure_path(tarfile)
143148
self.tar_filename = remote_path.name

microsoft/testsuites/dpdk/dpdktestpmd.py

+29-7
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,17 @@ def _install(self) -> None:
267267
self.dpdk_build_path = node.tools[Meson].setup(
268268
args=sample_apps, build_dir="build", cwd=self.asset_path
269269
)
270-
node.tools[Ninja].run(
270+
install_result = node.tools[Ninja].run(
271271
cwd=self.dpdk_build_path,
272272
shell=True,
273273
timeout=1800,
274-
expected_exit_code=0,
275-
expected_exit_code_failure_message=(
276-
"ninja build for dpdk failed. check build spew for missing headers "
277-
"or dependencies. Also check that this ninja version requirement "
278-
"has not changed for dpdk."
279-
),
280274
)
275+
# there are enough known installation failures to make
276+
# raising each as a seperate useful message annoying.
277+
# Also enough to make raising a single generic message useless.
278+
# Use this function to parse and raise them.
279+
_check_for_dpdk_build_errors(result=install_result)
280+
281281
# using sudo and pip modules can get weird on some distros,
282282
# whether you install with pip3 --user or not.
283283
# to work around, add the user python path to sudo one
@@ -1007,3 +1007,25 @@ def _discard_first_and_last_sample(data: List[int]) -> List[int]:
10071007

10081008
def _mean(data: List[int]) -> int:
10091009
return sum(data) // len(data)
1010+
1011+
1012+
def _check_for_dpdk_build_errors(result: ExecutableResult) -> None:
1013+
# check for common build errors and raise specific error messages for them
1014+
errors = [
1015+
# build unexpectedly ran out of space
1016+
"final link failed: No space left on device",
1017+
# elftools module not found (new OS version or package name change)
1018+
"Exception: elftools module not found",
1019+
]
1020+
if result.exit_code == 0:
1021+
return
1022+
# check for known common issues
1023+
for error in errors:
1024+
if error in result.stdout:
1025+
fail(f"Build issue: {error}")
1026+
# otherwise, raise a generic error asking for triage
1027+
fail(
1028+
"ninja build for dpdk failed. check build spew for missing headers "
1029+
"or dependencies. Also check that this ninja version requirement "
1030+
"has not changed for dpdk."
1031+
)

0 commit comments

Comments
 (0)