diff options
author | Alexis Lothoré <alexis.lothore@bootlin.com> | 2024-02-28 17:41:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-29 10:26:13 +0000 |
commit | 437c0721c596f6bf13ae1e78453d19b17e164561 (patch) | |
tree | 4a172847a91f5f781fe7f8df0f14661ad918517c | |
parent | af7d65adfbe0bae4eecac00caf5b73f0e790d0f5 (diff) | |
download | poky-437c0721c596f6bf13ae1e78453d19b17e164561.tar.gz |
oeqa/lib/utils/postactions: fix host disk usage stats retrieval
The recently introduced postactions module can raise, on failing ptests,
the following warning:
WARNING: core-image-ptest-glib-2.0-1.0-r0 do_testimage: Can not get host
disk usage: [Errno 2] No such file or directory: '/usr/bin/df'
The issue is likely not happening because of df absence (to be confirmed
amongst the variety of workers) but because of the wrong path. Fix it by
letting subprocess search for df, passing only the binary name. To make it
work, we also have to reset the environment, otherwise the environment
configured before running bitbake will be used, and search will fail.
(From OE-Core rev: da7cc5def2839a0e15d07244f858847479c12caa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/utils/postactions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py index 03cecdc215..8104400ac2 100644 --- a/meta/lib/oeqa/utils/postactions.py +++ b/meta/lib/oeqa/utils/postactions.py | |||
@@ -38,7 +38,7 @@ def get_host_disk_usage(d, tc): | |||
38 | output_file = os.path.join(get_json_result_dir(d), "artifacts", "host_disk_usage.txt") | 38 | output_file = os.path.join(get_json_result_dir(d), "artifacts", "host_disk_usage.txt") |
39 | try: | 39 | try: |
40 | with open(output_file, 'w') as f: | 40 | with open(output_file, 'w') as f: |
41 | output = subprocess.run(['/usr/bin/df', '-hl'], check=True, text=True, stdout=f) | 41 | output = subprocess.run(['df', '-hl'], check=True, text=True, stdout=f, env={}) |
42 | except Exception as e: | 42 | except Exception as e: |
43 | bb.warn(f"Can not get host disk usage: {e}") | 43 | bb.warn(f"Can not get host disk usage: {e}") |
44 | 44 | ||