]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Handle result files permissions correctly 93/41893/1
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 11 Apr 2022 10:06:33 +0000 (14:06 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 11 Apr 2022 10:06:33 +0000 (14:06 +0400)
Change-Id: I291ec351fe722d87749c92292f0c4e47afc882e2

maintenance-ci/mos/rally-docker/run_rally_tempest.sh
maintenance-ci/mos/scripts/maintenance-tempest-runner.sh

index 01b6f7494ab90d46fa8fc654bbf887087e496d74..31bc27756a38e3bc820f680ccb86dcdb1d3c0e20 100644 (file)
@@ -103,10 +103,18 @@ cp "$(find / -name tempest.log)" /root/rally/tempest.log
 git clone https://github.com/EduardFazliev/rally_json2junit
 python rally_json2junit/rally_json2junit/results_parser.py output.json
 
+USER_ID=$(ls -nd /root/shared/id_rsa | awk '{print $3}')
+GROUP_ID=$(ls -nd /root/shared/id_rsa | awk '{print $4}')
+
+chown -hR ${USER_ID}:${GROUP_ID} /root/rally/tempest.conf
+chown -hR ${USER_ID}:${GROUP_ID} /root/rally/log.log
+chown -hR ${USER_ID}:${GROUP_ID} /root/output.json
+chown -hR ${USER_ID}:${GROUP_ID} /root/verification.xml
+
 mkdir -p /root/shared/results
-chmod 777 /root/shared/results
 cp /root/rally/log.log /root/shared/results/
 cp /root/rally/tempest.log /root/shared/results/
-cp "$(find / -name verification.xml)" /root/rally/results
-cp "$(find / -name output.json)" /root/shared/results/
-chmod -R +w /root/shared
\ No newline at end of file
+cp /root/verification.xml /root/shared/results/
+cp /root/output.json /root/shared/results/
+
+chown -hR ${USER_ID}:${GROUP_ID} /root/shared
\ No newline at end of file
index c217cfa2d3a336835fbab6206c0eb2263b926161..b07b1f7d934bcf579c880769d28c7fdb2f64f737 100644 (file)
@@ -37,8 +37,6 @@ wait_up_env() {
 if [ -f "${REPORT_PREFIX}/verification.xml" ]; then
     mv -f "${REPORT_PREFIX}/verification.xml" "${REPORT_PREFIX}/verification.xml.unreported"
 fi
-rm -rf log.log verification.xml tempest.log tempest.conf
-
 source "${VENV_PATH}/bin/activate"
 
   # retry 3 times, because dos.py is not stable sometimes (ntp problem)