Enable preseeding testrepository with a number of streams

Project-config change Ib0e815ca1966f5b5806fb257b91ac7a25d4db18d will
change how the subunit streams are stored on the images. This commit
updates the logic around loading the subunit streams to handle both
the new format and the current method.

Change-Id: I8b71a96a34bf54aa9d60f1ef2f94e77103f6b914
This commit is contained in:
Matthew Treinish
2015-02-04 14:56:14 -05:00
parent c6073f7f1f
commit e003c47822

View File

@@ -520,14 +520,25 @@ if [[ "$DEVSTACK_GATE_EXERCISES" -eq "1" ]]; then
sudo -H -u stack ./exercise.sh
fi
function load_subunit_stream {
local stream=$1;
pushd /opt/stack/new/tempest/
sudo testr load --force-init $stream
popd
}
if [[ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]]; then
#TODO(mtreinish): This if block can be removed after all the nodepool images
# are built using with streams dir instead
if [[ -f /opt/git/openstack/tempest/.testrepository/0 ]]; then
pushd /opt/stack/new/tempest/
if [[ ! -d /opt/stack/new/tempest/.testrepository ]]; then
sudo testr init
fi
sudo sh -c 'cat /opt/git/openstack/tempest/.testrepository/0 | subunit-1to2 | testr load'
popd
temp_stream=`mktemp`
subunit-1to2 /opt/git/openstack/tempest/.testrepository/0 > $temp_stream
load_subunit_stream $temp_stream
elif [[ -d /opt/git/openstack/tempest/preseed-streams ]]; then
for stream in /opt/git/openstack/tempest/preseed-streams/* ; do
load_subunit_stream $stream
done
fi
# under tempest isolation tempest will need to write .tox dir, log files