Test cases that use netcat will fail if netcat is not installed. This patch detects if netcat is present, and skips those test cases if netcat is not there.
Singed-off-by: Yi-Hung Wei <[email protected]> --- tests/atlocal.in | 17 +++++++++++++++++ tests/system-traffic.at | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/tests/atlocal.in b/tests/atlocal.in index f518cda..1353b46 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -124,6 +124,23 @@ else HAVE_PYFTPDLIB="no" fi +# Look for a commnand in the system. If it is found, defines +# HAVE_COMMAND="yes", otherwise HAVE_COMMAND="no". +FindCommand() +{ + which $1 > /dev/null 2>&1 + status=$? + var=HAVE_`echo "$1" | tr '[a-z]' '[A-Z]'` + if test "$status" = "0"; then + eval ${var}="yes" + else + eval ${var}="no" + fi +} + +# Set HAVE_NC +FindCommand nc + # Determine correct netcat option to quit on stdin EOF if nc --version 2>&1 | grep -q nmap.org; then NC_EOF_OPT="--send-only" diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 801dfe3..ffeca35 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -338,6 +338,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - basic truncate action]) +AT_SKIP_IF([test $HAVE_NC = no]) OVS_TRAFFIC_VSWITCHD_START() AT_CHECK([ovs-ofctl del-flows br0]) @@ -454,6 +455,7 @@ dnl ns1: connect to br0, with IP:10.1.1.2 dnl br-underlay: with IP: 172.31.1.100 dnl ns0: connect to br-underlay, with IP: 10.1.1.1 AT_SETUP([datapath - truncate and output to gre tunnel]) +AT_SKIP_IF([test $HAVE_NC = no]) OVS_CHECK_GRE() OVS_TRAFFIC_VSWITCHD_START() @@ -1479,6 +1481,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([conntrack - ICMP related]) +AT_SKIP_IF([test $HAVE_NC = no]) CHECK_CONNTRACK() OVS_TRAFFIC_VSWITCHD_START() @@ -2408,6 +2411,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([conntrack - ICMP related with NAT]) +AT_SKIP_IF([test $HAVE_NC = no]) CHECK_CONNTRACK() CHECK_CONNTRACK_NAT() OVS_TRAFFIC_VSWITCHD_START() @@ -2832,6 +2836,7 @@ AT_CLEANUP AT_SETUP([conntrack - DNAT load balancing with NC]) +AT_SKIP_IF([test $HAVE_NC = no]) CHECK_CONNTRACK() CHECK_CONNTRACK_NAT() OVS_TRAFFIC_VSWITCHD_START() -- 2.7.4 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
