From 373d663b5ee8348951f4fe0cd616f7c3176bd825 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 3 Jul 2015 13:11:04 +0100 Subject: [PATCH] Fix integration tests for OSX --- test/500_weave_multi_cidr_test.sh | 2 +- test/config.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/500_weave_multi_cidr_test.sh b/test/500_weave_multi_cidr_test.sh index 4a665f52..320cb07b 100755 --- a/test/500_weave_multi_cidr_test.sh +++ b/test/500_weave_multi_cidr_test.sh @@ -28,7 +28,7 @@ assert_zone_records() { records=$(weave_on $HOST status | grep "^$CID") || true # Assert correct number of records exist - assert "echo $records | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | wc -l" $# + assert "echo $records | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | wc -l | tr -d '[:space:]'" $# # Assert correct records exist for ADDR; do diff --git a/test/config.sh b/test/config.sh index 90a703cf..3b5e8e1a 100644 --- a/test/config.sh +++ b/test/config.sh @@ -60,16 +60,16 @@ upload_executable() { remote() { rem=$1 shift 1 - "$@" > >(while read line; do echo -e "\e[0;34m$rem>\e[0m $line"; done) + "$@" > >(while read line; do echo -e $'\e[0;34m'"$rem>"$'\e[0m'" $line"; done) } colourise() { - [ -t 0 ] && echo -ne '\e['$1'm' || true + [ -t 0 ] && echo -ne $'\e['$1'm' || true shift # It's important that we don't do this in a subshell, as some # commands we execute need to modify global state "$@" - [ -t 0 ] && echo -ne '\e[0m' || true + [ -t 0 ] && echo -ne $'\e[0m' || true } whitely() { @@ -154,7 +154,7 @@ assert_dns_record() { container=$2 name=$3 shift 3 - exp_ips_regex=$(echo "$@" | sed -r 's/ /\\\|/g') + exp_ips_regex=$(echo "$@" | sed -e 's/ /\\\|/g') [ -z "$DEBUG" ] || greyly echo "Checking whether $name exists at $host:$container" assert_raises "exec_on $host $container getent hosts $name | grep -q '$exp_ips_regex'"