Skip to content
Snippets Groups Projects
Commit 4c2eb064 authored by SZEDER Gábor's avatar SZEDER Gábor Committed by Junio C Hamano
Browse files

t/lib-git-daemon: fix signal checking


Test scripts checking 'git daemon' stop the daemon with a TERM signal,
and the 'stop_git_daemon' helper checks the daemon's exit status to
make sure that it indeed died because of that signal.

This check is bogus since 03c39b34 (t/lib-git-daemon: use
test_match_signal, 2016-06-24), for two reasons:

  - Right after killing 'git daemon', 'stop_git_daemon' saves its exit
    status in a variable, but since 03c39b34 the condition checking
    the exit status looks at '$?', which at this point is not the exit
    status of 'git daemon', but that of the variable assignment, i.e.
    it's always 0.

  - The unexpected exit status should abort the whole test script with
    'error', but it doesn't, because 03c39b34 forgot to negate
    'test_match_signal's exit status in the condition.

This patch fixes both issues.

Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 268fbcd1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -92,7 +92,7 @@ stop_git_daemon() {
kill "$GIT_DAEMON_PID"
wait "$GIT_DAEMON_PID" >&3 2>&4
ret=$?
if test_match_signal 15 $?
if ! test_match_signal 15 $ret
then
error "git daemon exited with status: $ret"
fi
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment