diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-04-07 16:38:38 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-04-07 16:38:38 +0100 |
commit | 463de39e27dad44cf91f8257c647664df717af68 (patch) | |
tree | 53d59722c81595687a4367f32fdffeadd0fc7337 /test-locking | |
parent | d32b328d0912fabe997b9c5a5a440d69611d314d (diff) | |
download | obnam-463de39e27dad44cf91f8257c647664df717af68.tar.gz |
Put lock testing log and output files in temporary directories
No point in leaving them cluttering the current work directory,
or overwriting user data there.
Diffstat (limited to 'test-locking')
-rwxr-xr-x | test-locking | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test-locking b/test-locking index c32afa71..936475eb 100755 --- a/test-locking +++ b/test-locking @@ -29,13 +29,16 @@ NCLIENTS="$1" NGENERATIONS="$2" repourl="$3" repopath="$4" -pids="$(mktemp)" +tempdir="$(mktemp -d)" +pids="$tempdir/pids" echo "Starting backups: $NCLIENTS clients $NGENERATIONS generations" +echo "Using temporary directory $tempdir" + for i in $(seq "$NCLIENTS") do ./test-many-generations "$NGENERATIONS" "$repourl" "$repopath" \ - "client-$i" > "client-$i.output" 2>&1 & + "client-$i" > "$tempdir/client-$i.output" 2>&1 & echo "$!" >> "$pids" done @@ -53,6 +56,9 @@ do fi done -rm -f "$pids" +if [ "$errors" = 0 ] +then + rm -rf "$tempdir" +fi exit $errors |