diff --git a/roles/run-test/templates/oooq_common_functions.sh.j2 b/roles/run-test/templates/oooq_common_functions.sh.j2 index 6b024d2e5..952e684d0 100644 --- a/roles/run-test/templates/oooq_common_functions.sh.j2 +++ b/roles/run-test/templates/oooq_common_functions.sh.j2 @@ -116,13 +116,21 @@ elif [[ -e $LOGS_DIR/undercloud/home/$USER/undercloud_sanity.subunit.gz ]]; then fi # Copy tempest.html to root dir -cp $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ${LOGS_DIR} || true +if [ -f $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ]; then + cp $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ${LOGS_DIR} +fi # Copy tempest and .testrepository directory to /opt/stack/new/tempest and # unzip -sudo mkdir -p /opt/stack/new -sudo cp -Rf $LOGS_DIR/undercloud/home/$USER/tempest /opt/stack/new || true -sudo gzip -d -r /opt/stack/new/tempest/.testrepository || true +sudo -s -- < $LOGS_DIR/quickstart_collect_logs.log || \ echo "WARNING: quickstart collect-logs failed, check quickstart_collectlogs.log for details" - cp $LOGS_DIR/undercloud/var/log/postci.txt.gz $LOGS_DIR/ || true + if [ -f $LOGS_DIR/undercloud/var/log/postci.txt.gz ]; then + cp $LOGS_DIR/undercloud/var/log/postci.txt.gz $LOGS_DIR/ + fi if [[ -e $LOGS_DIR/undercloud/home/$USER/tempest/testrepository.subunit.gz ]]; then cp $LOGS_DIR/undercloud/home/$USER/tempest/testrepository.subunit.gz ${LOGS_DIR}/testrepository.subunit.gz @@ -134,13 +136,21 @@ function create_collect_logs_script { fi # Copy tempest.html to root dir - cp $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ${LOGS_DIR} || true + if [ -f $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ]; then + cp $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ${LOGS_DIR} + fi # Copy tempest and .testrepository directory to /opt/stack/new/tempest and # unzip - sudo mkdir -p /opt/stack/new - sudo cp -Rf $LOGS_DIR/undercloud/home/$USER/tempest /opt/stack/new || true - sudo gzip -d -r /opt/stack/new/tempest/.testrepository || true + sudo -s -- <