From: Danny Al-Gaaf Date: Wed, 25 Jun 2014 07:56:52 +0000 (+0200) Subject: osdmaptool/test-map-pgs.t: fix escaping to fix run X-Git-Tag: v0.83~40^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be70c1ffe36cea56e3213bd71a47c27d7fa2a068;p=ceph.git osdmaptool/test-map-pgs.t: fix escaping to fix run Run failed always running into the '|| cat $OUT' case due to bad escaping of '\t'. This is caused by different shells on different distros (e.g. bash on SUSE vs dash on Ubuntu). Use 'grep -P ' and fix the regex to make it shell independet. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/cli/osdmaptool/test-map-pgs.t b/src/test/cli/osdmaptool/test-map-pgs.t index b64f2d99a2d..3496a86dff4 100644 --- a/src/test/cli/osdmaptool/test-map-pgs.t +++ b/src/test/cli/osdmaptool/test-map-pgs.t @@ -24,8 +24,7 @@ pool 1 pg_num 8000 pool 2 pg_num 8000 $ TOTAL=$((POOL_COUNT * $PG_NUM)) - $ PATTERN=$(echo "size $SIZE\t$TOTAL") - $ grep "$PATTERN" $OUT || cat "$OUT" + $ grep -P "size $SIZE\t$TOTAL" $OUT || cat $OUT size 3\t24000 (esc) $ STATS_CRUSH=$(grep '^ avg ' "$OUT") # @@ -39,8 +38,7 @@ pool 1 pg_num 8000 pool 2 pg_num 8000 $ TOTAL=$((POOL_COUNT * $PG_NUM)) - $ PATTERN=$(echo "size $SIZE\t$TOTAL") - $ grep "$PATTERN" $OUT || cat "$OUT" + $ grep -P "size $SIZE\t$TOTAL" $OUT || cat $OUT size 3\t24000 (esc) $ STATS_RANDOM=$(grep '^ avg ' "$OUT") # it is almost impossible to get the same stats with random and crush