ctdb-tests: Replace md5sum with posix cksum
authorAmitay Isaacs <amitay@gmail.com>
Thu, 19 Jul 2018 06:10:15 +0000 (16:10 +1000)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Jul 2018 01:50:11 +0000 (03:50 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/config/functions
ctdb/tests/eventscripts/scripts/11.natgw.sh
ctdb/tests/eventscripts/stubs/ip

index 09b32097e01218da3bbc9c47d43430d6830e5849..7a47c9d8e79167fde6f15faf21f0e97d1376fce2 100755 (executable)
@@ -867,8 +867,8 @@ if ! type mktemp >/dev/null 2>&1 ; then
        fi
        _d="${TMPDIR:-/tmp}"
        _hex10=$(dd if=/dev/urandom count=20 2>/dev/null | \
-           md5sum | \
-           sed -e 's@\(..........\).*@\1@')
+           cksum | \
+           awk '{print $1}')
        _t="${_d}/tmp.${_hex10}"
        (
            umask 077
index 1bdcb690b15c3a74b1068c8e5c9404a6375231ff..75b2771899c14d6cdc04386e9362686d859612e8 100644 (file)
@@ -46,8 +46,8 @@ EOF
 ok_natgw_master_ip_addr_show ()
 {
        _mac=$(echo "$CTDB_NATGW_PUBLIC_IFACE" |
-              md5sum |
-              sed -r -e 's@(..)(..)(..)(..)(..)(..).*@\1:\2:\3:\4:\5:\6@')
+              cksum |
+              sed -r -e 's@(..)(..)(..).*@fe:fe:fe:\1:\2:\3@')
 
        # This is based on CTDB_NATGW_PUBLIC_IP
        _brd="10.1.1.255"
@@ -63,8 +63,8 @@ EOF
 ok_natgw_slave_ip_addr_show ()
 {
        _mac=$(echo "$CTDB_NATGW_PUBLIC_IFACE" |
-              md5sum |
-              sed -r -e 's@(..)(..)(..)(..)(..)(..).*@\1:\2:\3:\4:\5:\6@')
+              cksum |
+              sed -r -e 's@(..)(..)(..).*@fe:fe:fe:\1:\2:\3@')
 
        ok <<EOF
 1: ${CTDB_NATGW_PUBLIC_IFACE}: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
index 1c4ad35b50a5d74e14c1b8ec3d91b72454fb9f07..630d0e8b433e8a298bb4f58f2335d7b864d77bb9 100755 (executable)
@@ -124,7 +124,7 @@ ip_link_show ()
            _opts="<LOOPBACK${_flags}> mtu 65536 qdisc noqueue state UNKNOWN"
            ;;
     *)
-           _mac=$(echo $dev | md5sum | sed -r -e 's@(..)(..)(..)(..)(..)(..).*@\1:\2:\3:\4:\5:\6@')
+           _mac=$(echo $dev | cksum | sed -r -e 's@(..)(..)(..).*@fe:fe:fe:\1:\2:\3@')
            _brd="ff:ff:ff:ff:ff:ff"
            _type="ether"
            _opts="<BROADCAST,MULTICAST${_flags}> mtu 1500 qdisc pfifo_fast state ${_state} qlen 1000"