glibc/sysdeps
Luke Shumaker d9611e3085
linux ttyname{_r}: Add tests
Add a new tst-ttyname test that includes several named sub-testcases.

This patch is ordered after the patches with the fixes that it tests for (to
avoid breaking `git bisect`), but for reference, here's how each relevant change
so far affected the testcases in this commit, starting with
15e9a4f378c8607c2ae1aa465436af4321db0e23:

  |                                 | before  |         | make checks | don't |
  |                                 | 15e9a4f | 15e9a4f | consistent  | bail  |
  |---------------------------------+---------+---------+-------------+-------|
  | basic smoketest                 | PASS    | PASS    | PASS        | PASS  |
  | no conflict, no match           | PASS[1] | PASS    | PASS        | PASS  |
  | no conflict, console            | PASS    | FAIL!   | FAIL        | PASS! |
  | conflict, no match              | FAIL    | PASS!   | PASS        | PASS  |
  | conflict, console               | FAIL    | FAIL    | FAIL        | PASS! |
  | with readlink target            | PASS    | PASS    | PASS        | PASS  |
  | with readlink trap; fallback    | FAIL    | FAIL    | FAIL        | PASS! |
  | with readlink trap; no fallback | FAIL    | PASS!   | PASS        | PASS  |
  | with search-path trap           | FAIL    | FAIL    | PASS!       | PASS  |
  |---------------------------------+---------+---------+-------------+-------|
  |                                 | 4/9     | 5/9     | 6/9         | 9/9   |

  [1]: 15e9a4f introduced a semantic that, under certain failure
       conditions, ttyname sets errno=ENODEV, where previously it didn't
       set errno; it's not quite fair to hold "before 15e9a4f" ttyname to
       those new semantics.  This testcase actually fails, but would have
       passed if we tested for the old the semantics.

Each of the failing tests before 15e9a4f are all essentially the same bug: that
it returns a PTY slave with the correct minor device number, but from the wrong
devpts filesystem instance.

15e9a4f sought to fix this, but missed several of the cases that can cause this
to happen, and also broke the case where both the erroneous PTY and the correct
PTY exist.

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 21:09:01 +01:00
..
aarch64 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
alpha nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
arm nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
generic ld.so: Add architecture specific fields 2017-11-13 08:02:52 -08:00
gnu hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition 2017-09-28 01:05:18 +02:00
hppa Fix clog10_downward ulps on hppa. 2017-11-11 12:12:28 -05:00
i386 nptl: Add tests for internal pthread_mutex_t offsets 2017-11-07 09:48:28 -02:00
ia64 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
ieee754 Add bits/floatn.h defines for more _FloatN / _FloatNx types. 2017-10-20 21:42:51 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
mach Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN 2017-10-03 01:33:38 +02:00
microblaze nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
mips nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
nios2 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
nptl nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
posix Cleanup sigpause implementation 2017-11-15 15:45:39 -02:00
powerpc nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
pthread aio: Remove internal_function function attribute 2017-08-31 15:59:06 +02:00
s390 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
sh nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
sparc nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
tile nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
unix linux ttyname{_r}: Add tests 2017-11-15 21:09:01 +01:00
wordsize-32 Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
wordsize-64 posix: Consolidate Linux glob implementation 2017-09-08 16:34:02 +02:00
x86 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
x86_64 nptl: Add tests for internal pthread_mutex_t offsets 2017-11-07 09:48:28 -02:00