1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
--- socat-1.6.0.0/test.sh.original 2007-04-05 18:53:07.000000000 +1000
+++ socat-1.6.0.0/test.sh 2007-04-05 19:06:28.000000000 +1000
@@ -979,7 +979,7 @@
#------------------------------------------------------------------------------
#if false; then
-if true; then
+if false; then
for addr in exec system; do
ADDR=$(echo "$addr" |tr a-z A-Z)
@@ -5176,87 +5176,6 @@
N=$((N+1))
-testptywaitslave () {
- local N="$1"
- local TEST="$2"
- local PTYTYPE="$3" # ptmx or openpty
- local opts="$4"
-
-tp="$td/test$N.pty"
-ts="$td/test$N.socket"
-tf="$td/test$N.file"
-tdiff="$td/test$N.diff"
-te1="$td/test$N.stderr1"
-te2="$td/test$N.stderr2"
-te3="$td/test$N.stderr3"
-te4="$td/test$N.stderr4"
-da="test$N.1 $(date) $RANDOM"
-printf "test $F_n $TEST... " $N
-# first generate a pty, then a socket
-($SOCAT $opts -lpsocat1 pty,$PTYTYPE,pty-wait-slave,link="$tp" unix-listen:"$ts" 2>"$te1"; rm -f "$tp") 2>/dev/null &
-pid=$!
-waitfile "$tp"
-# if pty was non-blocking, the socket is active, and socat1 will term
-$SOCAT $opts -T 10 -lpsocat2 file:/dev/null unix-connect:"$ts" 2>"$te2"
-# if pty is blocking, first socat is still active and we get a connection now
-#((echo "$da"; sleep 2) |$SOCAT -lpsocat3 $opts - file:"$tp",$PTYOPTS2 >"$tf" 2>"$te3") &
-( (waitfile "$ts"; echo "$da"; sleep 1) |$SOCAT -lpsocat3 $opts - file:"$tp",$PTYOPTS2 >"$tf" 2>"$te3") &
-waitfile "$ts"
-# but we need an echoer on the socket
-$SOCAT $opts -lpsocat4 unix:"$ts" echo 2>"$te4"
-# now $tf file should contain $da
-#kill $pid 2>/dev/null
-wait
-#
-if echo "$da" |diff - "$tf"> "$tdiff"; then
- $PRINTF "$OK\n"
- numOK=$((numOK+1))
-else
- $PRINTF "${YELLOW}FAILED${NORMAL}\n"
- cat "$te1"
- #cat "$te2" # not of interest
- cat "$te3"
- cat "$te4"
- cat "$tdiff"
- numCANT=$((numCANT+1))
-fi
-}
-
-NAME=PTMXWAITSLAVE
-PTYTYPE=ptmx
-case "$TESTS" in
-*%functions%*|*%pty%*|*%$NAME%*)
-TEST="$NAME: test if master pty ($PTYTYPE) waits for slave connection"
-if ! feat=$(testaddrs pty); then
- $PRINTF "test $F_n $TEST... ${YELLOW}$(echo $feat| tr 'a-z' 'A-Z') not available${NORMAL}\n" $N
- numCANT=$((numCANT+1))
-elif ! feat=$(testoptions "$PTYTYPE" pty-wait-slave); then
- $PRINTF "test $F_n $TEST... ${YELLOW}option $(echo $feat| tr 'a-z' 'A-Z') not available${NORMAL}\n" $N
- numCANT=$((numCANT+1))
-else
- testptywaitslave "$N" "$TEST" "$PTYTYPE" "$opts"
-fi
-esac
-N=$((N+1))
-
-NAME=OPENPTYWAITSLAVE
-PTYTYPE=openpty
-case "$TESTS" in
-*%functions%*|*%pty%*|*%$NAME%*)
-TEST="$NAME: test if master pty ($PTYTYPE) waits for slave connection"
-if ! feat=$(testaddrs pty); then
- $PRINTF "test $F_n $TEST... ${YELLOW}$(echo $feat| tr 'a-z' 'A-Z') not available${NORMAL}\n" $N
- numCANT=$((numCANT+1))
-elif ! feat=$(testoptions "$PTYTYPE" pty-wait-slave); then
- $PRINTF "test $F_n $TEST... ${YELLOW}option $(echo $feat| tr 'a-z' 'A-Z') not available${NORMAL}\n" $N
- numCANT=$((numCANT+1))
-else
- testptywaitslave "$N" "$TEST" "$PTYTYPE" "$opts"
-fi
-esac
-N=$((N+1))
-
-
NAME=CONNECTTIMEOUT
case "$TESTS" in
*%functions%*|*%$NAME%*)
|