diff mbox

[ovs-dev] tests: Put maximum timeout on netcat calls.

Message ID 20170815220325.24358-1-joe@ovn.org
State Changes Requested
Headers show

Commit Message

Joe Stringer Aug. 15, 2017, 10:03 p.m. UTC
This was causing test script execution to hang forever on Ubuntu Zesty.
Make sure it times out within 5 seconds, so at least it will fail out
properly.

Signed-off-by: Joe Stringer <joe@ovn.org>
---
 tests/atlocal.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Flavio Leitner Aug. 15, 2017, 10:23 p.m. UTC | #1
On Tue, 15 Aug 2017 15:03:25 -0700
Joe Stringer <joe@ovn.org> wrote:

> This was causing test script execution to hang forever on Ubuntu Zesty.
> Make sure it times out within 5 seconds, so at least it will fail out
> properly.
> 
> Signed-off-by: Joe Stringer <joe@ovn.org>
> ---
>  tests/atlocal.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/atlocal.in b/tests/atlocal.in
> index 6a339f8fc312..6ac32fbb3d73 100644
> --- a/tests/atlocal.in
> +++ b/tests/atlocal.in
> @@ -154,7 +154,8 @@ find_command nc
>  if nc --version 2>&1 | grep -q nmap.org; then
>      NC_EOF_OPT="--send-only"
>  else
> -    NC_EOF_OPT="-q 1"
> +    # BSD netcat
> +    NC_EOF_OPT="-q 1 -w 5"
>  fi
>  
>  # Set HAVE_TCPDUMP

Why not fixing on both?

$ nc --version 
Ncat: Version 7.40 ( https://nmap.org/ncat )

$ nc --help  | grep -- -w
  -w, --wait <time>          Connect timeout
Joe Stringer Aug. 15, 2017, 10:27 p.m. UTC | #2
On 15 August 2017 at 15:23, Flavio Leitner <fbl@sysclose.org> wrote:
> On Tue, 15 Aug 2017 15:03:25 -0700
> Joe Stringer <joe@ovn.org> wrote:
>
>> This was causing test script execution to hang forever on Ubuntu Zesty.
>> Make sure it times out within 5 seconds, so at least it will fail out
>> properly.
>>
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>> ---
>>  tests/atlocal.in | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/atlocal.in b/tests/atlocal.in
>> index 6a339f8fc312..6ac32fbb3d73 100644
>> --- a/tests/atlocal.in
>> +++ b/tests/atlocal.in
>> @@ -154,7 +154,8 @@ find_command nc
>>  if nc --version 2>&1 | grep -q nmap.org; then
>>      NC_EOF_OPT="--send-only"
>>  else
>> -    NC_EOF_OPT="-q 1"
>> +    # BSD netcat
>> +    NC_EOF_OPT="-q 1 -w 5"
>>  fi
>>
>>  # Set HAVE_TCPDUMP
>
> Why not fixing on both?
>
> $ nc --version
> Ncat: Version 7.40 ( https://nmap.org/ncat )
>
> $ nc --help  | grep -- -w
>   -w, --wait <time>          Connect timeout

Mostly because I didn't have the nmap version on hand so didn't know
if it worked ;)

Thanks, I'll update this.
diff mbox

Patch

diff --git a/tests/atlocal.in b/tests/atlocal.in
index 6a339f8fc312..6ac32fbb3d73 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -154,7 +154,8 @@  find_command nc
 if nc --version 2>&1 | grep -q nmap.org; then
     NC_EOF_OPT="--send-only"
 else
-    NC_EOF_OPT="-q 1"
+    # BSD netcat
+    NC_EOF_OPT="-q 1 -w 5"
 fi
 
 # Set HAVE_TCPDUMP