]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: isa plugin must link with ErasureCode.cc 2245/head
authorLoic Dachary <loic@dachary.org>
Tue, 12 Aug 2014 16:46:29 +0000 (18:46 +0200)
committerLoic Dachary <loic@dachary.org>
Tue, 12 Aug 2014 21:07:50 +0000 (23:07 +0200)
Otherwise it will not get the methods it needs. A test is added to check
the plugin loads as expected, from the command line. The test is not run
if the isa plugin is not found, which happens on platforms that are not
supported.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/erasure-code/isa/Makefile.am
src/test/erasure-code/test-erasure-code.sh

index 6ee9346c1bfbf2692f45dc811f9cd11cb02326a1..a17faed325b3c8fa81115980c7ba5067547d9510 100644 (file)
@@ -10,6 +10,7 @@ noinst_HEADERS += \
        erasure-code/isa/isa-l/include/types.h
 
 isa_sources = \
+       erasure-code/ErasureCode.cc \
        erasure-code/isa/isa-l/erasure_code/ec_base.c \
        erasure-code/isa/isa-l/erasure_code/ec_highlevel_func.c \
        erasure-code/isa/isa-l/erasure_code/ec_multibinary.asm.s \
index 852c5c148470a4d5c86e70d039aaf55fdd1ad527..b9caef362adb252d03b0bb79b4de19c3278b607b 100755 (executable)
@@ -44,23 +44,75 @@ function run() {
 function create_erasure_coded_pool() {
     ./ceph osd erasure-code-profile set myprofile \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd erasure-code-profile get myprofile
     ./ceph osd pool create ecpool 12 12 erasure myprofile \
         || return 1
 }
 
-function TEST_rados_put() {
+function delete_pool() {
+    local poolname=$1
+
+    ./ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
+}
+
+function rados_put_get() {
     local dir=$1
+    local poolname=$2
+
     local payload=ABC
     echo "$payload" > $dir/ORIGINAL
 
-    ./rados --pool ecpool put SOMETHING $dir/ORIGINAL || return 1
-    ./rados --pool ecpool get SOMETHING $dir/COPY || return 1
+    ./rados --pool $poolname put SOMETHING $dir/ORIGINAL || return 1
+    ./rados --pool $poolname get SOMETHING $dir/COPY || return 1
 
     diff $dir/ORIGINAL $dir/COPY || return 1
 
     rm $dir/ORIGINAL $dir/COPY
+}
+
+function plugin_exists() {
+    local plugin=$1
+
+    local status
+    ./ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin
+    if ./ceph osd crush rule create-erasure TESTRULE TESTPROFILE 2>&1 |
+        grep "$plugin.*No such file" ; then
+        status=1
+    else
+        ./ceph osd crush rule rm TESTRULE
+        status=0
+    fi
+    ./ceph osd erasure-code-profile rm TESTPROFILE 
+    return $status
+}
+
+function TEST_rados_put_get_isa() {
+    if ! plugin_exists isa ; then
+        echo "SKIP because plugin isa has not been built"
+        return 0
+    fi
+    local dir=$1
+    local poolname=pool-isa
+
+    ./ceph osd erasure-code-profile set profile-isa \
+        plugin=isa \
+        ruleset-failure-domain=osd || return 1
+    ./ceph osd pool create $poolname 12 12 erasure profile-isa \
+        || return 1
+
+    rados_put_get $dir $poolname || return 1
 
+    delete_pool $poolname
+}
+
+function TEST_rados_put_get_jerasure() {
+    local dir=$1
+
+    rados_put_get $dir ecpool || return 1
+}
+
+function TEST_alignment_constraints() {
+    local payload=ABC
+    echo "$payload" > $dir/ORIGINAL
     # 
     # Verify that the rados command enforces alignment constraints
     # imposed by the stripe width