Skip to content

Commit

Permalink
osdmaptool/test-map-pgs.t: fix escaping to fix run
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dalgaaf committed Jun 25, 2014
1 parent 235f4ca commit be70c1f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/test/cli/osdmaptool/test-map-pgs.t
Original file line number Diff line number Diff line change
Expand Up @@ -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")
#
Expand All @@ -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
Expand Down

0 comments on commit be70c1f

Please sign in to comment.