From 7985f7ad81b030feb4f8dff4e164184aaf38888c Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 21 Apr 2017 13:42:59 +0200 Subject: [PATCH] test: fix bats dealing with std* streams Signed-off-by: Antonio Murdaca --- test/helpers.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/helpers.bash b/test/helpers.bash index 40c87e5a..dae945c3 100644 --- a/test/helpers.bash +++ b/test/helpers.bash @@ -292,9 +292,10 @@ function check_pod_cidr() { fullnetns=`ocic pod status --id $1 | grep namespace | cut -d ' ' -f 3` netns=`basename $fullnetns` - ip netns exec $netns ip addr show dev eth0 scope global | grep $POD_CIDR_MASK - - echo $? + run ip netns exec $netns ip addr show dev eth0 scope global 2>&1 + echo "$output" + [ "$status" -eq 0 ] + [[ "$output" =~ $POD_CIDR_MASK ]] } function parse_pod_ip() {