Skip to content

Test suite fixes for musl libc

Patrick Steinhardt util-linux 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 5 repliesIn review
  2. v16 patches 1 replySuperseded

Changes in v2 from the cover letter

=============

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6tests: remove reliance on buffer behaviour of stderr/stdout streamstests/expected/misc/swaplabel tests/expected/rename/exit_codes tests/functions.sh +2 more+39 -1810 replies
2/6tests: libfdisk: remove reliance on buffer behaviour of standard streamstests/expected/libfdisk/mkpart-full-gpt tests/expected/libfdisk/mkpart-full-gpt-err-overlap tests/expected/libfdisk/mkpart-full-gpt-nopartno +11 more+81 -810 replies
3/6tests: colcrt: fix reliance on EILSEQ in POSIX localetests/ts/colcrt/regressions+1 -10 replies
4/6tests: column: use actually invalid multibytes to test encodingtests/expected/column/invalid-multibyte tests/ts/column/invalid-multibyte+2 -20 replies
5/6tests: col: avoid hardcoding of errno stringtests/commands.sh tests/expected/col/multibyte tests/helpers/Makemodule.am +2 more+50 -30 replies
6/6tests: fdisk: avoid hardcoding of errno stringtests/expected/fdisk/oddinput tests/helpers/test_strerror.c tests/ts/fdisk/oddinput+8 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] Test suite fixes for musl libc

Hi,

Changes in v2
=============

As proposed by Karel, this removes ts_unbuffered and instead extends ts_run. Instead of accepting parameters like "leak" or "unbuf" though, I opted to instead accept dashed longopts only as that should allow us to keep all existing invocations of ts_run the same. At least as far as I've seen, there is none that ever starts with "-".

So one may now execute ts_run --unbuffered $TESTPROG to use "stdbuf --output=0" and thus stop buffering. But the mechanism is easily extensible, as proposed by Karel.

Old cover letter
================

on latest master of util-linux, there's currently 20 test- and subtest failures on musl based systems. There's three different categories of failures:

- Reliance on buffering properties of stdout/stderr.

- Expectance of non-standard error messages returned by strerror(3P).

- Expectance of EILSEQ with POSIX locale.

This patch set fixes all of the above, bringing down the number of failures from 20 to a single test failure. The remaining failure is in getopt(1), which documents and implicitly relies on the POSIXLY_CORRECT environment variable when calling getopt_long from glibc. Adhering to this variable isn't implemented by musl libc, so to get this working correctly one would have to modify getopt(1) itself, e.g. by automatically prepending a '+' to the optstr if the envvar is set. But I'll leave that to another patch series.

Regards
Patrick

Patrick Steinhardt (6):
tests: remove reliance on buffer behaviour of stderr/stdout streams
tests: libfdisk: remove reliance on buffer behaviour of standard
streams
tests: colcrt: fix reliance on EILSEQ in POSIX locale
tests: column: use actually invalid multibytes to test encoding
tests: col: avoid hardcoding of errno string
tests: fdisk: avoid hardcoding of errno string

 tests/commands.sh                             |  1 +
 tests/expected/col/multibyte                  |  2 +-
 tests/expected/column/invalid-multibyte       |  2 +-
 tests/expected/fdisk/oddinput                 |  4 +-
 tests/expected/libfdisk/mkpart-full-gpt       | 14 +++---
 .../libfdisk/mkpart-full-gpt-err-overlap      |  8 ++--
 .../libfdisk/mkpart-full-gpt-nopartno         | 14 +++---
 .../libfdisk/mkpart-full-gpt-partno-gap       | 14 +++---
 .../libfdisk/mkpart-full-gpt-space-gap        | 10 ++--
 .../libfdisk/mkpart-full-mbr-err-logical      | 14 +++---
 .../libfdisk/mkpart-full-mbr-err-nospace      |  6 +--
 .../libfdisk/mkpart-full-mbr-err-primary      |  6 +--
 .../expected/libfdisk/mkpart-full-mbr-logical | 14 +++---
 .../libfdisk/mkpart-full-mbr-nopartno         | 14 +++---
 .../expected/libfdisk/mkpart-full-mbr-primary |  8 ++--
 .../libfdisk/mkpart-full-mbr-primary-nopartno |  8 ++--
 .../libfdisk/mkpart-full-mbr-space-gap        |  6 +--
 tests/expected/misc/swaplabel                 |  2 +-
 tests/expected/rename/exit_codes              |  2 +-
 tests/functions.sh                            | 47 ++++++++++++++-----
 tests/helpers/Makemodule.am                   |  3 ++
 tests/helpers/test_strerror.c                 | 44 +++++++++++++++++
 tests/ts/col/multibyte                        |  5 +-
 tests/ts/colcrt/regressions                   |  2 +-
 tests/ts/column/invalid-multibyte             |  2 +-
 tests/ts/fdisk/oddinput                       |  6 ++-
 tests/ts/libfdisk/mkpart-full                 | 26 +++++-----
 tests/ts/misc/swaplabel                       |  4 +-
 tests/ts/rename/exit_codes                    |  2 +-
 29 files changed, 181 insertions(+), 109 deletions(-)
 create mode 100644 tests/helpers/test_strerror.c
Signature · 1 line
2.23.0