Exercises: euca bugfix, output cleanup.
Don't log stderr per-exercise, because stdout is barfy anyway. Move the state of skip/pass/fail to the end of the exercise run.
This commit is contained in:
parent
2599b3165a
commit
9e9132ddaf
2 changed files with 27 additions and 5 deletions
30
exercise.sh
30
exercise.sh
|
@ -6,19 +6,41 @@
|
||||||
# to refrain from exercising euca.sh use SKIP_EXERCISES=euca
|
# to refrain from exercising euca.sh use SKIP_EXERCISES=euca
|
||||||
SKIP_EXERCISES=${SKIP_EXERCISES:-""}
|
SKIP_EXERCISES=${SKIP_EXERCISES:-""}
|
||||||
|
|
||||||
|
# Locate the scripts we should run
|
||||||
EXERCISE_DIR=$(dirname "$0")/exercises
|
EXERCISE_DIR=$(dirname "$0")/exercises
|
||||||
basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done)
|
basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done)
|
||||||
|
|
||||||
|
# Track the state of each script
|
||||||
|
passes=""
|
||||||
|
failures=""
|
||||||
|
skips=""
|
||||||
|
|
||||||
|
# Loop over each possible script (by basename)
|
||||||
for script in $basenames ; do
|
for script in $basenames ; do
|
||||||
if [[ "$SKIP_EXERCISES" =~ $script ]] ; then
|
if [[ "$SKIP_EXERCISES" =~ $script ]] ; then
|
||||||
echo SKIPPING $script
|
skips="$skips $script"
|
||||||
else
|
else
|
||||||
|
echo =========================
|
||||||
echo Running $script
|
echo Running $script
|
||||||
$EXERCISE_DIR/$script.sh 2> $script.log
|
echo =========================
|
||||||
|
$EXERCISE_DIR/$script.sh
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
echo FAILED. See $script.log
|
failures="$failures $script"
|
||||||
else
|
else
|
||||||
rm $script.log
|
passes="$passes $script"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# output status of exercise run
|
||||||
|
echo =========================
|
||||||
|
echo =========================
|
||||||
|
for script in $skips ; do
|
||||||
|
echo SKIP $script
|
||||||
|
done
|
||||||
|
for script in $passes ; do
|
||||||
|
echo PASS $script
|
||||||
|
done
|
||||||
|
for script in $failures ; do
|
||||||
|
echo FAILED $script
|
||||||
|
done
|
||||||
|
|
|
@ -25,7 +25,7 @@ popd
|
||||||
IMAGE=`euca-describe-images | grep machine | cut -f2`
|
IMAGE=`euca-describe-images | grep machine | cut -f2`
|
||||||
|
|
||||||
# launch it
|
# launch it
|
||||||
INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2`
|
INSTANCE=`euca-run-instances $IMAGE | grep INSTANCE | cut -f2`
|
||||||
|
|
||||||
# assure it has booted within a reasonable time
|
# assure it has booted within a reasonable time
|
||||||
if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
|
if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
|
||||||
|
|
Loading…
Reference in a new issue