9a413abcd4
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
25 lines
608 B
Bash
Executable File
25 lines
608 B
Bash
Executable File
#!/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
|
|
|