diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-03-06 23:08:18 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-03-06 23:08:18 +0000 |
commit | cf1f447a22daadead0858486a8170eb61253f75f (patch) | |
tree | f67c219d64522d6031db72c570f6156ba04d8cc2 /test-locking | |
parent | ff54e271c2db66184fe0ac9c98422f0713c14c8c (diff) | |
download | obnam-cf1f447a22daadead0858486a8170eb61253f75f.tar.gz |
Allow user to specify number of generations to test
Diffstat (limited to 'test-locking')
-rwxr-xr-x | test-locking | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test-locking b/test-locking index 1c6cce09..c32afa71 100755 --- a/test-locking +++ b/test-locking @@ -23,14 +23,15 @@ die() exit 1 } -[ "$#" = 3 ] || die "Bad usage, read source!" +[ "$#" = 4 ] || die "Bad usage, read source!" NCLIENTS="$1" -NGENERATIONS=16 -repourl="$2" -repopath="$3" +NGENERATIONS="$2" +repourl="$3" +repopath="$4" pids="$(mktemp)" +echo "Starting backups: $NCLIENTS clients $NGENERATIONS generations" for i in $(seq "$NCLIENTS") do ./test-many-generations "$NGENERATIONS" "$repourl" "$repopath" \ @@ -38,12 +39,16 @@ do echo "$!" >> "$pids" done +echo "Waiting for clients to finish... this may take a long time" errors=0 for pid in $(cat "$pids") do if ! wait "$pid" then - echo "at least one client failed" 1>&2 + if [ "$errors" = 0 ] + then + echo "at least one client failed" 1>&2 + fi errors=1 fi done |