]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunit: add rabin chunk test
authormyoungwon oh <omwmw@sk.com>
Thu, 4 Apr 2019 14:58:57 +0000 (23:58 +0900)
committermyoungwon oh <omwmw@sk.com>
Thu, 4 Apr 2019 14:58:57 +0000 (23:58 +0900)
Signed-off-by: Myoungwon Oh <ommw@sk.com>
qa/workunits/rados/test_dedup_tool.sh

index 2599440177693cda1763f6a0718617fdeea5e3a6..2caf1c26ca24ab183b21050bb193c9114e325867 100755 (executable)
@@ -145,8 +145,50 @@ function test_dedup_chunk_scrub()
   rm -rf ./foo ./bar ./foo-chunk ./bar-chunk ./test_obj
 }
 
+function test_dedup_ratio_rabin()
+{
+  # case 1
+  echo "abcdefghijklmnop" >> dedup_16
+  for num in `seq 0 63`
+  do
+    dd if=./dedup_16  bs=16 count=1 >> dedup_object_1k
+  done
+
+  for num in `seq 0 11`
+  do
+    dd if=dedup_object_1k bs=1K count=1 >> test_rabin_object
+  done
+  $RADOS_TOOL -p $POOL put $OBJ ./test_rabin_object
+  RESULT=$($DEDUP_TOOL --op estimate --pool $POOL --min-chunk 1015  --chunk-algorithm rabin --fingerprint-algorithm rabin --debug | grep result -a | awk '{print$4}')
+  echo $RESULT
+  if [ 4096 -ne $RESULT ];
+  then
+    die "Estimate failed expecting 7168 result $RESULT"
+  fi
+
+  echo "a" >> test_rabin_object_2
+  dd if=./test_rabin_object bs=8K count=1 >> test_rabin_object_2
+  $RADOS_TOOL -p $POOL put $OBJ"_2" ./test_rabin_object_2
+  RESULT=$($DEDUP_TOOL --op estimate --pool $POOL --min-chunk 1012 --chunk-algorithm rabin --fingerprint-algorithm rabin --debug | grep result -a | awk '{print$4}')
+  echo $RESULT
+  if [ 11259 -ne $RESULT ];
+  then
+    die "Estimate failed expecting 16386 result $RESULT"
+  fi
+
+  RESULT=$($DEDUP_TOOL --op estimate --pool $POOL --min-chunk 1024 --chunk-mask-bit 3  --chunk-algorithm rabin --fingerprint-algorithm rabin --debug | grep result -a | awk '{print$4}')
+  if [ 7170 -ne $RESULT ];
+  then
+    die "Estimate failed expecting 5122 result $RESULT"
+  fi
+
+  rm -rf ./dedup_object_1k ./test_rabin_object ./test_rabin_object_2 ./dedup_16
+
+}
+
 test_dedup_ratio_fixed
 test_dedup_chunk_scrub
+test_dedup_ratio_rabin
 
 $CEPH_TOOL osd pool delete $POOL $POOL --yes-i-really-really-mean-it