upstream: for the pty control tests, just check that the PTY path

points to something in /dev (rather than checking the device node itself);
makes life easier for portable, where systems with dynamic ptys can delete
nodes before we get around to testing their existence.

OpenBSD-Regress-ID: b1e455b821e62572bccd98102f8dd9d09bb94994
This commit is contained in:
djm@openbsd.org 2018-03-04 01:46:48 +00:00 committed by Damien Miller
parent 13ef4cf53f
commit 7e4fadd324
1 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: key-options.sh,v 1.5 2018/03/02 02:53:27 djm Exp $ # $OpenBSD: key-options.sh,v 1.6 2018/03/04 01:46:48 djm Exp $
# Placed in the Public Domain. # Placed in the Public Domain.
tid="key options" tid="key options"
@ -32,9 +32,10 @@ expect_pty_succeed() {
fail "key option failed $which" fail "key option failed $which"
else else
r=`cat $OBJ/data` r=`cat $OBJ/data`
if [ ! -e "$r" ]; then case "$r" in
fail "key option failed $which (pty $r)" /dev/*) ;;
fi *) fail "key option failed $which (pty $r)" ;;
esac
fi fi
} }
expect_pty_fail() { expect_pty_fail() {
@ -49,6 +50,10 @@ expect_pty_fail() {
if [ -e "$r" ]; then if [ -e "$r" ]; then
fail "key option failed $which (pty $r)" fail "key option failed $which (pty $r)"
fi fi
case "$r" in
/dev/*) fail "key option failed $which (pty $r)" ;;
*) ;;
esac
fi fi
} }
# First ensure that we can allocate a pty by default. # First ensure that we can allocate a pty by default.