summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2024-02-26 10:19:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-27 11:35:40 +0000
commit637e216b0e5191571270aa07e1f50a6e41a8c08f (patch)
tree403e607fb381abae7e756841fb72e023abcdde3f /meta/lib/oeqa
parent5d796586a9342f4f984494a5b493dbaf77af7026 (diff)
downloadopenembedded-core-637e216b0e5191571270aa07e1f50a6e41a8c08f.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 Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/utils/postactions.py17
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):
os.makedirs(local_artifacts_dir)
##################################################################
+# Host/target statistics
+##################################################################
+
+def get_target_disk_usage(d, tc):
+ output_file = os.path.join(get_json_result_dir(d), "artifacts", "target_disk_usage.txt")
+ try:
+ (status, output) = tc.target.run('df -hl')
+ with open(output_file, 'w') as f:
+ f.write(output)
+ f.write("\n")
+ except Exception as e:
+ bb.warn(f"Can not get target disk usage: {e}")
+
+##################################################################
# Artifacts retrieval
##################################################################
@@ -65,7 +79,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc):
def run_failed_tests_post_actions(d, tc):
post_actions=[
create_artifacts_directory,
- list_and_fetch_failed_tests_artifacts
+ list_and_fetch_failed_tests_artifacts,
+ get_target_disk_usage
]
for action in post_actions: