summaryrefslogtreecommitdiffstats
path: root/qa/standalone
diff options
context:
space:
mode:
authorDavid Zafman <dzafman@redhat.com>2018-08-16 00:42:31 +0200
committerDavid Zafman <dzafman@redhat.com>2018-08-16 00:45:44 +0200
commit72c34949fcdb6d06d286298b5ce052eef511da7a (patch)
tree0ac6952b0e17a663ad30710f839bef041696e8df /qa/standalone
parentosd: Check CRC when possile in build_push_op() (diff)
downloadceph-72c34949fcdb6d06d286298b5ce052eef511da7a.tar.xz
ceph-72c34949fcdb6d06d286298b5ce052eef511da7a.zip
test: Add test for filestore bad CRC in primary pull request
Signed-off-by: David Zafman <dzafman@redhat.com>
Diffstat (limited to 'qa/standalone')
-rwxr-xr-xqa/standalone/osd/osd-rep-recov-eio.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/qa/standalone/osd/osd-rep-recov-eio.sh b/qa/standalone/osd/osd-rep-recov-eio.sh
index 3a478566320..e286a79b32a 100755
--- a/qa/standalone/osd/osd-rep-recov-eio.sh
+++ b/qa/standalone/osd/osd-rep-recov-eio.sh
@@ -292,6 +292,54 @@ function TEST_rep_recovery_unfound() {
delete_pool $poolname
}
+# This is a filestore only test because it requires data digest in object info
+function TEST_rep_read_unfound() {
+ local dir=$1
+ local objname=myobject
+
+ setup_osds 3 || return 1
+
+ ceph osd pool delete rbd rbd --yes-i-really-really-mean-it || return 1
+ local poolname=test-pool
+ create_pool $poolname 1 1 || return 1
+ ceph osd pool set $poolname size 2
+ wait_for_clean || return 1
+
+ ceph pg dump pgs
+
+ dd if=/dev/urandom bs=8k count=1 of=$dir/ORIGINAL
+ rados -p $poolname put $objname $dir/ORIGINAL
+
+ local primary=$(get_primary $poolname $objname)
+ local other=$(get_not_primary $poolname $objname)
+
+ dd if=/dev/urandom bs=8k count=1 of=$dir/CORRUPT
+ objectstore_tool $dir $primary $objname set-bytes $dir/CORRUPT || return 1
+ objectstore_tool $dir $other $objname set-bytes $dir/CORRUPT || return 1
+
+ timeout 30 rados -p $poolname get $objname $dir/tmp &
+
+ sleep 5
+
+ ceph --format=json pg dump pgs | jq '.'
+
+ if ! ceph --format=json pg dump pgs | jq '.[0].state' | grep -q recovery_unfound
+ then
+ echo "Failure to get to recovery_unfound state"
+ return 1
+ fi
+
+ objectstore_tool $dir $other $objname set-bytes $dir/ORIGINAL || return 1
+
+ wait
+
+ if ! cmp $dir/ORIGINAL $dir/tmp
+ then
+ echo "Bad data after primary repair"
+ return 1
+ fi
+}
+
main osd-rep-recov-eio.sh "$@"
# Local Variables: