diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-11 13:42:21 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-11 14:24:39 +0100 |
commit | fd6c4f20fd923ab5fb43afd920b07ed1e603f623 (patch) | |
tree | 7e2fe2c51bace546587fca007e961a9045f9c24a | |
parent | ff142bf101bd67db5414ab613787812f9ba99d8c (diff) |
Mirroring: Tests: search for expected messages
-rwxr-xr-x | tests/tests/mirror | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/tests/mirror b/tests/tests/mirror index 874120e..431b391 100755 --- a/tests/tests/mirror +++ b/tests/tests/mirror @@ -21,6 +21,16 @@ mset () { echo >>$drs_dispatch/mirror-settings "$1"; } mset remoterepos="$reposmirror" +commit-build-push-expect-log () { + local msg=$1 + local mpat=$2 + t-commit "$msg" + t-dgit build + LC_MESSAGES=C \ + t-dgit push --new 2>&1 |tee $tmp/push.log + t-grep-mpat "$mpat" $tmp/push.log +} + check-mirrored () { t-reporefs master t-reporefs mirror $pmirror @@ -70,10 +80,10 @@ chmod +x $tmp/stunt-ssh mset rsyncssh=$tmp/stunt-ssh mset remoterepos=HOST:$reposmirror -t-commit "stunt ssh test" -t-dgit build -t-dgit push --new -# ^ mirror should fail due to lack of stunt-ssh-sentinel +# mirror should fail due to lack of stunt-ssh-sentinel + +commit-build-push-expect-log "stunt ssh test" \ + E:'mirror hook failed: .*exited' ls -al $queuedir/$p.a check-not-mirrored @@ -90,9 +100,8 @@ mkfifo $sentinel ${sentinel}2 mset hooktimeout=5 -t-commit "stall timeout test" -t-dgit build -t-dgit push --new +commit-build-push-expect-log "stall timeout test" \ + E:'mirror hook failed: .*timeout' check-not-mirrored |