Switch to $USER in post_test_hooks

As a first step to zuul migration, switch to $USER from a static
"jenkins" username.

Change-Id: I26ed12133c75a69182c56b6ecf483fcdc37d98f3
This commit is contained in:
Ian Wienand 2017-10-16 10:47:59 +11:00
parent 33403348a2
commit 358544d40e
2 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ function generate_testr_results {
sudo .tox/functional/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
sudo gzip -9 $BASE/logs/testrepository.subunit
sudo gzip -9 $BASE/logs/testr_results.html
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
elif [ -f .stestr/0 ]; then
sudo .tox/functional/bin/stestr last --subunit > $WORKSPACE/testrepository.subunit
@ -21,13 +21,13 @@ function generate_testr_results {
sudo .tox/functional/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
sudo gzip -9 $BASE/logs/testrepository.subunit
sudo gzip -9 $BASE/logs/testr_results.html
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
fi
}
export OPENSTACKCLIENT_DIR="$BASE/new/python-openstackclient"
sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR
sudo chown -R $USER:stack $OPENSTACKCLIENT_DIR
# Go to the openstackclient dir
cd $OPENSTACKCLIENT_DIR
@ -42,7 +42,7 @@ echo 'Running tests with:'
env | grep OS
# Preserve env for OS_ credentials
sudo -E -H -u jenkins tox -efunctional
sudo -E -H -u $USER tox -efunctional
EXIT_CODE=$?
set -e

View File

@ -17,7 +17,7 @@ function generate_testr_results {
sudo .tox/functional-tips/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
sudo gzip -9 $BASE/logs/testrepository.subunit
sudo gzip -9 $BASE/logs/testr_results.html
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
elif [ -f .stestr/0 ]; then
sudo .tox/functional-tips/bin/stestr last --subunit > $WORKSPACE/testrepository.subunit
@ -25,13 +25,13 @@ function generate_testr_results {
sudo .tox/functional-tips/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
sudo gzip -9 $BASE/logs/testrepository.subunit
sudo gzip -9 $BASE/logs/testr_results.html
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
fi
}
export OPENSTACKCLIENT_DIR="$BASE/new/python-openstackclient"
sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR
sudo chown -R $USER:stack $OPENSTACKCLIENT_DIR
# Go to the openstackclient dir
cd $OPENSTACKCLIENT_DIR
@ -46,7 +46,7 @@ echo 'Running tests with:'
env | grep OS
# Preserve env for OS_ credentials
sudo -E -H -u jenkins tox -e functional-tips
sudo -E -H -u $USER tox -e functional-tips
EXIT_CODE=$?
set -e