Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151283858
D16276.id45315.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D16276.id45315.diff
View Options
Index: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
===================================================================
--- cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
+++ cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
@@ -36,8 +36,7 @@
# 1. A change to the ip stack breaking expected probe behavior,
# which is the reason we are testing.
# 2. The lo0 interface missing or not up.
-# 3. The local ssh service is not online.
-# 4. An unlikely race causes the unlocked global send/receive
+# 3. An unlikely race causes the unlocked global send/receive
# variables to be corrupted.
#
# This test performs a TCP connection to the ssh service (port 22) and
@@ -63,12 +62,25 @@
dtrace=$1
local=127.0.0.1
-tcpport=22
DIR=/var/tmp/dtest.$$
+tcpport=1024
+bound=5000
+while [ $tcpport -lt $bound ]; do
+ nc -z $local $tcpport >/dev/null || break
+ tcpport=$(($tcpport + 1))
+done
+if [ $tcpport -eq $bound ]; then
+ echo "couldn't find an available TCP port"
+ exit 1
+fi
+
mkdir $DIR
cd $DIR
+# nc will exit when the connection is closed.
+nc -l $local $tcpport &
+
cat > test.pl <<-EOPERL
use IO::Socket;
my \$s = IO::Socket::INET->new(
@@ -77,7 +89,6 @@
PeerPort => $tcpport,
Timeout => 3);
die "Could not connect to host $local port $tcpport" unless \$s;
- print \$s "testing state machine transitions";
close \$s;
sleep(2);
EOPERL
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 7:56 AM (15 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31087085
Default Alt Text
D16276.id45315.diff (1 KB)
Attached To
Mode
D16276: Don't rely on a local sshd being running for a local test.
Attached
Detach File
Event Timeline
Log In to Comment