From 4bac5194e27ae839aaf0be9532cce9b60443a7b3 Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Fri, 6 May 2022 15:12:57 +0800 Subject: [PATCH] collect sim/log directory --- tests/parallel_test/run.sh | 15 +++++++++++++++ tests/parallel_test/run_container.sh | 1 + 2 files changed, 16 insertions(+) diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index a2d3da1564..0ceb1cff5b 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -276,6 +276,21 @@ function run_thread() { $cmd >/dev/null fi fi + # get remote sim dir + local remote_sim_dir="${workdirs[index]}/tmp/thread_volume/$thread_no" + local tarcmd="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" + if [ -z ${passwords[index]} ]; then + tarcmd="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" + fi + cmd="$tarcmd sh -c \"cd $remote_sim_dir; tar -czf sim.tar.gz sim\"" + $cmd + local remote_sim_tar="${workdirs[index]}/tmp/thread_volume/$thread_no/sim.tar.gz" + scpcmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" + if [ -z ${passwords[index]} ]; then + scpcmd="scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" + fi + cmd="$scpcmd:${remote_sim_tar} $log_dir/${case_file}.sim.tar.gz" + $cmd fi done } diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index b0337febcc..bd010698dd 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -79,6 +79,7 @@ ulimit -c unlimited TMP_DIR=$WORKDIR/tmp MOUNT_DIR="" +rm -rf ${TMP_DIR}/thread_volume/$thread_no/sim mkdir -p ${TMP_DIR}/thread_volume/$thread_no/sim/tsim mkdir -p ${TMP_DIR}/thread_volume/$thread_no/coredump rm -rf ${TMP_DIR}/thread_volume/$thread_no/coredump/*