Re: [PATCH] t/lib-git-daemon: fix signal checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 26, 2018 at 09:03:37PM +0100, SZEDER Gábor wrote:

> 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 03c39b3458 (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 03c39b3458 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 03c39b3458 forgot to negate
>     'test_match_signal's exit status in the condition.
> 
> This patch fixes both issues.

Oof. Who says two wrongs don't make a right? :)

Thanks for catching this, and the patch looks obviously correct.

I peeked at the other test_match_signal conversions from that era, and
they all look sane.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux