diff options
author | Alexis Lothoré <alexis.lothore@bootlin.com> | 2024-02-26 10:19:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-27 11:35:43 +0000 |
commit | d4267a8dce8fde4e415f7a1a93bcc9edb5402077 (patch) | |
tree | ba609000b0f574a4246b210aedf677d26bd04cfe | |
parent | 9a46657a25bbd2dc084d9e9ce8b5ad2207751182 (diff) | |
download | poky-d4267a8dce8fde4e415f7a1a93bcc9edb5402077.tar.gz |
oeqa/utils/postactions: add target disk usage stat as post action
In order to debug issues related to disk space (see [1]), add a failed
tests post action to retrieve disk usage on the target. Rely on the test
context object to run the corresponding command onto the target
[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15220
(From OE-Core rev: 637e216b0e5191571270aa07e1f50a6e41a8c08f)
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/utils/postactions.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py index 7014b2830a..008968b56a 100644 --- a/meta/lib/oeqa/utils/postactions.py +++ b/meta/lib/oeqa/utils/postactions.py | |||
@@ -19,6 +19,20 @@ def create_artifacts_directory(d, tc): | |||
19 | os.makedirs(local_artifacts_dir) | 19 | os.makedirs(local_artifacts_dir) |
20 | 20 | ||
21 | ################################################################## | 21 | ################################################################## |
22 | # Host/target statistics | ||
23 | ################################################################## | ||
24 | |||
25 | def get_target_disk_usage(d, tc): | ||
26 | output_file = os.path.join(get_json_result_dir(d), "artifacts", "target_disk_usage.txt") | ||
27 | try: | ||
28 | (status, output) = tc.target.run('df -hl') | ||
29 | with open(output_file, 'w') as f: | ||
30 | f.write(output) | ||
31 | f.write("\n") | ||
32 | except Exception as e: | ||
33 | bb.warn(f"Can not get target disk usage: {e}") | ||
34 | |||
35 | ################################################################## | ||
22 | # Artifacts retrieval | 36 | # Artifacts retrieval |
23 | ################################################################## | 37 | ################################################################## |
24 | 38 | ||
@@ -65,7 +79,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc): | |||
65 | def run_failed_tests_post_actions(d, tc): | 79 | def run_failed_tests_post_actions(d, tc): |
66 | post_actions=[ | 80 | post_actions=[ |
67 | create_artifacts_directory, | 81 | create_artifacts_directory, |
68 | list_and_fetch_failed_tests_artifacts | 82 | list_and_fetch_failed_tests_artifacts, |
83 | get_target_disk_usage | ||
69 | ] | 84 | ] |
70 | 85 | ||
71 | for action in post_actions: | 86 | for action in post_actions: |