diff options
| -rw-r--r-- | meta/lib/oeqa/utils/postactions.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py index 008968b56a..03cecdc215 100644 --- a/meta/lib/oeqa/utils/postactions.py +++ b/meta/lib/oeqa/utils/postactions.py | |||
| @@ -32,6 +32,16 @@ def get_target_disk_usage(d, tc): | |||
| 32 | except Exception as e: | 32 | except Exception as e: |
| 33 | bb.warn(f"Can not get target disk usage: {e}") | 33 | bb.warn(f"Can not get target disk usage: {e}") |
| 34 | 34 | ||
| 35 | def get_host_disk_usage(d, tc): | ||
| 36 | import subprocess | ||
| 37 | |||
| 38 | output_file = os.path.join(get_json_result_dir(d), "artifacts", "host_disk_usage.txt") | ||
| 39 | try: | ||
| 40 | with open(output_file, 'w') as f: | ||
| 41 | output = subprocess.run(['/usr/bin/df', '-hl'], check=True, text=True, stdout=f) | ||
| 42 | except Exception as e: | ||
| 43 | bb.warn(f"Can not get host disk usage: {e}") | ||
| 44 | |||
| 35 | ################################################################## | 45 | ################################################################## |
| 36 | # Artifacts retrieval | 46 | # Artifacts retrieval |
| 37 | ################################################################## | 47 | ################################################################## |
| @@ -80,7 +90,8 @@ def run_failed_tests_post_actions(d, tc): | |||
| 80 | post_actions=[ | 90 | post_actions=[ |
| 81 | create_artifacts_directory, | 91 | create_artifacts_directory, |
| 82 | list_and_fetch_failed_tests_artifacts, | 92 | list_and_fetch_failed_tests_artifacts, |
| 83 | get_target_disk_usage | 93 | get_target_disk_usage, |
| 94 | get_host_disk_usage | ||
| 84 | ] | 95 | ] |
| 85 | 96 | ||
| 86 | for action in post_actions: | 97 | for action in post_actions: |
