testr last requires sudo

736d1c987b breaks testrepository.subunit.gz
 and testr_results.html.gz

Basic testing shows that running the command with sudo resolves the issue.
Without sudo, this is the error message run using jenkins user:
"local variable 'run_subunit_content' referenced before assignment"

Change-Id: Ia2f10cb2d09aa5db3957e30f9a7c25cc40c54881
This commit is contained in:
Ramy Asselin
2015-01-12 14:34:37 -08:00
parent 00f15b2508
commit 80fe49c323

View File

@@ -635,7 +635,7 @@ function cleanup_host {
# Process testr artifacts.
if [ -f $BASE/new/tempest/.testrepository/0 ]; then
pushd $BASE/new/tempest
testr last --subunit > $WORKSPACE/testrepository.subunit
sudo testr last --subunit > $WORKSPACE/testrepository.subunit
popd
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
sudo python /usr/local/jenkins/slave_scripts/subunit2html.py $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
@@ -652,7 +652,7 @@ function cleanup_host {
fi
if [ -f $BASE/old/tempest/.testrepository/0 ]; then
pushd $BASE/old/tempest
testr last --subunit > $WORKSPACE/testrepository.subunit
sudo testr last --subunit > $WORKSPACE/testrepository.subunit
popd
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/old/testrepository.subunit
sudo python /usr/local/jenkins/slave_scripts/subunit2html.py $BASE/logs/old/testrepository.subunit $BASE/logs/old/testr_results.html