summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-05-10 15:19:35 +0000
committerGerrit Code Review <review@openstack.org>2017-05-10 15:19:35 +0000
commit345f1a93a2300b1dc7f8ec8ef0fabd24615d82b5 (patch)
tree6cbbccceea9cfb67ecd1af4b2207bab6a7823b90 /test
parent7c4ef60c9d9e69dd23e43ec59d6c03e139a32723 (diff)
parent842b4a9bd71f0ee6390bf3ace71666a9acc017fd (diff)
downloadliberasurecode-345f1a93a2300b1dc7f8ec8ef0fabd24615d82b5.tar.gz
Merge "Jerasure: Handle initialization errors correctly"
Diffstat (limited to 'test')
-rw-r--r--test/liberasurecode_test.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
index 16507ec..566bd48 100644
--- a/test/liberasurecode_test.c
+++ b/test/liberasurecode_test.c
@@ -1428,8 +1428,7 @@ static void test_decode_with_missing_multi_data_parity(
}
}
-static void test_decode_reconstruct_specific_error_case(
- const ec_backend_id_t be_id, struct ec_args *args)
+static void test_isa_l_rs_vand_decode_reconstruct_specific_error_case()
{
struct ec_args specific_1010_args = {
.k = 10,
@@ -1523,6 +1522,25 @@ static void test_decode_reconstruct_specific_error_case(
free(skips);
}
+static void test_jerasure_rs_cauchy_init_failure()
+{
+ struct ec_args bad_args = {
+ .k = 10,
+ .m = 10,
+ .w = 4,
+ };
+ // NB: (k + m) > (1 << w) => too many frags!
+
+ int desc = -1;
+ desc = liberasurecode_instance_create(
+ EC_BACKEND_JERASURE_RS_CAUCHY, &bad_args);
+ if (-EBACKENDNOTAVAIL == desc) {
+ fprintf (stderr, "Backend library not available!\n");
+ return;
+ }
+ assert(-EBACKENDINITERR == desc);
+}
+
static void test_simple_encode_decode(const ec_backend_id_t be_id,
struct ec_args *args)
{
@@ -2003,6 +2021,10 @@ struct testcase testcases[] = {
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},
// ISA-L rs_vand tests
{"create_and_destroy_backend",
test_create_and_destroy_backend,
@@ -2064,10 +2086,10 @@ struct testcase testcases[] = {
test_verify_stripe_metadata_frag_idx_invalid,
EC_BACKEND_ISA_L_RS_VAND, CHKSUM_CRC32,
.skip = false},
- {"test_isa_l_decode_reconstruct_specific_error_case",
- test_decode_reconstruct_specific_error_case,
+ {"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},
+ .skip = false},
// ISA-L rs cauchy tests
{"create_and_destroy_backend",
test_create_and_destroy_backend,