erasure-code: store and compare encoded contents

Introduce ceph_erasure_code_non_regression to check and compare how an
erasure code plugin encodes and decodes content with a given set of
parameters. For instance:

./ceph_erasure_code_non_regression \
      --plugin jerasure \
      --parameter technique=reed_sol_van \
      --parameter k=2 \
      --parameter m=2 \
      --stripe-width 3181 \
      --create \
      --check

Will create an encoded object (--create) and store it into a directory
along with the chunks, one chunk per file. The directory name is derived
from the parameters. The content of the object is a random pattern of 31
bytes repeated to fill the object size specified with --stripe-width.

The check function (--check) reads the object back from the file,
encodes it and compares the result with the content of the chunks read
from the files. It also attempts recover from one or two erasures.

Chunks encoded by a given version of Ceph are expected to be encoded
exactly in the same way by all Ceph versions going forward.

http://tracker.ceph.com/issues/9420 Refs: #9420

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit f5901303dbf50e9d08f2f1e510a1936a20037909)
erasure-code: workunit to check for encoding regression

Clone the archive of encoded objects and decode all archived objects, up
to and including the current ceph version.

http://tracker.ceph.com/issues/9420 Refs: #9420

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 7638b15f23976c3265cf766e16cf93af1a7e0091)
erasure-code: s/alignement/alignment/ typos in jerasure

The jerasure-per-chunk-alignment prameter was mispelled and while
useable that would lead to confusion.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 2c84d0b1db57d918840e669a17bbd8c5ddca9747)
erasure-code: Makefile.am cosmetics

Cluster benchmark related lines together.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 10c88c8f27080a8e25f128b7065cee5c2f68e91b)
erasure-code: add corpus verification to make check

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 6fdbdff2ad1b55d4a37dcb95cfbb06c4454cdaf2)
erasure-code: ceph_erasure_code does not need to avoid dlclose

The only reason for not dlclosing plugins at exit is for callgrind but
ceph_erasure_code has no workload that would require callgrind.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 49613cb2aab6e73e3ea50fa164735b55e80121cd)
erasure_code: implement ceph_erasure_code to assert the existence of a plugin

This is handy when scripting in the context of teuthology and only
conditionally run tests for the isa plugin, for instance.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit efe121d9f2028c312eef2650d32ccf0cbc828edb)
erasure-code: add erasure_code_benchmark --verbose

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 3ff2816b3eecfb7277295583387549dac5429628)

Conflicts:
	src/test/erasure-code/ceph_erasure_code_benchmark.cc
	src/test/erasure-code/ceph_erasure_code_benchmark.h
erasure-code: erasure_code_benchmark exhaustive erasure exploration

Add the --erasure-generation exhaustive flag to try all combinations of
erasures, not just one at random.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 2d7adb23bc52e7c0753f4571fecd8eefa209ef02)

Conflicts:
	src/test/erasure-code/ceph_erasure_code_benchmark.h
Merge pull request #3006 from dachary/wip-9420-erasure-code-non-regression-giant

 erasure-code: store and compare encoded contents (giant)