diff options
-rw-r--r-- | .mailmap | 4 | ||||
-rw-r--r-- | AUTHORS | 37 | ||||
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | README.md | 348 | ||||
-rw-r--r-- | bindep.txt | 3 | ||||
-rw-r--r-- | doc/api_definition.md | 275 | ||||
-rw-r--r-- | doc/code_organization.md | 60 | ||||
-rw-r--r-- | erasurecode.pc.in | 4 | ||||
-rw-r--r-- | include/erasurecode/alg_sig.h | 3 | ||||
-rw-r--r-- | include/erasurecode/erasurecode_helpers_ext.h | 2 | ||||
-rw-r--r-- | include/erasurecode/erasurecode_version.h | 2 | ||||
-rw-r--r-- | src/Makefile.am | 7 | ||||
-rw-r--r-- | src/erasurecode.c | 36 | ||||
-rw-r--r-- | src/erasurecode_helpers.c | 46 | ||||
-rw-r--r-- | src/erasurecode_postprocessing.c | 13 | ||||
-rw-r--r-- | src/utils/chksum/crc32.c | 31 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/liberasurecode_test.c | 680 |
18 files changed, 513 insertions, 1054 deletions
@@ -1,4 +1,8 @@ Mark Storer <Mark.Storer@evault.com> Mark W. Storer <mark.storer@evault.com> Kevin Greenan <kmgreen2@gmail.com> <kmg@box.com> Eric Lambert <eric_lambert@xyratex.com> <eric.lambert@seagate.com> +Eric Lambert <eric_lambert@xyratex.com> <eric.d.lambert@gmail.com> Tushar Gohad <tushar.gohad@intel.com> <tusharsg@gmail.com> +Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp> <bloodeagle40234@gmail.com> +Alistair Coles <alistairncoles@gmail.com> <alistair.coles@hpe.com> +Ondřej Nový <novy@ondrej.org> <ondrej.novy@firma.seznam.cz> @@ -1,25 +1,26 @@ Original Authors ---------------- - * Tushar Gohad - * Kevin M Greenan - * Eric Lambert - * Mark Storer +Tushar Gohad (tushar.gohad@intel.com) +Kevin Greenan (kmgreen2@gmail.com) +Eric Lambert (eric_lambert@xyratex.com) +Mark Storer (Mark.Storer@evault.com) Contributors ---------------- - * Timur Alperovich - * Alistair Coles - * Thiago da Silva - * Thomas Goirand - * Andreas Jaeger - * Ryuta Kon - * Chris Lamb - * Eric Lambert - * Dirk Mueller - * Ondřej Nový - * James Page - * Kota Tsuyuzaki - * Pete Zaitcev - * gengchc2 +Timur Alperovich (timuralp@swiftstack.com) +Alistair Coles (alistairncoles@gmail.com) +Thiago da Silva (thiago@redhat.com) +Andreas Jaeger (aj@suse.com) +Chris Lamb (lamby@debian.org) +Dirk Mueller (dirk@dmllr.de) +James Page (james.page@ubuntu.com) +Kota Tsuyuzaki (tsuyuzaki.kota@lab.ntt.co.jp) +Pete Zaitcev (zaitcev@kotori.zaitcev.us) +gengchc2 (geng.changcai2@zte.com.cn) +Daniel Axtens (dja@axtens.net) +Tim Burke (tim.burke@gmail.com) +John Dickinson (me@not.mn) +Jim Cheung (jim.cheung@phazr.io) +Ondřej Nový (novy@ondrej.org) @@ -1,3 +1,17 @@ +Release 1.5.0 +------------- + + . Added support for Phazr.IO libphazr library + . Fixed memory leaks and initialization errors in Jerasure + . Fixed memory leak in ISA-L + . Changed the Galois Field multiplication table in ISA-L to be calculated + only on init. + . Fixed valgrind-check to enable finding memory-leaks. + . Fixed several memory leaks in tests and also in the built-in rs_vand + implementation. + . Fixed warning on automake tool + . Added compiler flag to disable AVX optimizations. + Release 1.4.0 ------------- @@ -34,13 +34,6 @@ Highlights ---- -License -========== - -liberasurecode is distributed under the terms of the **BSD** license. - ----- - Active Users ==================== @@ -61,7 +54,7 @@ Install dependencies - $ sudo apt-get install build-essential autoconf automake libtool ``` - Fedora/RedHat/Centos hosts: + Fedora/RedHat/CentOS hosts: ```sh $ sudo yum install -y gcc make autoconf automake libtool @@ -80,345 +73,6 @@ top-level directory: ---- -liberasurecode API Definition -============================= - -``` c - -/* liberasurecode frontend API functions */ - -/** - * Create a liberasurecode instance and return a descriptor - * for use with EC operations (encode, decode, reconstruct) - * - * @param id - one of the supported backends as - * defined by ec_backend_id_t - * @param ec_args - arguments to the EC backend - * arguments common to all backends - * k - number of data fragments - * m - number of parity fragments - * w - word size, in bits - * hd - hamming distance (=m for Reed-Solomon) - * ct - fragment checksum type (stored with the fragment metadata) - * backend-specific arguments - * null_args - arguments for the null backend - * flat_xor_hd, jerasure do not require any special args - * - * @return liberasurecode instance descriptor (int > 0) - */ -int liberasurecode_instance_create(const ec_backend_id_t id, - struct ec_args *args); - -/** - * Close a liberasurecode instance - * - * @param desc - liberasurecode descriptor to close - * - * @return 0 on success, otherwise non-zero error code - */ -int liberasurecode_instance_destroy(int desc); - - -/** - * Erasure encode a data buffer - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param orig_data - data to encode - * @param orig_data_size - length of data to encode - * @param encoded_data - pointer to _output_ array (char **) of k data - * fragments (char *), allocated by the callee - * @param encoded_parity - pointer to _output_ array (char **) of m parity - * fragments (char *), allocated by the callee - * @param fragment_len - pointer to _output_ length of each fragment, assuming - * all fragments are the same length - * - * @return 0 on success, -error code otherwise - */ -int liberasurecode_encode(int desc, - const char *orig_data, uint64_t orig_data_size, /* input */ - char ***encoded_data, char ***encoded_parity, /* output */ - uint64_t *fragment_len); /* output */ - -/** - * Cleanup structures allocated by librasurecode_encode - * - * The caller has no context, so cannot safely free memory - * allocated by liberasurecode, so it must pass the - * deallocation responsibility back to liberasurecode. - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param encoded_data - (char **) array of k data - * fragments (char *), allocated by liberasurecode_encode - * @param encoded_parity - (char **) array of m parity - * fragments (char *), allocated by liberasurecode_encode - * - * @return 0 in success; -error otherwise - */ -int liberasurecode_encode_cleanup(int desc, char **encoded_data, - char **encoded_parity); - -/** - * Reconstruct original data from a set of k encoded fragments - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param fragments - erasure encoded fragments (> = k) - * @param num_fragments - number of fragments being passed in - * @param fragment_len - length of each fragment (assume they are the same) - * @param force_metadata_checks - force fragment metadata checks (default: 0) - * @param out_data - _output_ pointer to decoded data - * @param out_data_len - _output_ length of decoded output - * (both output data pointers are allocated by liberasurecode, - * caller invokes liberasurecode_decode_clean() after it has - * read decoded data in 'out_data') - * - * @return 0 on success, -error code otherwise - */ -int liberasurecode_decode(int desc, - char **available_fragments, /* input */ - int num_fragments, uint64_t fragment_len, /* input */ - int force_metadata_checks, /* input */ - char **out_data, uint64_t *out_data_len); /* output */ - -/** - * Cleanup structures allocated by librasurecode_decode - * - * The caller has no context, so cannot safely free memory - * allocated by liberasurecode, so it must pass the - * deallocation responsibility back to liberasurecode. - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param data - (char *) buffer of data decoded by librasurecode_decode - * - * @return 0 on success; -error otherwise - */ -int liberasurecode_decode_cleanup(int desc, char *data); - -/** - * Reconstruct a missing fragment from a subset of available fragments - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param available_fragments - erasure encoded fragments - * @param num_fragments - number of fragments being passed in - * @param fragment_len - size in bytes of the fragments - * @param destination_idx - missing idx to reconstruct - * @param out_fragment - output of reconstruct - * - * @return 0 on success, -error code otherwise - */ -int liberasurecode_reconstruct_fragment(int desc, - char **available_fragments, /* input */ - int num_fragments, uint64_t fragment_len, /* input */ - int destination_idx, /* input */ - char* out_fragment); /* output */ - -/** - * Return a list of lists with valid rebuild indexes given - * a list of missing indexes. - * - * @desc: liberasurecode instance descriptor (obtained with - * liberasurecode_instance_create) - * @fragments_to_reconstruct list of indexes to reconstruct - * @fragments_to_exclude list of indexes to exclude from - * reconstruction equation - * @fragments_needed list of fragments needed to reconstruct - * fragments in fragments_to_reconstruct - * - * @return 0 on success, non-zero on error - */ -int liberasurecode_fragments_needed(int desc, - int *fragments_to_reconstruct, - int *fragments_to_exclude, - int *fragments_needed); - -``` - -Erasure Code Fragment Checksum Types Supported ----------------------------------------------- - -``` c - -/* Checksum types supported for fragment metadata stored in each fragment */ -typedef enum { - CHKSUM_NONE = 0, /* "none" (default) */ - CHKSUM_CRC32 = 1, /* "crc32" */ - CHKSUM_TYPES_MAX, -} ec_checksum_type_t; - -``` - -Erasure Code Fragment Checksum API ----------------------------------- - -``` c - -struct __attribute__((__packed__)) -fragment_metadata -{ - uint32_t idx; /* 4 */ - uint32_t size; /* 4 */ - uint32_t frag_backend_metadata_size; /* 4 */ - uint64_t orig_data_size; /* 8 */ - uint8_t chksum_type; /* 1 */ - uint32_t chksum[LIBERASURECODE_MAX_CHECKSUM_LEN]; /* 32 */ - uint8_t chksum_mismatch; /* 1 */ - uint8_t backend_id; /* 1 */ - uint32_t backend_version; /* 4 */ -} fragment_metadata_t; - -#define FRAGSIZE_2_BLOCKSIZE(fragment_size) \ - (fragment_size - sizeof(fragment_header_t)) - -/** - * Get opaque metadata for a fragment. The metadata is opaque to the - * client, but meaningful to the underlying library. It is used to verify - * stripes in verify_stripe_metadata(). - * - * @param fragment - fragment data pointer - * @param fragment_metadata - pointer to allocated buffer of size at least - * sizeof(struct fragment_metadata) to hold fragment metadata struct - * - * @return 0 on success, non-zero on error - */ -//EDL: This needs to be implemented -int liberasurecode_get_fragment_metadata(char *fragment, - fragment_metadata_t *fragment_metadata); - -/** -* Verify that the specified pointer points to a well formed fragment that can -* be processed by both this instance of liberasurecode and the specified -* backend. -* -* @param desc - liberasurecode descriptor/handle -* from liberasurecode_instance_create() -* @param fragment - fragment to verify -* -* @return 1 if fragment validation fails, 0 otherwise. -*/ -int is_invalid_fragment(int desc, char *fragment); - -/** - * Verify a subset of fragments generated by encode() - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param fragments - fragments part of the EC stripe to verify - * @param num_fragments - number of fragments part of the EC stripe - * - * @return 1 if stripe checksum verification is successful, 0 otherwise - */ -int liberasurecode_verify_stripe_metadata(int desc, - char **fragments, int num_fragments); - -/* ==~=*=~===~=*=~==~=*=~== liberasurecode Helpers ==~*==~=*=~==~=~=*=~==~= */ - -/** - * This computes the aligned size of a buffer passed into - * the encode function. The encode function must pad fragments - * to be algined with the word size (w) and the last fragment also - * needs to be aligned. This computes the sum of the algined fragment - * sizes for a given buffer to encode. - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param data_len - original data length in bytes - * - * @return aligned length, or -error code on error - */ -int liberasurecode_get_aligned_data_size(int desc, uint64_t data_len); - -/** - * This will return the minimum encode size, which is the minimum - * buffer size that can be encoded. - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * - * @return minimum data length length, or -error code on error - */ -int liberasurecode_get_minimum_encode_size(int desc); - -/** - * This will return the fragment size, which is each fragment data - * length the backend will allocate when encoding. - * - * @param desc - liberasurecode descriptor/handle - * from liberasurecode_instance_create() - * @param data_len - original data length in bytes - * - * @return fragment size - sizeof(fragment_header) + size - * + frag_backend_metadata_size - */ -int liberasurecode_get_fragment_size(int desc, int data_len); -``` - ----- - -Code organization -================= -``` - |-- include - | +-- erasurecode - | | +-- erasurecode.h --> liberasurecode frontend API header - | | +-- erasurecode_backend.h --> liberasurecode backend API header - | +-- xor_codes --> headers for the built-in XOR codes - | - |-- src - | |-- erasurecode.c --> liberasurecode API implementation - | | (frontend + backend) - | |-- backends - | | +-- null - | | +--- null.c --> 'null' erasure code backend (template backend) - | | +-- xor - | | +--- flat_xor_hd.c --> 'flat_xor_hd' erasure code backend (built-in) - | | +-- jerasure - | | +-- jerasure_rs_cauchy.c --> 'jerasure_rs_vand' erasure code backend (jerasure.org) - | | +-- jerasure_rs_vand.c --> 'jerasure_rs_cauchy' erasure code backend (jerasure.org) - | | +-- isa-l - | | +-- isa_l_rs_vand.c --> 'isa_l_rs_vand' erasure code backend (Intel) - | | +-- shss - | | +-- shss.c --> 'shss' erasure code backend (NTT Labs) - | | +-- phazrio - | | +-- libphazr.c --> 'libphazr' erasure code backend (Phazr.IO) - | | - | |-- builtin - | | +-- xor_codes --> XOR HD code backend, built-in erasure - | | | code implementation (shared library) - | | +-- xor_code.c - | | +-- xor_hd_code.c - | | +-- rs_vand --> liberasurecode native Reed Soloman codes - | | - | +-- utils - | +-- chksum --> fragment checksum utils for erasure - | +-- alg_sig.c coded fragments - | +-- crc32.c - | - |-- doc --> API Documentation - | +-- Doxyfile - | +-- html - | - |--- test --> Test routines - | +-- builtin - | | +-- xor_codes - | +-- liberasurecode_test.c - | +-- utils - | - |-- autogen.sh - |-- configure.ac - |-- Makefile.am - |-- README - |-- NEWS - |-- COPYING - |-- AUTHORS - |-- INSTALL - +-- ChangeLog -``` ---- - References ========== @@ -1,6 +1,9 @@ # This is a cross-platform list tracking distribution packages needed by tests; # see http://docs.openstack.org/infra/bindep/ for additional information. +zlib1g-dev [platform:dpkg] +zlib-devel [platform:rpm] + build-essential [platform:dpkg] gcc [platform:rpm] make [platform:rpm] diff --git a/doc/api_definition.md b/doc/api_definition.md new file mode 100644 index 0000000..90e2eaa --- /dev/null +++ b/doc/api_definition.md @@ -0,0 +1,275 @@ +liberasurecode API Definition +============================= + +``` c + +/* liberasurecode frontend API functions */ + +/** + * Create a liberasurecode instance and return a descriptor + * for use with EC operations (encode, decode, reconstruct) + * + * @param id - one of the supported backends as + * defined by ec_backend_id_t + * @param ec_args - arguments to the EC backend + * arguments common to all backends + * k - number of data fragments + * m - number of parity fragments + * w - word size, in bits + * hd - hamming distance (=m for Reed-Solomon) + * ct - fragment checksum type (stored with the fragment metadata) + * backend-specific arguments + * null_args - arguments for the null backend + * flat_xor_hd, jerasure do not require any special args + * + * @return liberasurecode instance descriptor (int > 0) + */ +int liberasurecode_instance_create(const ec_backend_id_t id, + struct ec_args *args); + +/** + * Close a liberasurecode instance + * + * @param desc - liberasurecode descriptor to close + * + * @return 0 on success, otherwise non-zero error code + */ +int liberasurecode_instance_destroy(int desc); + + +/** + * Erasure encode a data buffer + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param orig_data - data to encode + * @param orig_data_size - length of data to encode + * @param encoded_data - pointer to _output_ array (char **) of k data + * fragments (char *), allocated by the callee + * @param encoded_parity - pointer to _output_ array (char **) of m parity + * fragments (char *), allocated by the callee + * @param fragment_len - pointer to _output_ length of each fragment, assuming + * all fragments are the same length + * + * @return 0 on success, -error code otherwise + */ +int liberasurecode_encode(int desc, + const char *orig_data, uint64_t orig_data_size, /* input */ + char ***encoded_data, char ***encoded_parity, /* output */ + uint64_t *fragment_len); /* output */ + +/** + * Cleanup structures allocated by librasurecode_encode + * + * The caller has no context, so cannot safely free memory + * allocated by liberasurecode, so it must pass the + * deallocation responsibility back to liberasurecode. + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param encoded_data - (char **) array of k data + * fragments (char *), allocated by liberasurecode_encode + * @param encoded_parity - (char **) array of m parity + * fragments (char *), allocated by liberasurecode_encode + * + * @return 0 in success; -error otherwise + */ +int liberasurecode_encode_cleanup(int desc, char **encoded_data, + char **encoded_parity); + +/** + * Reconstruct original data from a set of k encoded fragments + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param fragments - erasure encoded fragments (> = k) + * @param num_fragments - number of fragments being passed in + * @param fragment_len - length of each fragment (assume they are the same) + * @param force_metadata_checks - force fragment metadata checks (default: 0) + * @param out_data - _output_ pointer to decoded data + * @param out_data_len - _output_ length of decoded output + * (both output data pointers are allocated by liberasurecode, + * caller invokes liberasurecode_decode_clean() after it has + * read decoded data in 'out_data') + * + * @return 0 on success, -error code otherwise + */ +int liberasurecode_decode(int desc, + char **available_fragments, /* input */ + int num_fragments, uint64_t fragment_len, /* input */ + int force_metadata_checks, /* input */ + char **out_data, uint64_t *out_data_len); /* output */ + +/** + * Cleanup structures allocated by librasurecode_decode + * + * The caller has no context, so cannot safely free memory + * allocated by liberasurecode, so it must pass the + * deallocation responsibility back to liberasurecode. + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param data - (char *) buffer of data decoded by librasurecode_decode + * + * @return 0 on success; -error otherwise + */ +int liberasurecode_decode_cleanup(int desc, char *data); + +/** + * Reconstruct a missing fragment from a subset of available fragments + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param available_fragments - erasure encoded fragments + * @param num_fragments - number of fragments being passed in + * @param fragment_len - size in bytes of the fragments + * @param destination_idx - missing idx to reconstruct + * @param out_fragment - output of reconstruct + * + * @return 0 on success, -error code otherwise + */ +int liberasurecode_reconstruct_fragment(int desc, + char **available_fragments, /* input */ + int num_fragments, uint64_t fragment_len, /* input */ + int destination_idx, /* input */ + char* out_fragment); /* output */ + +/** + * Return a list of lists with valid rebuild indexes given + * a list of missing indexes. + * + * @desc: liberasurecode instance descriptor (obtained with + * liberasurecode_instance_create) + * @fragments_to_reconstruct list of indexes to reconstruct + * @fragments_to_exclude list of indexes to exclude from + * reconstruction equation + * @fragments_needed list of fragments needed to reconstruct + * fragments in fragments_to_reconstruct + * + * @return 0 on success, non-zero on error + */ +int liberasurecode_fragments_needed(int desc, + int *fragments_to_reconstruct, + int *fragments_to_exclude, + int *fragments_needed); + +``` + +Erasure Code Fragment Checksum Types Supported +---------------------------------------------- + +``` c + +/* Checksum types supported for fragment metadata stored in each fragment */ +typedef enum { + CHKSUM_NONE = 0, /* "none" (default) */ + CHKSUM_CRC32 = 1, /* "crc32" */ + CHKSUM_TYPES_MAX, +} ec_checksum_type_t; + +``` + +Erasure Code Fragment Checksum API +---------------------------------- + +``` c + +struct __attribute__((__packed__)) +fragment_metadata +{ + uint32_t idx; /* 4 */ + uint32_t size; /* 4 */ + uint32_t frag_backend_metadata_size; /* 4 */ + uint64_t orig_data_size; /* 8 */ + uint8_t chksum_type; /* 1 */ + uint32_t chksum[LIBERASURECODE_MAX_CHECKSUM_LEN]; /* 32 */ + uint8_t chksum_mismatch; /* 1 */ + uint8_t backend_id; /* 1 */ + uint32_t backend_version; /* 4 */ +} fragment_metadata_t; + +#define FRAGSIZE_2_BLOCKSIZE(fragment_size) \ + (fragment_size - sizeof(fragment_header_t)) + +/** + * Get opaque metadata for a fragment. The metadata is opaque to the + * client, but meaningful to the underlying library. It is used to verify + * stripes in verify_stripe_metadata(). + * + * @param fragment - fragment data pointer + * @param fragment_metadata - pointer to allocated buffer of size at least + * sizeof(struct fragment_metadata) to hold fragment metadata struct + * + * @return 0 on success, non-zero on error + */ +//EDL: This needs to be implemented +int liberasurecode_get_fragment_metadata(char *fragment, + fragment_metadata_t *fragment_metadata); + +/** +* Verify that the specified pointer points to a well formed fragment that can +* be processed by both this instance of liberasurecode and the specified +* backend. +* +* @param desc - liberasurecode descriptor/handle +* from liberasurecode_instance_create() +* @param fragment - fragment to verify +* +* @return 1 if fragment validation fails, 0 otherwise. +*/ +int is_invalid_fragment(int desc, char *fragment); + +/** + * Verify a subset of fragments generated by encode() + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param fragments - fragments part of the EC stripe to verify + * @param num_fragments - number of fragments part of the EC stripe + * + * @return 1 if stripe checksum verification is successful, 0 otherwise + */ +int liberasurecode_verify_stripe_metadata(int desc, + char **fragments, int num_fragments); + +/* ==~=*=~===~=*=~==~=*=~== liberasurecode Helpers ==~*==~=*=~==~=~=*=~==~= */ + +/** + * This computes the aligned size of a buffer passed into + * the encode function. The encode function must pad fragments + * to be algined with the word size (w) and the last fragment also + * needs to be aligned. This computes the sum of the algined fragment + * sizes for a given buffer to encode. + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param data_len - original data length in bytes + * + * @return aligned length, or -error code on error + */ +int liberasurecode_get_aligned_data_size(int desc, uint64_t data_len); + +/** + * This will return the minimum encode size, which is the minimum + * buffer size that can be encoded. + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * + * @return minimum data length length, or -error code on error + */ +int liberasurecode_get_minimum_encode_size(int desc); + +/** + * This will return the fragment size, which is each fragment data + * length the backend will allocate when encoding. + * + * @param desc - liberasurecode descriptor/handle + * from liberasurecode_instance_create() + * @param data_len - original data length in bytes + * + * @return fragment size - sizeof(fragment_header) + size + * + frag_backend_metadata_size + */ +int liberasurecode_get_fragment_size(int desc, int data_len); +```
\ No newline at end of file diff --git a/doc/code_organization.md b/doc/code_organization.md new file mode 100644 index 0000000..adf2a95 --- /dev/null +++ b/doc/code_organization.md @@ -0,0 +1,60 @@ +Code organization +================= +``` + |-- include + | +-- erasurecode + | | +-- erasurecode.h --> liberasurecode frontend API header + | | +-- erasurecode_backend.h --> liberasurecode backend API header + | +-- xor_codes --> headers for the built-in XOR codes + | + |-- src + | |-- erasurecode.c --> liberasurecode API implementation + | | (frontend + backend) + | |-- backends + | | +-- null + | | +--- null.c --> 'null' erasure code backend (template backend) + | | +-- xor + | | +--- flat_xor_hd.c --> 'flat_xor_hd' erasure code backend (built-in) + | | +-- jerasure + | | +-- jerasure_rs_cauchy.c --> 'jerasure_rs_vand' erasure code backend (jerasure.org) + | | +-- jerasure_rs_vand.c --> 'jerasure_rs_cauchy' erasure code backend (jerasure.org) + | | +-- isa-l + | | +-- isa_l_rs_vand.c --> 'isa_l_rs_vand' erasure code backend (Intel) + | | +-- shss + | | +-- shss.c --> 'shss' erasure code backend (NTT Labs) + | | +-- phazrio + | | +-- libphazr.c --> 'libphazr' erasure code backend (Phazr.IO) + | | + | |-- builtin + | | +-- xor_codes --> XOR HD code backend, built-in erasure + | | | code implementation (shared library) + | | +-- xor_code.c + | | +-- xor_hd_code.c + | | +-- rs_vand --> liberasurecode native Reed Soloman codes + | | + | +-- utils + | +-- chksum --> fragment checksum utils for erasure + | +-- alg_sig.c coded fragments + | +-- crc32.c + | + |-- doc --> API Documentation + | +-- Doxyfile + | +-- html + | + |--- test --> Test routines + | +-- builtin + | | +-- xor_codes + | +-- liberasurecode_test.c + | +-- utils + | + |-- autogen.sh + |-- configure.ac + |-- Makefile.am + |-- README + |-- NEWS + |-- COPYING + |-- AUTHORS + |-- INSTALL + +-- ChangeLog +``` +---
\ No newline at end of file diff --git a/erasurecode.pc.in b/erasurecode.pc.in index ee6d82b..148c382 100644 --- a/erasurecode.pc.in +++ b/erasurecode.pc.in @@ -10,6 +10,6 @@ Description: C library with pluggable erasure code backends Version: @LIBERASURECODE_VERSION@ Requires: Conflicts: -Libs: -L${libdir} -lerasurecode -Libs.private: @ERASURECODE_STATIC_LIBS@ +Libs: -L${libdir} -lerasurecode -ldl +Libs.private: @ERASURECODE_STATIC_LIBS@ -lz Cflags: -I${includedir}/ -I${includedir}/liberasurecode diff --git a/include/erasurecode/alg_sig.h b/include/erasurecode/alg_sig.h index 52554a9..e250fb3 100644 --- a/include/erasurecode/alg_sig.h +++ b/include/erasurecode/alg_sig.h @@ -57,8 +57,7 @@ alg_sig_t *init_alg_sig(int sig_len, int gf_w); void destroy_alg_sig(alg_sig_t* alg_sig_handle); int compute_alg_sig(alg_sig_t* alg_sig_handle, char *buf, int len, char *sig); -int crc32_build_fast_table(); -int crc32(int crc, const void *buf, int size); +int liberasurecode_crc32_alt(int crc, const void *buf, int size); #endif diff --git a/include/erasurecode/erasurecode_helpers_ext.h b/include/erasurecode/erasurecode_helpers_ext.h index 740d7db..8041a57 100644 --- a/include/erasurecode/erasurecode_helpers_ext.h +++ b/include/erasurecode/erasurecode_helpers_ext.h @@ -72,8 +72,6 @@ int set_backend_id(char *buf, ec_backend_id_t id); int get_backend_id(char *buf, ec_backend_id_t *id); int set_backend_version(char *buf, uint32_t version); int get_backend_version(char *buf, uint32_t *version); -int set_metadata_chksum(char *buf); -uint32_t *get_metadata_chksum(char *buf); int is_invalid_fragment_header(fragment_header_t *header); /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ diff --git a/include/erasurecode/erasurecode_version.h b/include/erasurecode/erasurecode_version.h index fadbbb6..1ce86ea 100644 --- a/include/erasurecode/erasurecode_version.h +++ b/include/erasurecode/erasurecode_version.h @@ -26,7 +26,7 @@ #define _ERASURECODE_VERSION_H_ #define _MAJOR 1 -#define _MINOR 4 +#define _MINOR 5 #define _REV 0 #define _VERSION(x, y, z) ((x << 16) | (y << 8) | (z)) diff --git a/src/Makefile.am b/src/Makefile.am index 8312dd0..693809e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,9 +34,10 @@ liberasurecode_la_SOURCES = \ liberasurecode_la_CPPFLAGS = -Werror @GCOV_FLAGS@ liberasurecode_la_LIBADD = \ - builtin/null_code/libnullcode.la -lpthread -lm @GCOV_LDFLAGS@ \ - builtin/xor_codes/libXorcode.la -lpthread -lm @GCOV_LDFLAGS@ \ - builtin/rs_vand/liberasurecode_rs_vand.la -lpthread -lm @GCOV_LDFLAGS@ + builtin/null_code/libnullcode.la \ + builtin/xor_codes/libXorcode.la \ + builtin/rs_vand/liberasurecode_rs_vand.la \ + -lpthread -lm -lz @GCOV_LDFLAGS@ # Version format (C - A).(A).(R) for C:R:A input liberasurecode_la_LDFLAGS = -rpath '$(libdir)' -version-info @LIBERASURECODE_VERSION_INFO@ diff --git a/src/erasurecode.c b/src/erasurecode.c index e324365..27542c5 100644 --- a/src/erasurecode.c +++ b/src/erasurecode.c @@ -26,7 +26,8 @@ * vi: set noai tw=79 ts=4 sw=4: */ -#include "assert.h" +#include <assert.h> +#include <zlib.h> #include "list.h" #include "erasurecode.h" #include "erasurecode_backend.h" @@ -1065,9 +1066,17 @@ int liberasurecode_get_fragment_metadata(char *fragment, uint32_t stored_chksum = fragment_hdr->meta.chksum[0]; char *fragment_data = get_data_ptr_from_fragment(fragment); uint64_t fragment_size = fragment_hdr->meta.size; - computed_chksum = crc32(0, fragment_data, fragment_size); + computed_chksum = crc32(0, (unsigned char *) fragment_data, fragment_size); if (stored_chksum != computed_chksum) { - fragment_metadata->chksum_mismatch = 1; + // Try again with our "alternative" crc32; see + // https://bugs.launchpad.net/liberasurecode/+bug/1666320 + computed_chksum = liberasurecode_crc32_alt( + 0, fragment_data, fragment_size); + if (stored_chksum != computed_chksum) { + fragment_metadata->chksum_mismatch = 1; + } else { + fragment_metadata->chksum_mismatch = 0; + } } else { fragment_metadata->chksum_mismatch = 0; } @@ -1086,7 +1095,7 @@ out: int is_invalid_fragment_header(fragment_header_t *header) { - uint32_t *stored_csum = NULL, csum = 0; + uint32_t csum = 0; assert (NULL != header); if (header->libec_version == 0) /* libec_version must be bigger than 0 */ @@ -1094,11 +1103,20 @@ int is_invalid_fragment_header(fragment_header_t *header) if (header->libec_version < _VERSION(1,2,0)) /* no metadata checksum support */ return 0; - stored_csum = get_metadata_chksum((char *) header); - if (NULL == stored_csum) - return 1; /* can't verify, possibly crc32 call error */ - csum = crc32(0, &header->meta, sizeof(fragment_metadata_t)); - return (*stored_csum != csum); + + if (header->magic != LIBERASURECODE_FRAG_HEADER_MAGIC) { + log_error("Invalid fragment header (get meta chksum)!"); + return 1; + } + + csum = crc32(0, (unsigned char *) &header->meta, sizeof(fragment_metadata_t)); + if (header->metadata_chksum == csum) { + return 0; + } + // Else, try again with our "alternative" crc32; see + // https://bugs.launchpad.net/liberasurecode/+bug/1666320 + csum = liberasurecode_crc32_alt(0, &header->meta, sizeof(fragment_metadata_t)); + return (header->metadata_chksum != csum); } int liberasurecode_verify_fragment_metadata(ec_backend_t be, diff --git a/src/erasurecode_helpers.c b/src/erasurecode_helpers.c index fd14298..1494587 100644 --- a/src/erasurecode_helpers.c +++ b/src/erasurecode_helpers.c @@ -28,6 +28,7 @@ #include <assert.h> #include <stdio.h> #include <stdarg.h> +#include <zlib.h> #include "erasurecode_backend.h" #include "erasurecode_helpers.h" #include "erasurecode_helpers_ext.h" @@ -474,7 +475,7 @@ inline int set_checksum(ec_checksum_type_t ct, char *buf, int blocksize) switch(header->meta.chksum_type) { case CHKSUM_CRC32: - header->meta.chksum[0] = crc32(0, data, blocksize); + header->meta.chksum[0] = crc32(0, (unsigned char *) data, blocksize); break; case CHKSUM_MD5: break; @@ -500,46 +501,3 @@ inline uint32_t* get_chksum(char *buf) } /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ - -#if LIBERASURECODE_VERSION >= _VERSION(1,2,0) -inline int set_metadata_chksum(char *buf) -{ - fragment_header_t* header = (fragment_header_t*) buf; - - assert(NULL != header); - if (header->magic != LIBERASURECODE_FRAG_HEADER_MAGIC) { - log_error("Invalid fragment header (set meta chksum)!\n"); - return -1; - } - - header->metadata_chksum = crc32(0, &header->meta, - sizeof(fragment_metadata_t)); - return 0; -} - -inline uint32_t* get_metadata_chksum(char *buf) -{ - fragment_header_t* header = (fragment_header_t*) buf; - - assert(NULL != header); - if (header->magic != LIBERASURECODE_FRAG_HEADER_MAGIC) { - log_error("Invalid fragment header (get meta chksum)!"); - return NULL; - } - - return (uint32_t *) &header->metadata_chksum; -} -#else -inline int set_metadata_chksum(char *buf) -{ - return 0; -} - -inline uint32_t* get_metadata_chksum(char *buf) -{ - return (uint32_t *) 0; -} -#endif - -/* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ - diff --git a/src/erasurecode_postprocessing.c b/src/erasurecode_postprocessing.c index 7d121d4..07c08f5 100644 --- a/src/erasurecode_postprocessing.c +++ b/src/erasurecode_postprocessing.c @@ -26,9 +26,11 @@ * vi: set noai tw=79 ts=4 sw=4: */ +#include <zlib.h> #include "erasurecode_backend.h" #include "erasurecode_helpers.h" #include "erasurecode_helpers_ext.h" +#include "erasurecode_log.h" #include "erasurecode_stdinc.h" void add_fragment_metadata(ec_backend_t be, char *fragment, @@ -49,7 +51,16 @@ void add_fragment_metadata(ec_backend_t be, char *fragment, if (add_chksum) { set_checksum(ct, fragment, blocksize); } - set_metadata_chksum(fragment); + + fragment_header_t* header = (fragment_header_t*) fragment; + + if (header->magic != LIBERASURECODE_FRAG_HEADER_MAGIC) { + log_error("Invalid fragment header (add fragment metadata)!\n"); + return; + } + + header->metadata_chksum = crc32(0, (unsigned char *) &header->meta, + sizeof(fragment_metadata_t)); } int finalize_fragments_after_encode(ec_backend_t instance, diff --git a/src/utils/chksum/crc32.c b/src/utils/chksum/crc32.c index 6710dd7..b11dec9 100644 --- a/src/utils/chksum/crc32.c +++ b/src/utils/chksum/crc32.c @@ -42,30 +42,6 @@ #include <sys/param.h> -#if defined(INTEL_SSE4) -#include <nmmintrin.h> - -int -crc32(int crc, const void *buf, size_t size) -{ - unsigned long long *current = (unsigned long long*)buf; - unsigned char *current_char; - - crc = crc ^ ~0U; - - while(size >= 8) { - crc = _mm_crc32_u64(crc, *current++); - size -= 8; - } - - current_char = (unsigned char*)current; - while (size--) { - crc = _mm_crc32_u8(crc, *current_char++); - } - return crc ^ ~0U; -} -#else - static int crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -112,11 +88,8 @@ static int crc32_tab[] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; -// Use same polynomial as Intel's SSE4 instruction! -#define POLY_CRC_32 0x11EDC6F41 - int -crc32(int crc, const void *buf, size_t size) +liberasurecode_crc32_alt(int crc, const void *buf, size_t size) { const char *p; @@ -128,5 +101,3 @@ crc32(int crc, const void *buf, size_t size) return crc ^ ~0U; } -#endif - diff --git a/test/Makefile.am b/test/Makefile.am index d8ffa79..2e33bdc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -15,7 +15,7 @@ check_PROGRAMS += alg_sig_test liberasurecode_test_SOURCES = liberasurecode_test.c liberasurecode_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/erasurecode @GCOV_FLAGS@ -liberasurecode_test_LDFLAGS = @GCOV_LDFLAGS@ $(top_builddir)/src/liberasurecode.la -ldl -lpthread +liberasurecode_test_LDFLAGS = @GCOV_LDFLAGS@ $(top_builddir)/src/liberasurecode.la -ldl -lpthread -lz check_PROGRAMS += liberasurecode_test libec_slap_SOURCES = libec_slap.c diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c index 071889f..74aef9a 100644 --- a/test/liberasurecode_test.c +++ b/test/liberasurecode_test.c @@ -28,6 +28,7 @@ #include <assert.h> #include <stdbool.h> +#include <zlib.h> #include "erasurecode.h" #include "erasurecode_helpers.h" #include "erasurecode_helpers_ext.h" @@ -475,7 +476,7 @@ static void validate_fragment_checksum(struct ec_args *args, assert(false); //currently only have support crc32 break; case CHKSUM_CRC32: - computed = crc32(0, fragment_data, size); + computed = crc32(0, (unsigned char *) fragment_data, size); break; case CHKSUM_NONE: assert(metadata->chksum_mismatch == 0); @@ -1027,15 +1028,11 @@ static void encode_decode_test_impl(const ec_backend_id_t be_id, int cmp_size = -1; char *data_ptr = NULL; char *frag = NULL; - uint32_t *mcksum = NULL; frag = (i < args->k) ? encoded_data[i] : encoded_parity[i - args->k]; assert(frag != NULL); fragment_header_t *header = (fragment_header_t*)frag; assert(header != NULL); - mcksum = get_metadata_chksum(frag); - assert(mcksum != NULL); - assert(header->metadata_chksum == *mcksum); fragment_metadata_t metadata = header->meta; assert(metadata.idx == i); @@ -1548,7 +1545,7 @@ static void test_simple_encode_decode(const ec_backend_id_t be_id, free(skip); } -static void test_simple_encode_decode_over32() +static void test_jerasure_rs_vand_simple_encode_decode_over32() { struct ec_args over32_args = { .k = 30, @@ -1743,607 +1740,102 @@ static void test_verify_stripe_metadata_frag_idx_invalid( verify_fragment_metadata_mismatch_impl(be_id, args, FRAGIDX_OUT_OF_RANGE); } +static void test_metadata_crcs() +{ + // We've observed headers like this in the wild, using our busted crc32 + char header[] = + "\x03\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x10\x00" + "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x07\x01\x0e\x02\x00\xcc\x5e\x0c\x0b\x00" + "\x04\x01\x00\x22\xee\x45\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x00"; + + fragment_metadata_t res; + + assert(liberasurecode_get_fragment_metadata(header, &res) == 0); + assert(is_invalid_fragment_header((fragment_header_t *) header) == 0); + + // Switch it to zlib's implementation + header[70] = '\x18'; + header[69] = '\x73'; + header[68] = '\xf8'; + header[67] = '\xec'; + + assert(liberasurecode_get_fragment_metadata(header, &res) == 0); + assert(is_invalid_fragment_header((fragment_header_t *) header) == 0); + + // Write down the wrong thing + header[70] = '\xff'; + assert(liberasurecode_get_fragment_metadata(header, &res) == -EBADHEADER); + assert(is_invalid_fragment_header((fragment_header_t *) header) == 1); +} //static void test_verify_str +/* An individual test, useful to ensure the reported name + reflects the function name */ +#define TEST(test, backend, checksum) {#test, test, backend, checksum, .skip = false} +/* Block of common tests for the "real" backends */ +#define TEST_SUITE(backend) \ + TEST(test_create_and_destroy_backend, backend, CHKSUM_NONE), \ + TEST(test_simple_encode_decode, backend, CHKSUM_NONE), \ + TEST(test_decode_with_missing_data, backend, CHKSUM_NONE), \ + TEST(test_decode_with_missing_parity, backend, CHKSUM_NONE), \ + TEST(test_decode_with_missing_multi_data, backend, CHKSUM_NONE), \ + TEST(test_decode_with_missing_multi_parity, backend, CHKSUM_NONE), \ + TEST(test_decode_with_missing_multi_data_parity, backend, CHKSUM_NONE), \ + TEST(test_simple_reconstruct, backend, CHKSUM_NONE), \ + TEST(test_fragments_needed, backend, CHKSUM_NONE), \ + TEST(test_get_fragment_metadata, backend, CHKSUM_NONE), \ + TEST(test_get_fragment_metadata, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata_libec_mismatch, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata_magic_mismatch, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata_be_id_mismatch, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata_be_ver_mismatch, backend, CHKSUM_CRC32), \ + TEST(test_verify_stripe_metadata_frag_idx_invalid, backend, CHKSUM_CRC32) + struct testcase testcases[] = { - {"test_backend_available_invalid_args", - test_backend_available_invalid_args, - EC_BACKENDS_MAX, 0, - .skip = false}, - {"test_backend_available", - test_backend_available, - EC_BACKEND_NULL, 0, - .skip = false}, - {"test_create_backend_invalid_args", - test_create_backend_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_create_backend_invalid_args", - test_destroy_backend_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_encode_invalid_args", - test_encode_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_encode_cleanup_invalid_args", - test_encode_cleanup_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_decode_invalid_args", - test_decode_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_decode_cleanup_invalid_args", - test_decode_cleanup_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_reconstruct_fragment_invalid_args", - test_reconstruct_fragment_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_get_fragment_metadata_invalid_args", - test_get_fragment_metadata_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_verify_stripe_metadata_invalid_args", - test_verify_stripe_metadata_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_fragments_needed_invalid_args", - test_fragments_needed_invalid_args, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_get_fragment_partition", - test_get_fragment_partition, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, - {"test_liberasurecode_get_version", - test_liberasurecode_get_version, - EC_BACKENDS_MAX, CHKSUM_TYPES_MAX, - .skip = false}, + TEST(test_backend_available_invalid_args, EC_BACKENDS_MAX, 0), + TEST(test_backend_available, EC_BACKEND_NULL, 0), + TEST(test_create_backend_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_destroy_backend_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_encode_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_encode_cleanup_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_decode_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_decode_cleanup_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_reconstruct_fragment_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_get_fragment_metadata_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_verify_stripe_metadata_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_fragments_needed_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_get_fragment_partition, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_liberasurecode_get_version, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX), + TEST(test_metadata_crcs, EC_BACKENDS_MAX, 0), // NULL backend test - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_NULL, CHKSUM_NONE, - .skip = false}, - {"simple_encode_null", - test_simple_encode_decode, - EC_BACKEND_NULL, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata", - test_get_fragment_metadata, - EC_BACKEND_NULL, CHKSUM_NONE, - .skip = false}, + TEST(test_create_and_destroy_backend, EC_BACKEND_NULL, CHKSUM_NONE), + TEST(test_simple_encode_decode, EC_BACKEND_NULL, CHKSUM_NONE), + TEST(test_get_fragment_metadata, EC_BACKEND_NULL, CHKSUM_NONE), + TEST(test_decode_with_missing_parity, EC_BACKEND_NULL, CHKSUM_NONE), + TEST(test_decode_with_missing_multi_parity, EC_BACKEND_NULL, CHKSUM_NONE), // Flat XOR backend tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"simple_encode_flat_xor_hd", - test_simple_encode_decode, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_flat_xor_hd", - test_decode_with_missing_data, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_parity_flat_xor_hd", - test_decode_with_missing_parity, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_flat_xor_hd", - test_decode_with_missing_multi_data, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_flat_xor_hd", - test_decode_with_missing_multi_parity, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_flat_xor_hd", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_flat_xor_hd", - test_simple_reconstruct, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_flat_xor_hd", - test_fragments_needed, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_flat_xor_hd", - test_get_fragment_metadata, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_flat_xor_hd_crc32", - test_get_fragment_metadata, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_FLAT_XOR_HD, CHKSUM_CRC32, - .skip = false}, + TEST_SUITE(EC_BACKEND_FLAT_XOR_HD), // Jerasure RS Vand backend tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_encode_jerasure_rs_vand", - test_simple_encode_decode, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_jerasure_rs_vand", - test_decode_with_missing_data, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_jerasure_rs_vand", - test_decode_with_missing_multi_data, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_jerasure_rs_vand", - test_decode_with_missing_multi_parity, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_jerasure_rs_vand", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_jerasure_rs_vand", - test_simple_reconstruct, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_jerasure_rs_vand", - test_fragments_needed, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_jerasure_rs_vand", - test_get_fragment_metadata, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_jerasure_rs_vand_crc32", - test_get_fragment_metadata, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_JERASURE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_simple_encode_decode_over32_jerasure_rs_vand", - test_simple_encode_decode_over32, - EC_BACKENDS_MAX, 0, // NB: this is hardcoded to use jerasure RS vand - .skip = false}, + TEST_SUITE(EC_BACKEND_JERASURE_RS_VAND), + TEST(test_jerasure_rs_vand_simple_encode_decode_over32, EC_BACKENDS_MAX, 0), // Jerasure RS Cauchy backend tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"simple_encode_jerasure_rs_cauchy", - test_simple_encode_decode, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_jerasure_rs_cauchy", - test_decode_with_missing_data, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_jerasure_rs_cauchy", - test_decode_with_missing_multi_data, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_jerasure_rs_cauchy", - test_decode_with_missing_multi_parity, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_parity_jerasure_rs_cauchy", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_jerasure_rs_cauchy", - test_simple_reconstruct, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_jerasure_rs_cauchy", - test_fragments_needed, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_jerasure_rs_cauchy", - test_get_fragment_metadata, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_jerasure_rs_cauchy_crc32", - test_get_fragment_metadata, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_jerasure_rs_cauchy_init_failure", - test_jerasure_rs_cauchy_init_failure, - EC_BACKENDS_MAX, 0, - .skip = false}, + TEST_SUITE(EC_BACKEND_JERASURE_RS_CAUCHY), + TEST(test_jerasure_rs_cauchy_init_failure, EC_BACKENDS_MAX, 0), // ISA-L rs_vand tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_encode_isa_l", - test_simple_encode_decode, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_isa_l", - test_decode_with_missing_data, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_isa_l", - test_decode_with_missing_multi_data, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_isa_l", - test_decode_with_missing_multi_parity, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_isa_l", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_isa_l", - test_simple_reconstruct, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_isa_l", - test_fragments_needed, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_isa_l", - test_get_fragment_metadata, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_isa_l_rs_vand_decode_reconstruct_specific_error_case", - test_isa_l_rs_vand_decode_reconstruct_specific_error_case, - EC_BACKENDS_MAX, 0, // note this test is using ISA-L in hard coded - .skip = false}, + TEST_SUITE(EC_BACKEND_ISA_L_RS_VAND), + TEST(test_isa_l_rs_vand_decode_reconstruct_specific_error_case, EC_BACKENDS_MAX, 0), // ISA-L rs cauchy tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"simple_encode_isa_l", - test_simple_encode_decode, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_isa_l", - test_decode_with_missing_data, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_isa_l", - test_decode_with_missing_multi_data, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_isa_l", - test_decode_with_missing_multi_parity, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_isa_l", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_isa_l", - test_simple_reconstruct, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_isa_l", - test_fragments_needed, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_isa_l", - test_get_fragment_metadata, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32, - .skip = false}, + TEST_SUITE(EC_BACKEND_ISA_L_RS_CAUCHY), // shss tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"simple_encode_shss", - test_simple_encode_decode, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_shss", - test_decode_with_missing_data, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_shss", - test_decode_with_missing_multi_data, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_shss", - test_decode_with_missing_multi_parity, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_shss", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_shss", - test_simple_reconstruct, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_shss", - test_fragments_needed, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_shss", - test_get_fragment_metadata, - EC_BACKEND_SHSS, CHKSUM_NONE, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_SHSS, CHKSUM_CRC32, - .skip = false}, + TEST_SUITE(EC_BACKEND_SHSS), // Internal RS Vand backend tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_encode_liberasurecode_rs_vand", - test_simple_encode_decode, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_liberasurecode_rs_vand", - test_decode_with_missing_data, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_liberasurecode_rs_vand", - test_decode_with_missing_multi_data, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_liberasurecode_rs_vand", - test_decode_with_missing_multi_parity, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_liberasurecode_rs_vand", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_liberasurecode_rs_vand", - test_simple_reconstruct, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_liberasurecode_rs_vand", - test_fragments_needed, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_liberasurecode_rs_vand", - test_get_fragment_metadata, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_liberasurecode_rs_vand_crc32", - test_get_fragment_metadata, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_LIBERASURECODE_RS_VAND, CHKSUM_CRC32, - .skip = false}, + TEST_SUITE(EC_BACKEND_LIBERASURECODE_RS_VAND), // libphazr backend tests - {"create_and_destroy_backend", - test_create_and_destroy_backend, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"simple_encode_libphazr", - test_simple_encode_decode, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_data_libphazr", - test_decode_with_missing_data, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_parity_libphazr", - test_decode_with_missing_parity, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_data_libphazr", - test_decode_with_missing_multi_data, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"decode_with_missing_multi_parity_libphazr", - test_decode_with_missing_multi_parity, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"test_decode_with_missing_multi_data_parity_libphazr", - test_decode_with_missing_multi_data_parity, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"simple_reconstruct_libphazr", - test_simple_reconstruct, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"test_fragments_needed_libphazr", - test_fragments_needed, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_libphazr", - test_get_fragment_metadata, - EC_BACKEND_LIBPHAZR, CHKSUM_NONE, - .skip = false}, - {"test_get_fragment_metadata_libphazr_crc32", - test_get_fragment_metadata, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata", - test_verify_stripe_metadata, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_libec_mismatch", - test_verify_stripe_metadata_libec_mismatch, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_magic_mismatch", - test_verify_stripe_metadata_magic_mismatch, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_id_mismatch", - test_verify_stripe_metadata_be_id_mismatch, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_be_ver_mismatch", - test_verify_stripe_metadata_be_ver_mismatch, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, - {"test_verify_stripe_metadata_frag_idx_invalid", - test_verify_stripe_metadata_frag_idx_invalid, - EC_BACKEND_LIBPHAZR, CHKSUM_CRC32, - .skip = false}, + TEST_SUITE(EC_BACKEND_LIBPHAZR), { NULL, NULL, 0, 0, false }, }; |