From: Luke Shumaker <lukeshu@lukeshu.com>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH v3] tst-ttyname: skip the test if failed to become root
Date: Tue, 02 Jan 2018 05:19:00 -0000 [thread overview]
Message-ID: <87a7xwx2fh.wl-lukeshu@lukeshu.com> (raw)
In-Reply-To: <20171231001152.GA26394@altlinux.org>
On Sat, 30 Dec 2017 19:11:52 -0500,
Dmitry V. Levin wrote:
> On Sat, Dec 30, 2017 at 06:09:22PM -0500, Luke Shumaker wrote:
> > Florian Weimer wrote:
> > > I don't think the glibc test suite is supposed to pass in such an
> > > environment [without ptmx]. If you don't provide /dev/null, /sys,
> > > or /proc to the tests, some of them will fail as well. I still
> > > think that the current test accurately reflects the inadequacy of
> > > your test environment.
>
> Also, one cannot declare these environments unsupported in master branch
> without reaching a consensus.
On Fri, 29 Dec 2017 08:55:17 -0500,
Florian Weimer wrote:
> * Dmitry V. Levin:
> > It used to work perfectly for at least 15 years, and it still works
> > when tst-ttyname is fixed.
>
> This just reflects that we did not have sufficient test coverage for
> the PTY code.
Obviously, I'm the outsider here; and can't authoritatively comment on
whether glibc supports environments without ptmx / UNIX 98 PTYs, but
from looking over the codebase:
1. There is insufficient test coverate of posix_openpt and friends to
conclude that Linux environments without ptmx were previously
supported.
The only other tests that call posix_openpt or other PTY-opening
functions are
- debug/tst-chk1.c
- login/tst-grantpt.c
- login/tst-ptsname.c
I don't have a good idea of what tst-chk1 does, or why it doesn't
error if posix_openpt fails; but the other 2 ignore an error
because "maybe the system does not have SUS pseudo terminals", and
the posix_openpt bit is just one subtest case.
Which is to say that posix_openpt is previously untested by the
test suite.
But, Linux does support SUS / UNIX 98 pseudo terminals; and
tst-ttyname lives in sysdeps/unix/sysv/linux. Linux has no config
option to disable ptmx. The only variable there is whatever sets
up /dev.
2. The Linux implementation of getpt (a GNU extension) first tries
posix_openpt to get a UNIX 98 PTY, but if that fails, it falls
back to trying to get a BSD PTY. Which suggests that glibc
supports Linux environments without ptmx.
I find #2 fairly compelling. That is to say, I've changed my mind,
and do support applying and backporting a patch to EXIT_UNSUPPORTED if
posix_openpt returns ENOENT.
--
Happy hacking,
~ Luke Shumaker
next prev parent reply other threads:[~2018-01-02 5:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-25 11:48 [PATCH] tst-ttyname: skip the test when /dev/ptmx is not available Dmitry V. Levin
2017-12-25 18:19 ` Florian Weimer
2017-12-25 19:13 ` Dmitry V. Levin
2017-12-25 20:10 ` Zack Weinberg
2017-12-25 21:01 ` Dmitry V. Levin
2017-12-25 21:19 ` Zack Weinberg
2017-12-25 21:39 ` Dmitry V. Levin
2017-12-26 13:07 ` Florian Weimer
2017-12-26 13:53 ` Dmitry V. Levin
2017-12-26 23:07 ` Dmitry V. Levin
2018-01-01 1:30 ` Joseph Myers
2018-01-01 2:28 ` Luke Shumaker
2017-12-29 14:20 ` Florian Weimer
2017-12-29 14:49 ` Dmitry V. Levin
2018-01-02 5:19 ` Luke Shumaker [this message]
2017-12-30 23:09 ` [PATCH v3] tst-ttyname: skip the test if failed to become root Luke Shumaker
2017-12-31 0:11 ` Dmitry V. Levin
2017-12-26 14:10 Dmitry V. Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a7xwx2fh.wl-lukeshu@lukeshu.com \
--to=lukeshu@lukeshu.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).