According to this https://issues.jenkins-ci.org/browse/JENKINS-47566,
the failure seems to be caused by the permission problem.
Change the owner of all files in 'results' directory to be jenkins.
Change-Id: I0ed30018354259601c39016fc1950ea7db867e78
Signed-off-by: xudan <xudan16@huawei.com>
sudo cp -r ${DOVETAIL_HOME}/results ./
# To make sure the file owner is the current user, for the copied results files in the above line
# if not, there will be error when next time to wipe workspace
-# CURRENT_USER=${SUDO_USER:-$USER}
-# PRIMARY_GROUP=$(id -gn $CURRENT_USER)
-# sudo chown -R ${CURRENT_USER}:${PRIMARY_GROUP} ${WORKSPACE}/results
+CURRENT_USER=${SUDO_USER:-$USER}
+PRIMARY_GROUP=$(id -gn $CURRENT_USER)
+sudo chown -R ${CURRENT_USER}:${PRIMARY_GROUP} ${WORKSPACE}/results
#remove useless files to save disk space
sudo rm -rf ./results/workspace