Extend selftest and fulltest with disk edge cases, polynomial checks, and comments

This commit is contained in:
Andrea Mazzoleni 2026-08-25 10:59:33 +02:00
parent f85c014c1c
commit 697ab3056e
2 changed files with 169 additions and 15 deletions

View file

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
}
}
printf("Full sanity test for the RAID Cauchy library\n\n");
printf("Full sanity test for the RAID library\n\n");
raid_init();
@ -79,6 +79,7 @@ int main(int argc, char *argv[])
else
printf("\nPlease wait...\n\n");
/* array sorting helper */
printf("Test sorting...\n");
if (raid_test_sort() != 0) {
/* LCOV_EXCL_START */
@ -86,6 +87,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* sorted array insertion helper */
printf("Test insertion...\n");
if (raid_test_insert() != 0) {
/* LCOV_EXCL_START */
@ -93,6 +95,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* permutation and combination generators */
printf("Test combinations/permutations...\n");
if (raid_test_combo() != 0) {
/* LCOV_EXCL_START */
@ -100,6 +103,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* gfni affine transformation matrices */
printf("Test GFNI affine matrices...\n");
if (raid_test_gfaffine() != 0) {
/* LCOV_EXCL_START */
@ -107,13 +111,60 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
printf("Test Vandermonde RAID parity generation with %u data disks...\n", RAID_DATA_MAX);
if (raid_test_par(RAID_MODE_VANDERMONDE_RAID, RAID_DATA_MAX, test_size) != 0) {
/* cauchy raid polynomial checks */
printf("Test Cauchy RAID polynomials...\n");
if (raid_test_poly(RAID_MODE_CAUCHY_RAID) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
/* cauchy aes polynomial checks */
printf("Test Cauchy AES polynomials...\n");
if (raid_test_poly(RAID_MODE_CAUCHY_AES) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
/* cauchy raid module self-test */
printf("Test Cauchy RAID self-test...\n");
raid_mode(RAID_MODE_CAUCHY_RAID);
if (raid_selftest() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
/* cauchy aes module self-test */
printf("Test Cauchy AES self-test...\n");
raid_mode(RAID_MODE_CAUCHY_AES);
if (raid_selftest() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
/* vandermonde raid module self-test */
printf("Test Vandermonde RAID self-test...\n");
raid_mode(RAID_MODE_VANDERMONDE_RAID);
if (raid_selftest() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
/* vandermonde raid parity generation across all disk counts from 1 to maximum */
printf("Test Vandermonde RAID parity generation with 1-%u data disks...\n", RAID_DATA_MAX);
for (int i = 1; i <= RAID_DATA_MAX; ++i) {
if (raid_test_par(RAID_MODE_VANDERMONDE_RAID, i, test_size) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
}
/* cauchy raid parity generation across all disk counts from 1 to maximum */
printf("Test Cauchy RAID parity generation with 1-%u data disks...\n", RAID_DATA_MAX);
for (int i = 1; i <= RAID_DATA_MAX; ++i) {
if (raid_test_par(RAID_MODE_CAUCHY_RAID, i, test_size) != 0) {
@ -122,6 +173,8 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
}
/* cauchy aes parity generation across all disk counts from 1 to maximum */
printf("Test Cauchy AES parity generation with 1-%u data disks...\n", RAID_DATA_MAX);
for (int i = 1; i <= RAID_DATA_MAX; ++i) {
if (raid_test_par(RAID_MODE_CAUCHY_AES, i, test_size) != 0) {
@ -131,6 +184,7 @@ int main(int argc, char *argv[])
}
}
/* vandermonde raid tail recovery across all data disk counts from 1 to maximum */
printf("Test Vandermonde RAID tail recovering with 1-%u data disks...\n", RAID_DATA_MAX);
if (raid_test_tail(RAID_MODE_VANDERMONDE_RAID, RAID_DATA_MAX, test_size) != 0) {
/* LCOV_EXCL_START */
@ -138,6 +192,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* cauchy raid tail recovery across all data disk counts from 1 to maximum */
printf("Test Cauchy RAID tail recovering with 1-%u data disks...\n", RAID_DATA_MAX);
if (raid_test_tail(RAID_MODE_CAUCHY_RAID, RAID_DATA_MAX, test_size) != 0) {
/* LCOV_EXCL_START */
@ -145,6 +200,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* cauchy aes tail recovery across all data disk counts from 1 to maximum */
printf("Test Cauchy AES tail recovering with 1-%u data disks...\n", RAID_DATA_MAX);
if (raid_test_tail(RAID_MODE_CAUCHY_AES, RAID_DATA_MAX, test_size) != 0) {
/* LCOV_EXCL_START */
@ -152,6 +208,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* vandermonde raid recovery with all combinations of data disks and 3 parity blocks */
printf("Test Vandermonde RAID recovering with all combinations of %u data and 3 parity blocks...\n", test_count);
if (raid_test_rec(RAID_MODE_VANDERMONDE_RAID, test_count, test_size) != 0) {
/* LCOV_EXCL_START */
@ -159,6 +216,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* cauchy raid recovery with all combinations of data disks and 6 parity blocks */
printf("Test Cauchy RAID recovering with all combinations of %u data and 6 parity blocks...\n", test_count);
if (raid_test_rec(RAID_MODE_CAUCHY_RAID, test_count, test_size) != 0) {
/* LCOV_EXCL_START */
@ -166,6 +224,7 @@ int main(int argc, char *argv[])
/* LCOV_EXCL_STOP */
}
/* cauchy aes recovery with all combinations of data disks and 6 parity blocks */
printf("Test Cauchy AES recovering with all combinations of %u data and 6 parity blocks...\n", test_count);
if (raid_test_rec(RAID_MODE_CAUCHY_AES, test_count, test_size) != 0) {
/* LCOV_EXCL_START */