]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Modify test to check new feature might_have_unfound added to list_unfound
authorDavid Zafman <dzafman@redhat.com>
Tue, 4 Aug 2020 21:03:16 +0000 (14:03 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 14 Sep 2020 20:06:29 +0000 (13:06 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/standalone/erasure-code/test-erasure-eio.sh

index d46be6e6254d8296b56b1d73a30760ad15cc1afa..5ee7e3a9f6c9a7ec44a9db42c9a3ac9f2dee7ec0 100755 (executable)
@@ -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