3 # Copyright (C) 2009 The Android Open Source Project
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 LOGDIR="$HOME/backup_tests"
21 LOGFILE="$LOGDIR/backup_stress.`date +%s`.log"
22 export BUGREPORT_DIR="$LOGDIR/bugreports"
24 # make sure that we have a place to put logs and bugreports
25 mkdir -p $LOGDIR $BUGREPORT_DIR
27 echo "logfile is $LOGFILE"
33 echo "Iteration $i at `date`"
36 ./test_backup.sh "$@" 2>&1
39 echo "Restore at `date`"
42 ./test_restore.sh "$@" 2>&1 || failed=1
44 if [ "$failed" -ne 0 ]; then
45 failures=$(($failures+1))
46 # Long and verbose so it sticks out
47 echo "FAILED iteration $i of $iterations; $failures failures so far"
48 echo "FAILED iteration $i of $iterations; $failures failures so far" > /dev/stderr
50 printf "Iteration %d:\tPASS; remaining: %d\n" $i $(($iterations - $i - 1))
51 printf "Iteration %d:\tPASS; remaining: %d\n" $i $(($iterations - $i - 1)) > /dev/stderr
54 echo "End $i at `date`"
57 if [ $i -eq $iterations ]; then
58 echo "DONE: $iterations iterations with $failures failures."
59 echo "DONE: $iterations iterations with $failures failures." > /dev/stderr
60 [ "$failures" -eq 0 ] && exit 0