summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/postactions.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py
index ecdddd2d40..2a08129d6c 100644
--- a/meta/lib/oeqa/utils/postactions.py
+++ b/meta/lib/oeqa/utils/postactions.py
@@ -62,17 +62,16 @@ def get_artifacts_list(target, raw_list):
62 return result 62 return result
63 63
64def retrieve_test_artifacts(target, artifacts_list, target_dir): 64def retrieve_test_artifacts(target, artifacts_list, target_dir):
65 import io, subprocess
65 local_artifacts_dir = os.path.join(target_dir, "artifacts") 66 local_artifacts_dir = os.path.join(target_dir, "artifacts")
66 for artifact_path in artifacts_list: 67 try:
67 if not os.path.isabs(artifact_path): 68 cmd = "tar zcf - " + " ".join(artifacts_list)
68 bb.warn(f"{artifact_path} is not an absolute path") 69 (status, output) = target.run(cmd, raw = True)
69 continue 70 if status != 0 or not output:
70 try: 71 raise Exception("Error while fetching compressed artifacts")
71 dest_dir = os.path.join(local_artifacts_dir, os.path.dirname(artifact_path[1:])) 72 p = subprocess.run(["tar", "zxf", "-", "-C", local_artifacts_dir], input=output)
72 os.makedirs(dest_dir, exist_ok=True) 73 except Exception as e:
73 target.copyFrom(artifact_path, dest_dir) 74 bb.warn(f"Can not retrieve {artifact_path} from test target: {e}")
74 except Exception as e:
75 bb.warn(f"Can not retrieve {artifact_path} from test target: {e}")
76 75
77def list_and_fetch_failed_tests_artifacts(d, tc): 76def list_and_fetch_failed_tests_artifacts(d, tc):
78 artifacts_list = get_artifacts_list(tc.target, d.getVar("TESTIMAGE_FAILED_QA_ARTIFACTS")) 77 artifacts_list = get_artifacts_list(tc.target, d.getVar("TESTIMAGE_FAILED_QA_ARTIFACTS"))