pcp
[Top] [All Lists]

Re: qa/667 - some issues

To: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: qa/667 - some issues
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Fri, 23 Jan 2015 17:32:55 -0500
Cc: "'PCP'" <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <006901d03755$899c8af0$9cd5a0d0$@internode.on.net> (Ken McDonell's message of "Sat, 24 Jan 2015 08:42:48 +1100")
References: <006901d03755$899c8af0$9cd5a0d0$@internode.on.net>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
"Ken McDonell" <kenj@xxxxxxxxxxxxxxxx> writes:

>> nc: getaddrinfo: Servname not supported for ai_socktype
> [...]
>> nc: getaddrinfo: Servname not supported for ai_socktype

The invocation of nc is:

    nc -l localhost 2003 (or 2004)

Does your machine dns resolve "localhost" and/or port 200[34] in
/etc/services?  Can you run "nc -v ..." for some verbosity?  What
version of ncat does it identify?

Unfortunately, "nc" is not a very specific name for the tool; several
doppelgangers have made appearances over the years.  If your machine
has "socat", we could switch to that instead - it's more of a fixed
quantity.  That would look like this:


diff --git a/qa/667 b/qa/667
index e353fe546c4f..17c76f6e8fba 100755
--- a/qa/667
+++ b/qa/667
@@ -11,15 +11,16 @@ echo "QA output created by $seq"
 . ./common.filter
 . ./common.check
 
-which nc >/dev/null 2>&1 || _notrun "No nc binary installed"
+# which nc >/dev/null 2>&1 || _notrun "No nc binary installed"
+which socat >/dev/null 2>&1 || _notrun "No socat binary installed"
 pcp2graphite --version 2>/dev/null || _notrun "python/modules missing"
 
-graphite_port=2004
-another_port=2003
-echo | $PCP_BINADM_DIR/telnet-probe localhost $graphite_port \
-       && _notrun "Someone already listening on graphite port $graphite_port"
-echo | $PCP_BINADM_DIR/telnet-probe localhost $another_port \
-       && _notrun "Someone already listening on second port $another_port"
+port_pickled=2004
+port_text=2003
+echo | $PCP_BINADM_DIR/telnet-probe localhost $port_pickled \
+       && _notrun "Someone already listening on graphite pickled port 
$port_pickled"
+echo | $PCP_BINADM_DIR/telnet-probe localhost $port_text \
+       && _notrun "Someone already listening on graphite text port $port_text"
 
 $sudo rm -rf $tmp.dir
 rm -f $seq.full
@@ -39,7 +40,8 @@ ncpu=`pmprobe -v hinv.ncpu | awk '{print $3*'$scale'".0"}'`
 
 echo | tee -a $seq.full
 echo "=== 1. pcp2graphite one-shot pickle  ===" | tee -a $seq.full
-nc -l localhost $graphite_port > $tmp.dir/test1.out &
+# nc -l localhost $port_pickled > $tmp.dir/test1.out &
+socat tcp-listen:$port_pickled,reuseaddr - > $tmp.dir/test1.out &
 ncpid=$!
 sleep 2
 pcp2graphite -t 1 hinv.ncpu hinv.ncpu 2>/dev/null &   # will error out after 
nc dies
@@ -51,10 +53,11 @@ cat $tmp.dir/test1.out |
     egrep -a hinv.ncpu
 
 echo "=== 2. pcp2graphite text, 2-second aligned  ===" | tee -a $seq.full
-nc -k -l localhost $another_port > $tmp.dir/test2.out &
+# nc -k -l localhost $port_text > $tmp.dir/test2.out &
+socat tcp-listen:$port_text,reuseaddr,fork - > $tmp.dir/test2.out &
 ncpid=$!
 sleep 2
-pcp2graphite -t 2 -P $another_port -u "/$scale" -m foobar. hinv.ncpu 
2>/dev/null &
+pcp2graphite -t 2 -P $port_text -u "/$scale" -m foobar. hinv.ncpu 2>/dev/null &
 p2gpid=$!
 sleep 5 # enough for at least 2 messages
 $signal $ncpid $p2gpid 2>/dev/null



- FChE

<Prev in Thread] Current Thread [Next in Thread>