Skip to contentSkip to conversation

t_client.sh: do not require fping6

PATCH In review Frank Lichtenheld 3 participants 4 messages Aug 22, 2022 – Aug 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t_client.sh: do not require fping6

fping and fping6 were merged in version 4.0, released in 2017. Many recent distributions do not include the compatibility symlink anymore.

So if we find fping but not fping6 do not error out but assume that fping is capable of IPv6.

---
 tests/t_client.sh.in | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
tests/t_client.sh.in +8 -5
index 465c3a33..76ac9b22 100755
@@ -9,7 +9,7 @@
 # - writable current directory to create subdir for logs
 # - t_client.rc in current directory OR source dir that specifies tests
 # - for "ping4" checks: fping binary in $PATH
-# - for "ping6" checks: fping6 binary in $PATH
+# - for "ping6" checks: fping (4.0+) or fping6 binary in $PATH
 #
 
 # by changing this to 1 we can force automated builds to fail
@@ -29,6 +29,8 @@ else
 fi
 
 # Check for external dependencies
+FPING="fping"
+FPING6="fping6"
 which fping > /dev/null
 if [ $? -ne 0 ]; then
     echo "$0: fping is not available in \$PATH" >&2
@@ -36,8 +38,9 @@ if [ $? -ne 0 ]; then
 fi
 which fping6 > /dev/null
 if [ $? -ne 0 ]; then
-    echo "$0: fping6 is not available in \$PATH" >&2
-    exit "${TCLIENT_SKIP_RC}"
+    echo "$0: fping6 is not available in \$PATH, assuming fping 4.0 or later" >&2
+    FPING="fping -4"
+    FPING6="fping -6"
 fi
 
 KILL_EXEC=`which kill`
@@ -220,8 +223,8 @@ run_ping_tests()
     if [ -z "$targetlist" ] ; then return ; fi
 
     case $proto in
-	4) cmd=fping ;;
-	6) cmd=fping6 ;;
+	4) cmd="$FPING" ;;
+	6) cmd="$FPING6" ;;
 	*) echo "internal error in run_ping_tests arg 1: '$proto'" >&2
 	   exit 1 ;;
     esac
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines · Frank Lichtenheld

fping and fping6 were merged in version 4.0, released in 2017. Many recent distributions do not include the compatibility symlink anymore.

So if we find fping but not fping6 do not error out but assume that fping is capable of IPv6.

Quickly checked the behaviour of fping on gentoo (fping v5.0) and I can confirm what Frank said.

Also, on GH it is possible to read when the merge happened: https://github.com/schweikert/fping/releases/tag/v4.0

Signature · 1 line
Antonio Quartulli
#2 lore raw
In reply to Frank Lichtenheld
Quoted 11 lines · Frank Lichtenheld

fping and fping6 were merged in version 4.0, released in 2017. Many recent distributions do not include the compatibility symlink anymore.

So if we find fping but not fping6 do not error out but assume that fping is capable of IPv6.

---
 tests/t_client.sh.in | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Note: I think it would be good to apply this to release/2.5 as well since that would allow us to remove the existing work-arounds from the worker setup scripts.

There is a trivial conflict due to the TCLIENT_SKIP_RC change. If you prefer a separate patch, let me know.

Regards,

Signature · 1 line
  Frank Lichtenheld
#3 lore raw
In reply to Frank Lichtenheld

Thanks for working on that ancient script :-) - so far I mostly just fixed the buildslaves by adding wrapper scripts, but of course this is nicer.

I have not actually *tested* this yet, but the change looks reasonable, and the buildbots will tell us soon enough...

To avoid the conflict when pulling up to release/2.5, I've just applied the "Allow to force FAIL on prerequisite fails" (79932b94) to 2.5 as well... since we do want good testing for 2.5, that one is useful, too.

Your patch has been applied to the master and release/2.5 branch.

commit fb06c9f026a78b879f264ab8e67de09d725b5540 (master) commit 64cac790b9d64b3c07fa5222bf46754a04ea1659 (release/2.5)

Author: Frank Lichtenheld
Date:   Mon Aug 22 16:18:06 2022 +0200
     t_client.sh: do not require fping6

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg25058.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering