Re: [PATCH] t3200: don't grep for `strerror()` string

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

 



Martin Ågren <martin.agren@xxxxxxxxx> writes:

> In 6b7093064a ("t3200: test for specific errors", 2020-06-15), we
> learned to grep stderr to ensure that the failing `git branch`
> invocations fail for the right reason. In two of these tests, we grep
> for "File exists", expecting the string to show up there since config.c
> calls `error_errno()`, which ends up including `strerror(errno)` in the
> error message.
>
> But as we saw in 4605a73073 ("t1091: don't grep for `strerror()`
> string", 2020-03-08), there exists at least one implementation where
> `strerror()` yields a slightly different string than the one we're
> grepping for. In particular, these tests fail on the NonStop platform.
>
> Similar to 4605a73073, grep for the beginning of the string instead to
> avoid relying on `strerror()` behavior.
>
> Reported-by: Randall S. Becker <rsbecker@xxxxxxxxxxxxx>
> Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx>
> ---

Yup, that looks like a good description and a fix to check only the
parts of the message we write, ignoring what the system library may
add.

>  Hi Randall,
>
>  Does this fix the test for you?
>
>  Martin

Hopefully it would ;-)





[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