Skip to content

Commit

Permalink
Merge pull request ceph#3190 from dachary/wip-test-helpers
Browse files Browse the repository at this point in the history
tests: ignore xmlstarlet extra empty lines
  • Loading branch information
ldachary committed Dec 17, 2014
2 parents 242e28d + 023a8ac commit 9b73c76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/ceph-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,12 @@ function get_num_active_clean() {
expression+="contains(.,'clean') and "
expression+="not(contains(.,'stale'))"
expression+=")"
# xmlstarlet 1.3.0 (which is on Ubuntu precise)
# add extra new lines that must be ignored with
# grep -v '^$'
ceph --format xml pg dump pgs 2>/dev/null | \
xmlstarlet sel -t -m "//pg_stat/state[$expression]" -v . -n | wc -l
xmlstarlet sel -t -m "//pg_stat/state[$expression]" -v . -n | \
grep -v '^$' | wc -l
}

function test_get_num_active_clean() {
Expand Down

0 comments on commit 9b73c76

Please sign in to comment.