From: Willem Jan Withagen Date: Thu, 7 Feb 2019 14:20:24 +0000 (+0100) Subject: test: switch to GNU sed X-Git-Tag: v14.1.0~163^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26318%2Fhead;p=ceph.git test: switch to GNU sed BSD sed and GNU sed have migrated too far apart in RE evaluation So switch for this test also to gsed. Signed-off-by: Willem Jan Withagen --- diff --git a/src/test/crush/crush_weights.sh b/src/test/crush/crush_weights.sh index b089c728bb91..bf2bf8b0baff 100755 --- a/src/test/crush/crush_weights.sh +++ b/src/test/crush/crush_weights.sh @@ -2,6 +2,12 @@ source $(dirname $0)/../detect-build-env-vars.sh +if [ `uname` = FreeBSD ]; then + SED=gsed +else + SED=sed +fi + read -r -d '' cm <<'EOF' # devices device 0 device0 @@ -39,7 +45,7 @@ EOF three=($(echo "$cm" | crushtool -c /dev/fd/0 --test --show-utilization \ --min-x 1 --max-x 1000000 --num-rep 3 | \ - grep "device \(0\|4\)" | sed -e 's/^.*stored : \([0-9]\+\).*$/\1/')) + grep "device \(0\|4\)" | $SED -e 's/^.*stored : \([0-9]\+\).*$/\1/')) if test $(echo "scale=5; (10 - ${three[0]}/${three[1]}) < .75" | bc) = 1; then echo 3 replicas weights better distributed than they should be. 1>&2 @@ -48,7 +54,7 @@ fi one=($(echo "$cm" | crushtool -c /dev/fd/0 --test --show-utilization \ --min-x 1 --max-x 1000000 --num-rep 1 | \ - grep "device \(0\|4\)" | sed -e 's/^.*stored : \([0-9]\+\).*$/\1/')) + grep "device \(0\|4\)" | $SED -e 's/^.*stored : \([0-9]\+\).*$/\1/')) if test $(echo "scale=5; (10 - ${one[0]}/${one[1]}) > .1 || (10 - ${one[0]}/${one[1]}) < -.1" | bc) = 1; then echo 1 replica not distributed as they should be. 1>&2