Skip to content

Commit

Permalink
Merge pull request ceph#15620 from tchaikov/wip-20249
Browse files Browse the repository at this point in the history
test/vstart_wrapper.sh: display_log on test failure

Reviewed-by: Loic Dachary <ldachary@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
tchaikov committed Jun 12, 2017
2 parents efb1c30 + 63840ff commit ed249be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
6 changes: 6 additions & 0 deletions qa/workunits/ceph-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1638,18 +1638,24 @@ function test_wait_background() {

function flush_pg_stats()
{
local timeout=${1:-$TIMEOUT}

ids=`ceph osd ls`
seqs=''
for osd in $ids; do
seq=`ceph tell osd.$osd flush_pg_stats`
seqs="$seqs $osd-$seq"
done

for s in $seqs; do
osd=`echo $s | cut -d - -f 1`
seq=`echo $s | cut -d - -f 2`
echo "waiting osd.$osd seq $seq"
while test $(ceph osd last-stat-seq $osd) -lt $seq; do
sleep 1
if [ $((timeout--)) -eq 0 ]; then
return 1
fi
done
done
}
Expand Down
18 changes: 0 additions & 18 deletions qa/workunits/cephtool/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,24 +294,6 @@ function test_tiering_agent()
ceph osd pool delete $slow $slow --yes-i-really-really-mean-it
}

function flush_pg_stats()
{
ids=`ceph osd ls`
seqs=''
for osd in $ids
do
seq=`ceph tell osd.$osd flush_pg_stats`
seqs="$seqs $osd-$seq"
done
for s in $seqs
do
osd=`echo $s | cut -d - -f 1`
seq=`echo $s | cut -d - -f 2`
echo "waiting osd.$osd seq $seq"
while test $(ceph osd last-stat-seq $osd) -lt $seq; do sleep 1 ; done
done
}

function test_tiering_1()
{
# tiering
Expand Down
8 changes: 7 additions & 1 deletion src/test/vstart_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ function main()
{
teardown $CEPH_DIR
vstart_setup || return 1
CEPH_CONF=$CEPH_DIR/ceph.conf "$@" || return 1
if CEPH_CONF=$CEPH_DIR/ceph.conf "$@"; then
code=0
else
code=1
display_logs $CEPH_OUT_DIR
fi
return $code
}

main "$@"

0 comments on commit ed249be

Please sign in to comment.