From 5b0ba0e5a8eee4aa7e5d80c5e6f4d5dd97170012 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 4 Aug 2020 14:03:16 -0700 Subject: [PATCH] test: Modify test to check new feature might_have_unfound added to list_unfound Signed-off-by: David Zafman --- .../erasure-code/test-erasure-eio.sh | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/qa/standalone/erasure-code/test-erasure-eio.sh b/qa/standalone/erasure-code/test-erasure-eio.sh index d46be6e6254d8..5ee7e3a9f6c9a 100755 --- a/qa/standalone/erasure-code/test-erasure-eio.sh +++ b/qa/standalone/erasure-code/test-erasure-eio.sh @@ -524,6 +524,7 @@ function TEST_ec_backfill_unfound() { ceph pg dump pgs rados_put $dir $poolname $objname || return 1 + local primary=$(get_primary $poolname $objname) local -a initial_osds=($(get_osds $poolname $objname)) local last_osd=${initial_osds[-1]} @@ -558,8 +559,26 @@ function TEST_ec_backfill_unfound() { done ceph pg dump pgs + kill_daemons $dir TERM osd.${last_osd} 2>&2 < /dev/null || return 1 + sleep 5 + + ceph pg dump pgs + ceph pg 2.0 list_unfound + ceph pg 2.0 query + ceph pg 2.0 list_unfound | grep -q $testobj || return 1 + check=$(ceph pg 2.0 list_unfound | jq ".available_might_have_unfound") + test "$check" == "true" || return 1 + + eval check=$(ceph pg 2.0 list_unfound | jq .might_have_unfound[0].status) + test "$check" == "osd is down" || return 1 + + eval check=$(ceph pg 2.0 list_unfound | jq .might_have_unfound[0].osd) + test "$check" == "2(4)" || return 1 + + activate_osd $dir ${last_osd} || return 1 + # Command should hang because object is unfound timeout 5 rados -p $poolname get $testobj $dir/CHECK test $? = "124" || return 1 @@ -638,8 +657,17 @@ function TEST_ec_recovery_unfound() { done ceph pg dump pgs + ceph pg 2.0 list_unfound + ceph pg 2.0 query + ceph pg 2.0 list_unfound | grep -q $testobj || return 1 + check=$(ceph pg 2.0 list_unfound | jq ".available_might_have_unfound") + test "$check" == "true" || return 1 + + check=$(ceph pg 2.0 list_unfound | jq ".might_have_unfound | length") + test $check == 0 || return 1 + # Command should hang because object is unfound timeout 5 rados -p $poolname get $testobj $dir/CHECK test $? = "124" || return 1 -- 2.39.5