add gating up/down script for devstack

This adds the test infrastructure for testing that unstack.sh and
clean.sh do the right thing, and actually stop what's expected. This
is designed to be used in upstream testing to make unstack and clean a
bit more certain.

It includes numerous fixes to make these pass in an errexit
environment with the gate config. The scripts still don't run under
errexit because we don't assume we've handled all possible cleanup safely.

Change-Id: I774dfb2cc934367eef2bb7ea5123197f6da7565b
This commit is contained in:
Sean Dague
2015-02-04 12:44:18 -05:00
parent fdae448a05
commit 9a413abcd4
7 changed files with 44 additions and 12 deletions

24
gate/updown.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash -xe
#
# An up / down test for gate functional testing
#
# Note: this is expected to start running as jenkins
# Step 1: give back sudoers permissions to devstack
TEMPFILE=`mktemp`
echo "stack ALL=(root) NOPASSWD:ALL" >$TEMPFILE
chmod 0440 $TEMPFILE
sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/51_stack_sh
# TODO: do something to start a guest to create crud that should
# disappear
# Step 2: unstack
echo "Running unstack.sh"
sudo -H -u stack stdbuf -oL -eL bash -ex ./unstack.sh
# Step 3: clean
echo "Running clean.sh"
sudo -H -u stack stdbuf -oL -eL bash -ex ./clean.sh