From 290ecfd2f9524774cb90d8ef3cf2cc2209b24794 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Wed, 28 Jun 2023 20:13:49 -0400 Subject: [PATCH] common: remove libpmemblk tests and examples --- ChangeLog | 2 +- src/examples/Makefile | 2 +- src/examples/README | 4 - src/examples/libpmemblk/.gitignore | 1 - src/examples/libpmemblk/Makefile | 19 -- src/examples/libpmemblk/README | 21 -- src/examples/libpmemblk/assetdb/.gitignore | 4 - src/examples/libpmemblk/assetdb/Makefile | 26 -- src/examples/libpmemblk/assetdb/README | 45 --- src/examples/libpmemblk/assetdb/asset.h | 14 - .../libpmemblk/assetdb/asset_checkin.c | 69 ----- .../libpmemblk/assetdb/asset_checkout.c | 76 ----- src/examples/libpmemblk/assetdb/asset_list.c | 69 ----- src/examples/libpmemblk/assetdb/asset_load.c | 97 ------ src/examples/libpmemblk/manpage.c | 68 ----- src/test/Makefile | 18 +- src/test/Makefile.inc | 12 +- src/test/blk_include/.gitignore | 1 - src/test/blk_include/Makefile | 17 -- src/test/blk_include/blk_include.c | 16 - src/test/blk_nblock/.gitignore | 1 - src/test/blk_nblock/Makefile | 17 -- src/test/blk_nblock/README | 13 - src/test/blk_nblock/TEST0 | 153 ---------- src/test/blk_nblock/TEST1 | 86 ------ src/test/blk_nblock/TEST2 | 28 -- src/test/blk_nblock/TEST3 | 157 ---------- src/test/blk_nblock/TEST4 | 90 ------ src/test/blk_nblock/blk_nblock.c | 57 ---- src/test/blk_nblock/out0.log.match | 41 --- src/test/blk_nblock/out1.log.match | 22 -- src/test/blk_nblock/out2.log.match | 7 - src/test/blk_nblock/out3.log.match | 41 --- src/test/blk_nblock/out4.log.match | 22 -- src/test/blk_non_zero/.gitignore | 1 - src/test/blk_non_zero/Makefile | 19 -- src/test/blk_non_zero/README | 22 -- src/test/blk_non_zero/TEST0 | 66 ---- src/test/blk_non_zero/TEST1 | 59 ---- src/test/blk_non_zero/TEST10 | 62 ---- src/test/blk_non_zero/TEST11 | 68 ----- src/test/blk_non_zero/TEST12 | 61 ---- src/test/blk_non_zero/TEST13 | 64 ---- src/test/blk_non_zero/TEST14 | 66 ---- src/test/blk_non_zero/TEST15 | 66 ---- src/test/blk_non_zero/TEST16 | 37 --- src/test/blk_non_zero/TEST17 | 33 -- src/test/blk_non_zero/TEST18 | 38 --- src/test/blk_non_zero/TEST19 | 38 --- src/test/blk_non_zero/TEST2 | 62 ---- src/test/blk_non_zero/TEST3 | 64 ---- src/test/blk_non_zero/TEST4 | 64 ---- src/test/blk_non_zero/TEST5 | 33 -- src/test/blk_non_zero/TEST6 | 29 -- src/test/blk_non_zero/TEST7 | 34 --- src/test/blk_non_zero/TEST8 | 34 --- src/test/blk_non_zero/TEST9 | 63 ---- src/test/blk_non_zero/blk_non_zero.c | 198 ------------ src/test/blk_non_zero/out0.log.match | 14 - src/test/blk_non_zero/out1.log.match | 12 - src/test/blk_non_zero/out11.log.match | 14 - src/test/blk_non_zero/out12.log.match | 12 - src/test/blk_non_zero/out13.log.match | 13 - src/test/blk_non_zero/out14.log.match | 29 -- src/test/blk_non_zero/out15.log.match | 24 -- src/test/blk_non_zero/out16.log.match | 12 - src/test/blk_non_zero/out17.log.match | 12 - src/test/blk_non_zero/out18.log.match | 29 -- src/test/blk_non_zero/out19.log.match | 24 -- src/test/blk_non_zero/out2.log.match | 13 - src/test/blk_non_zero/out3.log.match | 29 -- src/test/blk_non_zero/out4.log.match | 24 -- src/test/blk_non_zero/out5.log.match | 12 - src/test/blk_non_zero/out6.log.match | 12 - src/test/blk_non_zero/out7.log.match | 29 -- src/test/blk_non_zero/out8.log.match | 24 -- src/test/blk_non_zero/out9.log.match | 24 -- src/test/blk_pool/.gitignore | 1 - src/test/blk_pool/Makefile | 18 -- src/test/blk_pool/README | 78 ----- src/test/blk_pool/TEST0 | 28 -- src/test/blk_pool/TEST1 | 61 ---- src/test/blk_pool/TEST10 | 63 ---- src/test/blk_pool/TEST11 | 63 ---- src/test/blk_pool/TEST12 | 25 -- src/test/blk_pool/TEST13 | 26 -- src/test/blk_pool/TEST14 | 26 -- src/test/blk_pool/TEST15 | 29 -- src/test/blk_pool/TEST16 | 29 -- src/test/blk_pool/TEST17 | 27 -- src/test/blk_pool/TEST2 | 25 -- src/test/blk_pool/TEST20 | 23 -- src/test/blk_pool/TEST21 | 57 ---- src/test/blk_pool/TEST22 | 27 -- src/test/blk_pool/TEST23 | 58 ---- src/test/blk_pool/TEST24 | 26 -- src/test/blk_pool/TEST25 | 29 -- src/test/blk_pool/TEST26 | 29 -- src/test/blk_pool/TEST27 | 25 -- src/test/blk_pool/TEST28 | 25 -- src/test/blk_pool/TEST29 | 28 -- src/test/blk_pool/TEST3 | 60 ---- src/test/blk_pool/TEST30 | 44 --- src/test/blk_pool/TEST31 | 25 -- src/test/blk_pool/TEST32 | 27 -- src/test/blk_pool/TEST33 | 37 --- src/test/blk_pool/TEST34 | 32 -- src/test/blk_pool/TEST35 | 63 ---- src/test/blk_pool/TEST36 | 64 ---- src/test/blk_pool/TEST37 | 30 -- src/test/blk_pool/TEST38 | 33 -- src/test/blk_pool/TEST39 | 31 -- src/test/blk_pool/TEST4 | 28 -- src/test/blk_pool/TEST40 | 41 --- src/test/blk_pool/TEST5 | 26 -- src/test/blk_pool/TEST6 | 29 -- src/test/blk_pool/TEST7 | 61 ---- src/test/blk_pool/TEST8 | 62 ---- src/test/blk_pool/TEST9 | 25 -- src/test/blk_pool/blk_pool.c | 110 ------- src/test/blk_pool/out0.log.match | 4 - src/test/blk_pool/out1.log.match | 4 - src/test/blk_pool/out10.log.match | 4 - src/test/blk_pool/out11.log.match | 4 - src/test/blk_pool/out12.log.match | 4 - src/test/blk_pool/out13.log.match | 4 - src/test/blk_pool/out14.log.match | 4 - src/test/blk_pool/out15.log.match | 4 - src/test/blk_pool/out16.log.match | 4 - src/test/blk_pool/out17.log.match | 4 - src/test/blk_pool/out2.log.match | 4 - src/test/blk_pool/out20.log.match | 4 - src/test/blk_pool/out21.log.match | 4 - src/test/blk_pool/out22.log.match | 4 - src/test/blk_pool/out23.log.match | 4 - src/test/blk_pool/out24.log.match | 4 - src/test/blk_pool/out25.log.match | 4 - src/test/blk_pool/out26.log.match | 4 - src/test/blk_pool/out27.log.match | 4 - src/test/blk_pool/out28.log.match | 4 - src/test/blk_pool/out29.log.match | 4 - src/test/blk_pool/out3.log.match | 4 - src/test/blk_pool/out30.log.match | 4 - src/test/blk_pool/out31.log.match | 4 - src/test/blk_pool/out32.log.match | 4 - src/test/blk_pool/out33.log.match | 4 - src/test/blk_pool/out34.log.match | 4 - src/test/blk_pool/out35.log.match | 4 - src/test/blk_pool/out36.log.match | 4 - src/test/blk_pool/out37.log.match | 4 - src/test/blk_pool/out38.log.match | 4 - src/test/blk_pool/out39.log.match | 4 - src/test/blk_pool/out4.log.match | 4 - src/test/blk_pool/out40.log.match | 4 - src/test/blk_pool/out5.log.match | 4 - src/test/blk_pool/out6.log.match | 4 - src/test/blk_pool/out7.log.match | 4 - src/test/blk_pool/out8.log.match | 4 - src/test/blk_pool/out9.log.match | 4 - src/test/blk_pool_lock/.gitignore | 1 - src/test/blk_pool_lock/Makefile | 17 -- src/test/blk_pool_lock/TEST0 | 18 -- src/test/blk_pool_lock/blk_pool_lock.c | 98 ------ src/test/blk_recovery/.gitignore | 1 - src/test/blk_recovery/Makefile | 18 -- src/test/blk_recovery/README | 23 -- src/test/blk_recovery/TEST0 | 36 --- src/test/blk_recovery/blk_recovery.c | 149 --------- src/test/blk_recovery/check0.log.match | 4 - src/test/blk_rw/.gitignore | 1 - src/test/blk_rw/Makefile | 17 -- src/test/blk_rw/README | 19 -- src/test/blk_rw/TEST0 | 66 ---- src/test/blk_rw/TEST1 | 37 --- src/test/blk_rw/TEST10 | 26 -- src/test/blk_rw/TEST11 | 29 -- src/test/blk_rw/TEST12 | 28 -- src/test/blk_rw/TEST13 | 28 -- src/test/blk_rw/TEST14 | 68 ----- src/test/blk_rw/TEST15 | 41 --- src/test/blk_rw/TEST16 | 41 --- src/test/blk_rw/TEST17 | 32 -- src/test/blk_rw/TEST18 | 34 --- src/test/blk_rw/TEST19 | 37 --- src/test/blk_rw/TEST2 | 37 --- src/test/blk_rw/TEST20 | 37 --- src/test/blk_rw/TEST21 | 37 --- src/test/blk_rw/TEST22 | 35 --- src/test/blk_rw/TEST23 | 32 -- src/test/blk_rw/TEST3 | 28 -- src/test/blk_rw/TEST4 | 30 -- src/test/blk_rw/TEST5 | 33 -- src/test/blk_rw/TEST6 | 33 -- src/test/blk_rw/TEST7 | 33 -- src/test/blk_rw/TEST8 | 31 -- src/test/blk_rw/TEST9 | 28 -- src/test/blk_rw/blk_rw.c | 138 --------- src/test/blk_rw/out0.log.match | 11 - src/test/blk_rw/out1.log.match | 11 - src/test/blk_rw/out14.log.match | 11 - src/test/blk_rw/out15.log.match | 11 - src/test/blk_rw/out16.log.match | 11 - src/test/blk_rw/out17.log.match | 11 - src/test/blk_rw/out18.log.match | 12 - src/test/blk_rw/out19.log.match | 28 -- src/test/blk_rw/out2.log.match | 11 - src/test/blk_rw/out20.log.match | 23 -- src/test/blk_rw/out22.log.match | 10 - src/test/blk_rw/out23.log.match | 8 - src/test/blk_rw/out3.log.match | 11 - src/test/blk_rw/out4.log.match | 12 - src/test/blk_rw/out5.log.match | 28 -- src/test/blk_rw/out6.log.match | 23 -- src/test/blk_rw/out7.log.match | 23 -- src/test/blk_rw/out8.log.match | 10 - src/test/blk_rw/out9.log.match | 8 - src/test/blk_rw_mt/.gitignore | 1 - src/test/blk_rw_mt/Makefile | 17 -- src/test/blk_rw_mt/README | 14 - src/test/blk_rw_mt/TEST0 | 31 -- src/test/blk_rw_mt/TEST1 | 30 -- src/test/blk_rw_mt/TEST2 | 34 --- src/test/blk_rw_mt/blk_rw_mt.c | 161 ---------- src/test/blk_rw_mt/config.sh | 13 - src/test/blk_rw_mt/out0.log.match | 4 - src/test/blk_rw_mt/out1.log.match | 4 - src/test/blk_rw_mt/out2.log.match | 4 - src/test/compat_incompat_features/Makefile | 5 - src/test/compat_incompat_features/pool_open.c | 4 +- src/test/ctl_cow/Makefile | 5 - src/test/ctl_prefault/Makefile | 5 - src/test/ctl_prefault/ctl_prefault.c | 3 +- src/test/ex_libpmemblk/Makefile | 17 -- src/test/ex_libpmemblk/README | 7 - src/test/ex_libpmemblk/TEST0 | 64 ---- src/test/ex_libpmemblk/asset_list.txt | 4 - src/test/ex_libpmemblk/out0.log.match | 50 --- src/test/libpmempool_api/libpmempool_test.c | 4 +- src/test/libpmempool_backup/common.sh | 8 +- src/test/libpmempool_backup/out0.log.match | 24 -- src/test/libpmempool_backup/out1.log.match | 6 - src/test/libpmempool_backup/out2.log.match | 6 - src/test/libpmempool_backup/out3.log.match | 6 - src/test/libpmempool_backup/out4.log.match | 6 - src/test/libpmempool_backup/out5.log.match | 6 - src/test/libpmempool_backup/out6.log.match | 48 --- src/test/libpmempool_backup/out7.log.match | 20 -- src/test/libpmempool_include/Makefile | 2 +- src/test/out_err_mt/Makefile | 5 - src/test/pmempool_dump/TEST3 | 29 -- src/test/pmempool_dump/TEST6 | 32 -- src/test/pmempool_dump/out3.log.match | 2 - src/test/pmempool_dump/out6.log.match | 5 - src/test/scope/TESTS.py | 5 - src/test/scope/out4.log.match | 18 -- src/test/set_funcs/Makefile | 5 - src/test/tools/pmemdetect/Makefile | 3 +- src/test/tools/pmemspoil/README | 1 - src/test/tools/pmemspoil/spoil.c | 288 ------------------ src/test/tools/pmemwrite/Makefile | 4 +- src/test/tools/pmemwrite/write.c | 94 ------ src/test/traces_pmem/Makefile | 5 - src/test/unittest/consts.py | 2 +- src/test/unittest/unittest.h | 1 - src/test/unittest/unittest.sh | 3 - 265 files changed, 18 insertions(+), 7540 deletions(-) delete mode 100644 src/examples/libpmemblk/.gitignore delete mode 100644 src/examples/libpmemblk/Makefile delete mode 100644 src/examples/libpmemblk/README delete mode 100644 src/examples/libpmemblk/assetdb/.gitignore delete mode 100644 src/examples/libpmemblk/assetdb/Makefile delete mode 100644 src/examples/libpmemblk/assetdb/README delete mode 100644 src/examples/libpmemblk/assetdb/asset.h delete mode 100644 src/examples/libpmemblk/assetdb/asset_checkin.c delete mode 100644 src/examples/libpmemblk/assetdb/asset_checkout.c delete mode 100644 src/examples/libpmemblk/assetdb/asset_list.c delete mode 100644 src/examples/libpmemblk/assetdb/asset_load.c delete mode 100644 src/examples/libpmemblk/manpage.c delete mode 100644 src/test/blk_include/.gitignore delete mode 100644 src/test/blk_include/Makefile delete mode 100644 src/test/blk_include/blk_include.c delete mode 100644 src/test/blk_nblock/.gitignore delete mode 100644 src/test/blk_nblock/Makefile delete mode 100644 src/test/blk_nblock/README delete mode 100755 src/test/blk_nblock/TEST0 delete mode 100755 src/test/blk_nblock/TEST1 delete mode 100755 src/test/blk_nblock/TEST2 delete mode 100755 src/test/blk_nblock/TEST3 delete mode 100755 src/test/blk_nblock/TEST4 delete mode 100644 src/test/blk_nblock/blk_nblock.c delete mode 100644 src/test/blk_nblock/out0.log.match delete mode 100644 src/test/blk_nblock/out1.log.match delete mode 100644 src/test/blk_nblock/out2.log.match delete mode 100644 src/test/blk_nblock/out3.log.match delete mode 100644 src/test/blk_nblock/out4.log.match delete mode 100644 src/test/blk_non_zero/.gitignore delete mode 100644 src/test/blk_non_zero/Makefile delete mode 100644 src/test/blk_non_zero/README delete mode 100755 src/test/blk_non_zero/TEST0 delete mode 100755 src/test/blk_non_zero/TEST1 delete mode 100755 src/test/blk_non_zero/TEST10 delete mode 100755 src/test/blk_non_zero/TEST11 delete mode 100755 src/test/blk_non_zero/TEST12 delete mode 100755 src/test/blk_non_zero/TEST13 delete mode 100755 src/test/blk_non_zero/TEST14 delete mode 100755 src/test/blk_non_zero/TEST15 delete mode 100755 src/test/blk_non_zero/TEST16 delete mode 100755 src/test/blk_non_zero/TEST17 delete mode 100755 src/test/blk_non_zero/TEST18 delete mode 100755 src/test/blk_non_zero/TEST19 delete mode 100755 src/test/blk_non_zero/TEST2 delete mode 100755 src/test/blk_non_zero/TEST3 delete mode 100755 src/test/blk_non_zero/TEST4 delete mode 100755 src/test/blk_non_zero/TEST5 delete mode 100755 src/test/blk_non_zero/TEST6 delete mode 100755 src/test/blk_non_zero/TEST7 delete mode 100755 src/test/blk_non_zero/TEST8 delete mode 100755 src/test/blk_non_zero/TEST9 delete mode 100644 src/test/blk_non_zero/blk_non_zero.c delete mode 100644 src/test/blk_non_zero/out0.log.match delete mode 100644 src/test/blk_non_zero/out1.log.match delete mode 100644 src/test/blk_non_zero/out11.log.match delete mode 100644 src/test/blk_non_zero/out12.log.match delete mode 100644 src/test/blk_non_zero/out13.log.match delete mode 100644 src/test/blk_non_zero/out14.log.match delete mode 100644 src/test/blk_non_zero/out15.log.match delete mode 100644 src/test/blk_non_zero/out16.log.match delete mode 100644 src/test/blk_non_zero/out17.log.match delete mode 100644 src/test/blk_non_zero/out18.log.match delete mode 100644 src/test/blk_non_zero/out19.log.match delete mode 100644 src/test/blk_non_zero/out2.log.match delete mode 100644 src/test/blk_non_zero/out3.log.match delete mode 100644 src/test/blk_non_zero/out4.log.match delete mode 100644 src/test/blk_non_zero/out5.log.match delete mode 100644 src/test/blk_non_zero/out6.log.match delete mode 100644 src/test/blk_non_zero/out7.log.match delete mode 100644 src/test/blk_non_zero/out8.log.match delete mode 100644 src/test/blk_non_zero/out9.log.match delete mode 100644 src/test/blk_pool/.gitignore delete mode 100644 src/test/blk_pool/Makefile delete mode 100644 src/test/blk_pool/README delete mode 100755 src/test/blk_pool/TEST0 delete mode 100755 src/test/blk_pool/TEST1 delete mode 100755 src/test/blk_pool/TEST10 delete mode 100755 src/test/blk_pool/TEST11 delete mode 100755 src/test/blk_pool/TEST12 delete mode 100755 src/test/blk_pool/TEST13 delete mode 100755 src/test/blk_pool/TEST14 delete mode 100755 src/test/blk_pool/TEST15 delete mode 100755 src/test/blk_pool/TEST16 delete mode 100755 src/test/blk_pool/TEST17 delete mode 100755 src/test/blk_pool/TEST2 delete mode 100755 src/test/blk_pool/TEST20 delete mode 100755 src/test/blk_pool/TEST21 delete mode 100755 src/test/blk_pool/TEST22 delete mode 100755 src/test/blk_pool/TEST23 delete mode 100755 src/test/blk_pool/TEST24 delete mode 100755 src/test/blk_pool/TEST25 delete mode 100755 src/test/blk_pool/TEST26 delete mode 100755 src/test/blk_pool/TEST27 delete mode 100755 src/test/blk_pool/TEST28 delete mode 100755 src/test/blk_pool/TEST29 delete mode 100755 src/test/blk_pool/TEST3 delete mode 100755 src/test/blk_pool/TEST30 delete mode 100755 src/test/blk_pool/TEST31 delete mode 100755 src/test/blk_pool/TEST32 delete mode 100755 src/test/blk_pool/TEST33 delete mode 100755 src/test/blk_pool/TEST34 delete mode 100755 src/test/blk_pool/TEST35 delete mode 100755 src/test/blk_pool/TEST36 delete mode 100755 src/test/blk_pool/TEST37 delete mode 100755 src/test/blk_pool/TEST38 delete mode 100755 src/test/blk_pool/TEST39 delete mode 100755 src/test/blk_pool/TEST4 delete mode 100755 src/test/blk_pool/TEST40 delete mode 100755 src/test/blk_pool/TEST5 delete mode 100755 src/test/blk_pool/TEST6 delete mode 100755 src/test/blk_pool/TEST7 delete mode 100755 src/test/blk_pool/TEST8 delete mode 100755 src/test/blk_pool/TEST9 delete mode 100644 src/test/blk_pool/blk_pool.c delete mode 100644 src/test/blk_pool/out0.log.match delete mode 100644 src/test/blk_pool/out1.log.match delete mode 100644 src/test/blk_pool/out10.log.match delete mode 100644 src/test/blk_pool/out11.log.match delete mode 100644 src/test/blk_pool/out12.log.match delete mode 100644 src/test/blk_pool/out13.log.match delete mode 100644 src/test/blk_pool/out14.log.match delete mode 100644 src/test/blk_pool/out15.log.match delete mode 100644 src/test/blk_pool/out16.log.match delete mode 100644 src/test/blk_pool/out17.log.match delete mode 100644 src/test/blk_pool/out2.log.match delete mode 100644 src/test/blk_pool/out20.log.match delete mode 100644 src/test/blk_pool/out21.log.match delete mode 100644 src/test/blk_pool/out22.log.match delete mode 100644 src/test/blk_pool/out23.log.match delete mode 100644 src/test/blk_pool/out24.log.match delete mode 100644 src/test/blk_pool/out25.log.match delete mode 100644 src/test/blk_pool/out26.log.match delete mode 100644 src/test/blk_pool/out27.log.match delete mode 100644 src/test/blk_pool/out28.log.match delete mode 100644 src/test/blk_pool/out29.log.match delete mode 100644 src/test/blk_pool/out3.log.match delete mode 100644 src/test/blk_pool/out30.log.match delete mode 100644 src/test/blk_pool/out31.log.match delete mode 100644 src/test/blk_pool/out32.log.match delete mode 100644 src/test/blk_pool/out33.log.match delete mode 100644 src/test/blk_pool/out34.log.match delete mode 100644 src/test/blk_pool/out35.log.match delete mode 100644 src/test/blk_pool/out36.log.match delete mode 100644 src/test/blk_pool/out37.log.match delete mode 100644 src/test/blk_pool/out38.log.match delete mode 100644 src/test/blk_pool/out39.log.match delete mode 100644 src/test/blk_pool/out4.log.match delete mode 100644 src/test/blk_pool/out40.log.match delete mode 100644 src/test/blk_pool/out5.log.match delete mode 100644 src/test/blk_pool/out6.log.match delete mode 100644 src/test/blk_pool/out7.log.match delete mode 100644 src/test/blk_pool/out8.log.match delete mode 100644 src/test/blk_pool/out9.log.match delete mode 100644 src/test/blk_pool_lock/.gitignore delete mode 100644 src/test/blk_pool_lock/Makefile delete mode 100755 src/test/blk_pool_lock/TEST0 delete mode 100644 src/test/blk_pool_lock/blk_pool_lock.c delete mode 100644 src/test/blk_recovery/.gitignore delete mode 100644 src/test/blk_recovery/Makefile delete mode 100644 src/test/blk_recovery/README delete mode 100755 src/test/blk_recovery/TEST0 delete mode 100644 src/test/blk_recovery/blk_recovery.c delete mode 100644 src/test/blk_recovery/check0.log.match delete mode 100644 src/test/blk_rw/.gitignore delete mode 100644 src/test/blk_rw/Makefile delete mode 100644 src/test/blk_rw/README delete mode 100755 src/test/blk_rw/TEST0 delete mode 100755 src/test/blk_rw/TEST1 delete mode 100755 src/test/blk_rw/TEST10 delete mode 100755 src/test/blk_rw/TEST11 delete mode 100755 src/test/blk_rw/TEST12 delete mode 100755 src/test/blk_rw/TEST13 delete mode 100755 src/test/blk_rw/TEST14 delete mode 100755 src/test/blk_rw/TEST15 delete mode 100755 src/test/blk_rw/TEST16 delete mode 100755 src/test/blk_rw/TEST17 delete mode 100755 src/test/blk_rw/TEST18 delete mode 100755 src/test/blk_rw/TEST19 delete mode 100755 src/test/blk_rw/TEST2 delete mode 100755 src/test/blk_rw/TEST20 delete mode 100755 src/test/blk_rw/TEST21 delete mode 100755 src/test/blk_rw/TEST22 delete mode 100755 src/test/blk_rw/TEST23 delete mode 100755 src/test/blk_rw/TEST3 delete mode 100755 src/test/blk_rw/TEST4 delete mode 100755 src/test/blk_rw/TEST5 delete mode 100755 src/test/blk_rw/TEST6 delete mode 100755 src/test/blk_rw/TEST7 delete mode 100755 src/test/blk_rw/TEST8 delete mode 100755 src/test/blk_rw/TEST9 delete mode 100644 src/test/blk_rw/blk_rw.c delete mode 100644 src/test/blk_rw/out0.log.match delete mode 100644 src/test/blk_rw/out1.log.match delete mode 100644 src/test/blk_rw/out14.log.match delete mode 100644 src/test/blk_rw/out15.log.match delete mode 100644 src/test/blk_rw/out16.log.match delete mode 100644 src/test/blk_rw/out17.log.match delete mode 100644 src/test/blk_rw/out18.log.match delete mode 100644 src/test/blk_rw/out19.log.match delete mode 100644 src/test/blk_rw/out2.log.match delete mode 100644 src/test/blk_rw/out20.log.match delete mode 100644 src/test/blk_rw/out22.log.match delete mode 100644 src/test/blk_rw/out23.log.match delete mode 100644 src/test/blk_rw/out3.log.match delete mode 100644 src/test/blk_rw/out4.log.match delete mode 100644 src/test/blk_rw/out5.log.match delete mode 100644 src/test/blk_rw/out6.log.match delete mode 100644 src/test/blk_rw/out7.log.match delete mode 100644 src/test/blk_rw/out8.log.match delete mode 100644 src/test/blk_rw/out9.log.match delete mode 100644 src/test/blk_rw_mt/.gitignore delete mode 100644 src/test/blk_rw_mt/Makefile delete mode 100644 src/test/blk_rw_mt/README delete mode 100755 src/test/blk_rw_mt/TEST0 delete mode 100755 src/test/blk_rw_mt/TEST1 delete mode 100755 src/test/blk_rw_mt/TEST2 delete mode 100644 src/test/blk_rw_mt/blk_rw_mt.c delete mode 100644 src/test/blk_rw_mt/config.sh delete mode 100644 src/test/blk_rw_mt/out0.log.match delete mode 100644 src/test/blk_rw_mt/out1.log.match delete mode 100644 src/test/blk_rw_mt/out2.log.match delete mode 100644 src/test/ex_libpmemblk/Makefile delete mode 100644 src/test/ex_libpmemblk/README delete mode 100755 src/test/ex_libpmemblk/TEST0 delete mode 100644 src/test/ex_libpmemblk/asset_list.txt delete mode 100644 src/test/ex_libpmemblk/out0.log.match delete mode 100755 src/test/pmempool_dump/TEST3 delete mode 100755 src/test/pmempool_dump/TEST6 delete mode 100644 src/test/pmempool_dump/out3.log.match delete mode 100644 src/test/pmempool_dump/out6.log.match delete mode 100644 src/test/scope/out4.log.match diff --git a/ChangeLog b/ChangeLog index 27fbd0c7fed..0ac2d2b9b26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ - removes btt specific test and related btt tests tools - removes btt support from pmemspoil - removes libpmemlog tests and examples - - removes libpmemblk tests (partially) + - removes libpmemblk tests and examples - ... Wed May 31 2023 Oksana Sałyk diff --git a/src/examples/Makefile b/src/examples/Makefile index d4eab42e9ca..92676444cc5 100644 --- a/src/examples/Makefile +++ b/src/examples/Makefile @@ -7,7 +7,7 @@ include ../common.inc -DIRS = libpmem libpmemblk libpmemobj libpmempool pmreorder libpmem2 +DIRS = libpmem libpmemobj libpmempool pmreorder libpmem2 include Makefile.inc diff --git a/src/examples/README b/src/examples/README index 6fb4c5c1359..cf537d8f204 100644 --- a/src/examples/README +++ b/src/examples/README @@ -18,10 +18,6 @@ libpmem(7) -- low-level persistent memory support Example programs are in the libpmem directory. More documentation: https://pmem.io/pmdk/libpmem -libpmemblk(7) -- pmem-resident arrays of blocks - Example programs are in the libpmemblk directory. - More documentation: https://pmem.io/pmdk/libpmemblk - libpmemlog(7) -- pmem-resident log files Example programs are in the libpmemlog directory. More documentation: https://pmem.io/pmdk/libpmemlog diff --git a/src/examples/libpmemblk/.gitignore b/src/examples/libpmemblk/.gitignore deleted file mode 100644 index 112ed861024..00000000000 --- a/src/examples/libpmemblk/.gitignore +++ /dev/null @@ -1 +0,0 @@ -manpage diff --git a/src/examples/libpmemblk/Makefile b/src/examples/libpmemblk/Makefile deleted file mode 100644 index ad8b6f2b2b6..00000000000 --- a/src/examples/libpmemblk/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# examples/libpmemblk/Makefile -- build the libpmemblk examples -# -PROGS = manpage -DIRS = assetdb - -LIBS = -lpmemblk -lpmem -pthread - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - -manpage: manpage.o diff --git a/src/examples/libpmemblk/README b/src/examples/libpmemblk/README deleted file mode 100644 index aed37233cf9..00000000000 --- a/src/examples/libpmemblk/README +++ /dev/null @@ -1,21 +0,0 @@ -Persistent Memory Development Kit - -This is examples/libpmemblk/README. - -This directory contains examples for libpmemblk, the library providing -pmem-resident arrays of blocks. Some of these examples are explained -in more detail here: https://pmem.io/pmdk/libpmemblk - -manpage.c is the example used in the libpmemblk man page. - -assetdb contains a simple database built using libpmemblk. - -To build these examples: - make - -These examples can be built against an installed system using: - make LIBDIR=/usr/lib INCDIR=/usr/include - -If you're looking for documentation to get you started using PMDK, -start here: https://pmem.io/pmdk and follow the links to examples and -man pages. Developers new to PMDK are probably looking for libpmemobj. diff --git a/src/examples/libpmemblk/assetdb/.gitignore b/src/examples/libpmemblk/assetdb/.gitignore deleted file mode 100644 index e17d8d8d4fc..00000000000 --- a/src/examples/libpmemblk/assetdb/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -asset_load -asset_list -asset_checkout -asset_checkin diff --git a/src/examples/libpmemblk/assetdb/Makefile b/src/examples/libpmemblk/assetdb/Makefile deleted file mode 100644 index d2b5a765ad0..00000000000 --- a/src/examples/libpmemblk/assetdb/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# examples/libpmemblk/assetdb/Makefile -- build the assetdb example -# -PROGS = asset_load asset_list asset_checkout asset_checkin - -LIBS = -lpmemblk -lpmem -pthread - -include ../../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - -asset_load: asset_load.o - -asset_list: asset_list.o - -asset_checkout: asset_checkout.o - -asset_checkin: asset_checkin.o - -asset_load.o asset_list.o asset_checkout.o asset_checkin.o: asset.h diff --git a/src/examples/libpmemblk/assetdb/README b/src/examples/libpmemblk/assetdb/README deleted file mode 100644 index 3d40c95e30f..00000000000 --- a/src/examples/libpmemblk/assetdb/README +++ /dev/null @@ -1,45 +0,0 @@ -Persistent Memory Development Kit - -This is examples/libpmemblk/assetdb/README. - -This example illustrates how a very simple database can be built using the -atomic arrays provided by libpmemblk. An array of records is created to -track a list of assets (like books or computers, for example). Each asset is -represented by a fixed-length record in the asset database. Since updates to -a single record are atomic, the file remains consistent even if interrupted -during an update. To run this example, follow these steps: - -0. Build the example with "make". The libraries must be built first (i.e. - by running "make" in ../../..). - -1. Create the assetdb file. This can be anywhere but the point is it - will be a much faster database file if it is created on a pmem-aware - file system. For example, if /pmem is the mount point for a - pmem-aware file system: - - $ fallocate -l 1G /pmem/assetdb - -2. Load up the assets from a list of assets, which is just a simple text - file containing asset description strings, one per line: - - $ asset_load /pmem/assetdb assetlist - -3. Print the assets using: - - $ asset_list /pmem/assetdb - -4. To mark an asset as checked out to someone: - - $ asset_checkout /pmem/assetdb asset-ID name - - The asset-ID is the ID printed by asset_list. The name may require - quotes if it contains any whitespace or special characters. - -5. To mark an asset as no longer checked out: - - $ asset_checkin /pmem/assetdb asset-ID - -As this is just an example to illustrate how pmemblk works, it may take -some trial-and-error to find the best size for the assetdb -- the file -must be large enough to hold about 512 bytes for each asset record, plus -about 1% overhead used by libpmemblk to provide the atomicity. diff --git a/src/examples/libpmemblk/assetdb/asset.h b/src/examples/libpmemblk/assetdb/asset.h deleted file mode 100644 index 311448460bd..00000000000 --- a/src/examples/libpmemblk/assetdb/asset.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ - -#define ASSET_NAME_MAX 256 -#define ASSET_USER_NAME_MAX 64 -#define ASSET_CHECKED_OUT 2 -#define ASSET_FREE 1 - -struct asset { - char name[ASSET_NAME_MAX]; - char user[ASSET_USER_NAME_MAX]; - time_t time; - int state; -}; diff --git a/src/examples/libpmemblk/assetdb/asset_checkin.c b/src/examples/libpmemblk/assetdb/asset_checkin.c deleted file mode 100644 index f143dc87e7a..00000000000 --- a/src/examples/libpmemblk/assetdb/asset_checkin.c +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * asset_checkin -- mark an asset as no longer checked out - * - * Usage: - * asset_checkin /path/to/pm-aware/file asset-ID - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "asset.h" - -int -main(int argc, char *argv[]) -{ - PMEMblkpool *pbp; - struct asset asset; - int assetid; - - if (argc < 3) { - fprintf(stderr, "usage: %s assetdb asset-ID\n", argv[0]); - exit(1); - } - - const char *path = argv[1]; - assetid = atoi(argv[2]); - assert(assetid > 0); - - /* open an array of atomically writable elements */ - if ((pbp = pmemblk_open(path, sizeof(struct asset))) == NULL) { - perror("pmemblk_open"); - exit(1); - } - - /* read a required element in */ - if (pmemblk_read(pbp, &asset, assetid) < 0) { - perror("pmemblk_read"); - exit(1); - } - - /* check if it contains any data */ - if ((asset.state != ASSET_FREE) && - (asset.state != ASSET_CHECKED_OUT)) { - fprintf(stderr, "Asset ID %d not found\n", assetid); - exit(1); - } - - /* change state to free, clear user name and timestamp */ - asset.state = ASSET_FREE; - asset.user[0] = '\0'; - asset.time = 0; - - if (pmemblk_write(pbp, &asset, assetid) < 0) { - perror("pmemblk_write"); - exit(1); - } - - pmemblk_close(pbp); - return 0; -} diff --git a/src/examples/libpmemblk/assetdb/asset_checkout.c b/src/examples/libpmemblk/assetdb/asset_checkout.c deleted file mode 100644 index ab93fcea6e6..00000000000 --- a/src/examples/libpmemblk/assetdb/asset_checkout.c +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * asset_checkout -- mark an asset as checked out to someone - * - * Usage: - * asset_checkin /path/to/pm-aware/file asset-ID name - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "asset.h" - -int -main(int argc, char *argv[]) -{ - PMEMblkpool *pbp; - struct asset asset; - int assetid; - - if (argc < 4) { - fprintf(stderr, "usage: %s assetdb asset-ID name\n", argv[0]); - exit(1); - } - - const char *path = argv[1]; - assetid = atoi(argv[2]); - assert(assetid > 0); - - /* open an array of atomically writable elements */ - if ((pbp = pmemblk_open(path, sizeof(struct asset))) == NULL) { - perror("pmemblk_open"); - exit(1); - } - - /* read a required element in */ - if (pmemblk_read(pbp, &asset, assetid) < 0) { - perror("pmemblk_read"); - exit(1); - } - - /* check if it contains any data */ - if ((asset.state != ASSET_FREE) && - (asset.state != ASSET_CHECKED_OUT)) { - fprintf(stderr, "Asset ID %d not found", assetid); - exit(1); - } - - if (asset.state == ASSET_CHECKED_OUT) { - fprintf(stderr, "Asset ID %d already checked out\n", assetid); - exit(1); - } - - /* update user name, set checked out state, and take timestamp */ - strncpy(asset.user, argv[3], ASSET_USER_NAME_MAX - 1); - asset.user[ASSET_USER_NAME_MAX - 1] = '\0'; - asset.state = ASSET_CHECKED_OUT; - time(&asset.time); - - /* put it back in the block */ - if (pmemblk_write(pbp, &asset, assetid) < 0) { - perror("pmemblk_write"); - exit(1); - } - - pmemblk_close(pbp); - return 0; -} diff --git a/src/examples/libpmemblk/assetdb/asset_list.c b/src/examples/libpmemblk/assetdb/asset_list.c deleted file mode 100644 index cd9402b5b6a..00000000000 --- a/src/examples/libpmemblk/assetdb/asset_list.c +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * asset_list -- list all assets in an assetdb file - * - * Usage: - * asset_list /path/to/pm-aware/file - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "asset.h" - -int -main(int argc, char *argv[]) -{ - PMEMblkpool *pbp; - size_t nelements; - struct asset asset; - - if (argc < 2) { - fprintf(stderr, "usage: %s assetdb\n", argv[0]); - exit(1); - } - - const char *path = argv[1]; - - /* open an array of atomically writable elements */ - if ((pbp = pmemblk_open(path, sizeof(struct asset))) == NULL) { - perror(path); - exit(1); - } - - /* how many elements do we have? */ - nelements = pmemblk_nblock(pbp); - - /* print out all the elements that contain assets data */ - for (size_t assetid = 0; assetid < nelements; ++assetid) { - if (pmemblk_read(pbp, &asset, assetid) < 0) { - perror("pmemblk_read"); - exit(1); - } - - if ((asset.state != ASSET_FREE) && - (asset.state != ASSET_CHECKED_OUT)) { - break; - } - - printf("Asset ID: %zu\n", assetid); - if (asset.state == ASSET_FREE) - printf(" State: Free\n"); - else { - printf(" State: Checked out\n"); - printf(" User: %s\n", asset.user); - printf(" Time: %s", ctime(&asset.time)); - } - printf(" Name: %s\n", asset.name); - } - - pmemblk_close(pbp); - return 0; -} diff --git a/src/examples/libpmemblk/assetdb/asset_load.c b/src/examples/libpmemblk/assetdb/asset_load.c deleted file mode 100644 index 3d26edf2e08..00000000000 --- a/src/examples/libpmemblk/assetdb/asset_load.c +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * asset_load -- given pre-allocated assetdb file, load it up with assets - * - * Usage: - * fallocate -l 1G /path/to/pm-aware/file - * asset_load /path/to/pm-aware/file asset-file - * - * The asset-file should contain the names of the assets, one per line. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "asset.h" - -int -main(int argc, char *argv[]) -{ - FILE *fp; - int len = ASSET_NAME_MAX; - PMEMblkpool *pbp; - size_t assetid = 0; - size_t nelements; - char *line; - - if (argc < 3) { - fprintf(stderr, "usage: %s assetdb assetlist\n", argv[0]); - exit(1); - } - - const char *path_pool = argv[1]; - const char *path_list = argv[2]; - - /* create pmemblk pool in existing (but as yet unmodified) file */ - pbp = pmemblk_create(path_pool, sizeof(struct asset), - 0, CREATE_MODE_RW); - - if (pbp == NULL) { - perror(path_pool); - exit(1); - } - - nelements = pmemblk_nblock(pbp); - - if ((fp = fopen(path_list, "r")) == NULL) { - perror(path_list); - exit(1); - } - - /* - * Read in all the assets from the assetfile and put them in the - * array, if a name of the asset is longer than ASSET_NAME_SIZE_MAX, - * truncate it. - */ - line = malloc(len); - if (line == NULL) { - perror("malloc"); - exit(1); - } - while (fgets(line, len, fp) != NULL) { - struct asset asset; - - if (assetid >= nelements) { - fprintf(stderr, "%s: too many assets to fit in %s " - "(only %zu assets loaded)\n", - path_list, path_pool, assetid); - exit(1); - } - - memset(&asset, '\0', sizeof(asset)); - asset.state = ASSET_FREE; - strncpy(asset.name, line, ASSET_NAME_MAX - 1); - asset.name[ASSET_NAME_MAX - 1] = '\0'; - - if (pmemblk_write(pbp, &asset, assetid) < 0) { - perror("pmemblk_write"); - exit(1); - } - - assetid++; - } - - free(line); - fclose(fp); - - pmemblk_close(pbp); - return 0; -} diff --git a/src/examples/libpmemblk/manpage.c b/src/examples/libpmemblk/manpage.c deleted file mode 100644 index aaed66d7311..00000000000 --- a/src/examples/libpmemblk/manpage.c +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2023, Intel Corporation */ - -/* - * manpage.c -- simple example for the libpmemblk man page - */ - -#include -#include -#include -#include -#include -#include -#include - -/* size of the pmemblk pool -- 1 GB */ -#define POOL_SIZE ((size_t)(1 << 30)) - -/* size of each element in the pmem pool */ -#define ELEMENT_SIZE 1024 - -int -main(int argc, char *argv[]) -{ - const char path[] = "/pmem-fs/myfile"; - PMEMblkpool *pbp; - size_t nelements; - char buf[ELEMENT_SIZE]; - - /* create the pmemblk pool or open it if it already exists */ - pbp = pmemblk_create(path, ELEMENT_SIZE, POOL_SIZE, 0666); - - if (pbp == NULL) - pbp = pmemblk_open(path, ELEMENT_SIZE); - - if (pbp == NULL) { - perror(path); - exit(1); - } - - /* how many elements fit into the file? */ - nelements = pmemblk_nblock(pbp); - printf("file holds %zu elements\n", nelements); - - /* store a block at index 5 */ - strcpy(buf, "hello, world"); - if (pmemblk_write(pbp, buf, 5) < 0) { - perror("pmemblk_write"); - exit(1); - } - - /* read the block at index 10 (reads as zeros initially) */ - if (pmemblk_read(pbp, buf, 10) < 0) { - perror("pmemblk_read"); - exit(1); - } - - /* zero out the block at index 5 */ - if (pmemblk_set_zero(pbp, 5) < 0) { - perror("pmemblk_set_zero"); - exit(1); - } - - /* ... */ - - pmemblk_close(pbp); - return 0; -} diff --git a/src/test/Makefile b/src/test/Makefile index 33caf6494f6..761cfa73f1f 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -14,16 +14,6 @@ TEST_DEPS = \ unittest\ tools -BLK_TESTS = \ - blk_include\ - blk_nblock\ - blk_non_zero\ - blk_pool\ - blk_pool_lock\ - blk_recovery\ - blk_rw\ - blk_rw_mt - OBJ_DEPS = \ obj_list @@ -227,7 +217,6 @@ PMEMPOOL_TESTS = \ EXAMPLES_TESTS = \ ex_libpmem\ ex_libpmem2\ - ex_libpmemblk\ ex_libpmemobj\ ex_linkedlist\ ex_pmreorder @@ -258,7 +247,6 @@ PMREORDER_TESTS = \ LOCAL_TESTS = \ $(OBJ_TESTS)\ - $(BLK_TESTS)\ $(OTHER_TESTS)\ $(PMEM_TESTS)\ $(PMEM2_TESTS)\ @@ -363,10 +351,6 @@ pycheck: $(TESTS) pcheck: pcheck-local-quiet @echo "No failures." -pcheck-blk: TARGET = pcheck -pcheck-blk: $(BLK_TESTS) - @echo "No failures." - pcheck-log: TARGET = pcheck pcheck-log: $(LOG_TESTS) @echo "No failures." @@ -409,7 +393,7 @@ SUPP_SYNC_FILES=$(shell echo *.supp | sed s/supp/$(SYNC_EXT)/g) cp $(shell echo $^ | cut -d" " -f1) $(DIR_SYNC) @touch $@ -.PHONY: all check clean clobber cstyle pcheck pcheck-blk pcheck-log pcheck-obj\ +.PHONY: all check clean clobber cstyle pcheck pcheck-log pcheck-obj\ pcheck-other pcheck-pmem pcheck-pmempool\ test unittest tools format pcheck-libpmempool pycheck\ pcheck-local $(TESTS_BUILD) diff --git a/src/test/Makefile.inc b/src/test/Makefile.inc index 189936ab2fa..803bcfbcd2a 100644 --- a/src/test/Makefile.inc +++ b/src/test/Makefile.inc @@ -20,7 +20,6 @@ LIBS_DIR=$(TOP)/src EXAMPLES_DIR=$(TOP)/src/examples EX_LIBPMEM=$(EXAMPLES_DIR)/libpmem EX_LIBPMEM2=$(EXAMPLES_DIR)/libpmem2 -EX_LIBPMEMBLK=$(EXAMPLES_DIR)/libpmemblk EX_LIBPMEMOBJ=$(EXAMPLES_DIR)/libpmemobj EX_PMREORDER=$(EXAMPLES_DIR)/pmreorder @@ -46,13 +45,6 @@ STATIC_NONDEBUG_LIBS += $(LIBS_DIR)/nondebug/libpmempool.a CFLAGS += -DUSE_LIBDL endif -ifeq ($(LIBPMEMBLK), y) -LIBPMEM=y -DYNAMIC_LIBS += -lpmemblk -STATIC_DEBUG_LIBS += $(LIBS_DIR)/debug/libpmemblk.a -STATIC_NONDEBUG_LIBS += $(LIBS_DIR)/nondebug/libpmemblk.a -endif - ifeq ($(LIBPMEMOBJ), y) LIBPMEM=y DYNAMIC_LIBS += -lpmemobj @@ -430,7 +422,7 @@ STATIC_DEBUG_LIBS += $(LIBS_DIR)/debug/libpmem.a STATIC_NONDEBUG_LIBS += $(LIBS_DIR)/nondebug/libpmem.a endif -ifneq ($(LIBPMEMCOMMON)$(LIBPMEM)$(LIBPMEM2)$(LIBPMEMPOOL)$(LIBPMEMBLK)$(LIBPMEMLOG)$(LIBPMEMOBJ),) +ifneq ($(LIBPMEMCOMMON)$(LIBPMEM)$(LIBPMEM2)$(LIBPMEMPOOL)$(LIBPMEMLOG)$(LIBPMEMOBJ),) LIBS += -pthread endif @@ -438,7 +430,7 @@ ifneq ($(LIBPMEMCOMMON)$(LIBPMEMPOOL)$(LIBPMEMOBJ),) LIBS += $(LIBDL) endif -ifneq ($(LIBPMEM)$(LIBPMEM2)$(LIBPMEMCOMMON)$(LIBPMEMPOOL)$(LIBPMEMBLK)$(LIBPMEMLOG)$(LIBPMEMOBJ),) +ifneq ($(LIBPMEM)$(LIBPMEM2)$(LIBPMEMCOMMON)$(LIBPMEMPOOL)$(LIBPMEMLOG)$(LIBPMEMOBJ),) CFLAGS += $(LIBNDCTL_CFLAGS) LIBS += $(LIBNDCTL_LIBS) endif diff --git a/src/test/blk_include/.gitignore b/src/test/blk_include/.gitignore deleted file mode 100644 index bf3c5f69090..00000000000 --- a/src/test/blk_include/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_include diff --git a/src/test/blk_include/Makefile b/src/test/blk_include/Makefile deleted file mode 100644 index 8278fbc4346..00000000000 --- a/src/test/blk_include/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2023, Intel Corporation - -# -# src/test/blk_include/Makefile -- compilation test for libpmemblk -# -TARGET = blk_include -OBJS = blk_include.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_include/blk_include.c b/src/test/blk_include/blk_include.c deleted file mode 100644 index 4330eda57ad..00000000000 --- a/src/test/blk_include/blk_include.c +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2016, Intel Corporation */ - -/* - * blk_include.c -- include test for libpmemblk - * - * this is only a compilation test - do not run this program - */ - -#include - -int -main(int argc, char *argv[]) -{ - return 0; -} diff --git a/src/test/blk_nblock/.gitignore b/src/test/blk_nblock/.gitignore deleted file mode 100644 index c87f12a9044..00000000000 --- a/src/test/blk_nblock/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_nblock diff --git a/src/test/blk_nblock/Makefile b/src/test/blk_nblock/Makefile deleted file mode 100644 index 070d5464467..00000000000 --- a/src/test/blk_nblock/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/blk_nblock/Makefile -- build blk_nblock unit test -# -TARGET = blk_nblock -OBJS = blk_nblock.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_nblock/README b/src/test/blk_nblock/README deleted file mode 100644 index 6440a928b26..00000000000 --- a/src/test/blk_nblock/README +++ /dev/null @@ -1,13 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_nblock/README. - -This directory contains a unit test for pmemblk_nblock(). - -The program in blk_nblock.c takes a list of block size file pairs. -For example: - - ./blk_nblock 4096:file1 - -this will call pmemblk_open() on file1 and then report what pmemblk_nblock() -reports back as the usable size. diff --git a/src/test/blk_nblock/TEST0 b/src/test/blk_nblock/TEST0 deleted file mode 100755 index 127c010405a..00000000000 --- a/src/test/blk_nblock/TEST0 +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_nblock/TEST0 -- unit test for pmemblk_nblock -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any -require_unlimited_vm -exclude_ppc64 - -# this test creates huge files -configure_valgrind force-disable -setup - -# -# Create a gajillion files, each file size created -# has six versions for the six block sizes being tested. -# Except for testfile1, since that should fail because -# it is too small. -# -# These are holey files, so they actually don't take up -# any significant space. -# -truncate -s 2M $DIR/testfile1 -truncate -s 2G $DIR/testfile2.512 -truncate -s 2G $DIR/testfile2.520 -truncate -s 2G $DIR/testfile2.528 -truncate -s 2G $DIR/testfile2.4096 -truncate -s 2G $DIR/testfile2.4160 -truncate -s 2G $DIR/testfile2.4224 -truncate -s 512G $DIR/testfile3.512 -truncate -s 512G $DIR/testfile3.520 -truncate -s 512G $DIR/testfile3.528 -truncate -s 512G $DIR/testfile3.4096 -truncate -s 512G $DIR/testfile3.4160 -truncate -s 512G $DIR/testfile3.4224 -truncate -s 549755822080 $DIR/testfile4.512 -truncate -s 549755822080 $DIR/testfile4.520 -truncate -s 549755822080 $DIR/testfile4.528 -truncate -s 549755822080 $DIR/testfile4.4096 -truncate -s 549755822080 $DIR/testfile4.4160 -truncate -s 549755822080 $DIR/testfile4.4224 -truncate -s 513G $DIR/testfile5.512 -truncate -s 513G $DIR/testfile5.520 -truncate -s 513G $DIR/testfile5.528 -truncate -s 513G $DIR/testfile5.4096 -truncate -s 513G $DIR/testfile5.4160 -truncate -s 513G $DIR/testfile5.4224 -truncate -s 514G $DIR/testfile6.512 -truncate -s 514G $DIR/testfile6.520 -truncate -s 514G $DIR/testfile6.528 -truncate -s 514G $DIR/testfile6.4096 -truncate -s 514G $DIR/testfile6.4160 -truncate -s 514G $DIR/testfile6.4224 -# MINIMUM POOL SIZE = 16MB + 8KB -MIN_POOL_SIZE=$((16*1024*1024 + 8*1024)) -truncate -s $MIN_POOL_SIZE $DIR/testfile7.512 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.520 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.528 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4096 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4160 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4224 - -# should fail: -# 512:$DIR/testfile1 (file is too small) -# 4096:$DIR/testfile2.512 (bsize doesn't match pool) -expect_normal_exit ./blk_nblock$EXESUFFIX\ - 512:$DIR/testfile1\ - 512:$DIR/testfile2.512\ - 4096:$DIR/testfile2.512\ - 520:$DIR/testfile2.520\ - 528:$DIR/testfile2.528\ - 4096:$DIR/testfile2.4096\ - 4160:$DIR/testfile2.4160\ - 4224:$DIR/testfile2.4224\ - 512:$DIR/testfile3.512\ - 520:$DIR/testfile3.520\ - 528:$DIR/testfile3.528\ - 4096:$DIR/testfile3.4096\ - 4160:$DIR/testfile3.4160\ - 4224:$DIR/testfile3.4224\ - 512:$DIR/testfile4.512\ - 520:$DIR/testfile4.520\ - 528:$DIR/testfile4.528\ - 4096:$DIR/testfile4.4096\ - 4160:$DIR/testfile4.4160\ - 4224:$DIR/testfile4.4224\ - 512:$DIR/testfile5.512\ - 520:$DIR/testfile5.520\ - 528:$DIR/testfile5.528\ - 4096:$DIR/testfile5.4096\ - 4160:$DIR/testfile5.4160\ - 4224:$DIR/testfile5.4224\ - 512:$DIR/testfile6.512\ - 520:$DIR/testfile6.520\ - 528:$DIR/testfile6.528\ - 4096:$DIR/testfile6.4096\ - 4160:$DIR/testfile6.4160\ - 4224:$DIR/testfile6.4224\ - 512:$DIR/testfile7.512\ - 520:$DIR/testfile7.520\ - 528:$DIR/testfile7.528\ - 4096:$DIR/testfile7.4096\ - 4160:$DIR/testfile7.4160\ - 4224:$DIR/testfile7.4224 - -check_pools $DIR/testfile2.512\ - $DIR/testfile2.512\ - $DIR/testfile2.520\ - $DIR/testfile2.528\ - $DIR/testfile2.4096\ - $DIR/testfile2.4160\ - $DIR/testfile2.4224\ - $DIR/testfile3.512\ - $DIR/testfile3.520\ - $DIR/testfile3.528\ - $DIR/testfile3.4096\ - $DIR/testfile3.4160\ - $DIR/testfile3.4224\ - $DIR/testfile4.512\ - $DIR/testfile4.520\ - $DIR/testfile4.528\ - $DIR/testfile4.4096\ - $DIR/testfile4.4160\ - $DIR/testfile4.4224\ - $DIR/testfile5.512\ - $DIR/testfile5.520\ - $DIR/testfile5.528\ - $DIR/testfile5.4096\ - $DIR/testfile5.4160\ - $DIR/testfile5.4224\ - $DIR/testfile6.512\ - $DIR/testfile6.520\ - $DIR/testfile6.528\ - $DIR/testfile6.4096\ - $DIR/testfile6.4160\ - $DIR/testfile6.4224\ - $DIR/testfile7.512\ - $DIR/testfile7.520\ - $DIR/testfile7.528\ - $DIR/testfile7.4096\ - $DIR/testfile7.4160\ - $DIR/testfile7.4224 - -check - -pass diff --git a/src/test/blk_nblock/TEST1 b/src/test/blk_nblock/TEST1 deleted file mode 100755 index 1d607b5e9fa..00000000000 --- a/src/test/blk_nblock/TEST1 +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_nblock/TEST1 -- unit test for pmemblk_nblock -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any -exclude_ppc64 - -setup - -# -# Create many files with different block sizes - most of -# them corner cases. -# -# These are holey files, so they actually don't take up -# any significant space. -# -truncate -s 1G $DIR/testfile1.2096896 -truncate -s 1G $DIR/testfile1.2096897 -truncate -s 2G $DIR/testfile2.0 -truncate -s 2G $DIR/testfile2.1 -truncate -s 2G $DIR/testfile2.17 -truncate -s 2G $DIR/testfile2.511 -truncate -s 2G $DIR/testfile2.1048576 -truncate -s 2G $DIR/testfile2.2097152 -truncate -s 2G $DIR/testfile2.4194304 -truncate -s 2G $DIR/testfile2.8388608 -truncate -s 2G $DIR/testfile2.16777216 -truncate -s 2G $DIR/testfile2.33554432 -truncate -s 2G $DIR/testfile2.67108864 -truncate -s 2G $DIR/testfile2.134217728 -truncate -s 2G $DIR/testfile2.268435456 -truncate -s 2G $DIR/testfile2.536870912 -truncate -s 2G $DIR/testfile2.1073741824 -truncate -s 2G $DIR/testfile2.2147483648 -truncate -s 2G $DIR/testfile2.-1 - -expect_normal_exit ./blk_nblock$EXESUFFIX\ - 2096896:$DIR/testfile1.2096896\ - 2096897:$DIR/testfile1.2096897\ - 0:$DIR/testfile2.0\ - 1:$DIR/testfile2.1\ - 17:$DIR/testfile2.17\ - 511:$DIR/testfile2.511\ - 1048576:$DIR/testfile2.1048576\ - 2097152:$DIR/testfile2.2097152\ - 4194304:$DIR/testfile2.4194304\ - 8388608:$DIR/testfile2.8388608\ - 16777216:$DIR/testfile2.16777216\ - 33554432:$DIR/testfile2.33554432\ - 67108864:$DIR/testfile2.67108864\ - 134217728:$DIR/testfile2.134217728\ - 268435456:$DIR/testfile2.268435456\ - 536870912:$DIR/testfile2.536870912\ - 1073741824:$DIR/testfile2.1073741824\ - 2147483648:$DIR/testfile2.2147483648\ - -1:$DIR/testfile2.-1 - -check_pools $DIR/testfile1.2096896\ - $DIR/testfile1.2096897\ - $DIR/testfile2.1\ - $DIR/testfile2.17\ - $DIR/testfile2.511\ - $DIR/testfile2.1048576\ - $DIR/testfile2.2097152\ - $DIR/testfile2.4194304\ - $DIR/testfile2.8388608\ - $DIR/testfile2.16777216\ - $DIR/testfile2.33554432\ - $DIR/testfile2.67108864\ - $DIR/testfile2.134217728\ - $DIR/testfile2.268435456\ - $DIR/testfile2.536870912\ - $DIR/testfile2.1073741824\ - $DIR/testfile2.2147483648\ - -check - -pass diff --git a/src/test/blk_nblock/TEST2 b/src/test/blk_nblock/TEST2 deleted file mode 100755 index 485d4ddb2ac..00000000000 --- a/src/test/blk_nblock/TEST2 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_nblock/TEST2 -- unit test for pmemblk_nblock -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -create_poolset $DIR/testset1 64M:$DIR/testfile11:x -create_poolset $DIR/testset2 64M:$DIR/testfile21:x 64M:$DIR/testfile22:x - -expect_normal_exit ./blk_nblock$EXESUFFIX\ - 512:$DIR/testset1\ - 512:$DIR/testset2 - -check_pools $DIR/testset1\ - $DIR/testset2 -check - -pass diff --git a/src/test/blk_nblock/TEST3 b/src/test/blk_nblock/TEST3 deleted file mode 100755 index 6d865bea716..00000000000 --- a/src/test/blk_nblock/TEST3 +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_nblock/TEST3 -- unit test for pmemblk_nblock -# -# This test is equivalent of TEST0 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any -require_unlimited_vm -require_ppc64 - -# this test creates huge files -configure_valgrind force-disable -setup - -# -# Create a gajillion files, each file size created -# has six versions for the six block sizes being tested. -# Except for testfile1, since that should fail because -# it is too small. -# -# These are holey files, so they actually don't take up -# any significant space. -# -truncate -s 2M $DIR/testfile1 -truncate -s 2G $DIR/testfile2.512 -truncate -s 2G $DIR/testfile2.520 -truncate -s 2G $DIR/testfile2.528 -truncate -s 2G $DIR/testfile2.4096 -truncate -s 2G $DIR/testfile2.4160 -truncate -s 2G $DIR/testfile2.4224 -truncate -s 512G $DIR/testfile3.512 -truncate -s 512G $DIR/testfile3.520 -truncate -s 512G $DIR/testfile3.528 -truncate -s 512G $DIR/testfile3.4096 -truncate -s 512G $DIR/testfile3.4160 -truncate -s 512G $DIR/testfile3.4224 -truncate -s 549755822080 $DIR/testfile4.512 -truncate -s 549755822080 $DIR/testfile4.520 -truncate -s 549755822080 $DIR/testfile4.528 -truncate -s 549755822080 $DIR/testfile4.4096 -truncate -s 549755822080 $DIR/testfile4.4160 -truncate -s 549755822080 $DIR/testfile4.4224 -truncate -s 513G $DIR/testfile5.512 -truncate -s 513G $DIR/testfile5.520 -truncate -s 513G $DIR/testfile5.528 -truncate -s 513G $DIR/testfile5.4096 -truncate -s 513G $DIR/testfile5.4160 -truncate -s 513G $DIR/testfile5.4224 -truncate -s 514G $DIR/testfile6.512 -truncate -s 514G $DIR/testfile6.520 -truncate -s 514G $DIR/testfile6.528 -truncate -s 514G $DIR/testfile6.4096 -truncate -s 514G $DIR/testfile6.4160 -truncate -s 514G $DIR/testfile6.4224 -# MINIMUM POOL SIZE = 16MB + 8KB -MIN_POOL_SIZE=$((16*1024*1024 + 128*1024)) -truncate -s $MIN_POOL_SIZE $DIR/testfile7.512 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.520 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.528 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4096 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4160 -truncate -s $MIN_POOL_SIZE $DIR/testfile7.4224 - -# should fail: -# 512:$DIR/testfile1 (file is too small) -# 4096:$DIR/testfile2.512 (bsize doesn't match pool) -expect_normal_exit ./blk_nblock$EXESUFFIX\ - 512:$DIR/testfile1\ - 512:$DIR/testfile2.512\ - 4096:$DIR/testfile2.512\ - 520:$DIR/testfile2.520\ - 528:$DIR/testfile2.528\ - 4096:$DIR/testfile2.4096\ - 4160:$DIR/testfile2.4160\ - 4224:$DIR/testfile2.4224\ - 512:$DIR/testfile3.512\ - 520:$DIR/testfile3.520\ - 528:$DIR/testfile3.528\ - 4096:$DIR/testfile3.4096\ - 4160:$DIR/testfile3.4160\ - 4224:$DIR/testfile3.4224\ - 512:$DIR/testfile4.512\ - 520:$DIR/testfile4.520\ - 528:$DIR/testfile4.528\ - 4096:$DIR/testfile4.4096\ - 4160:$DIR/testfile4.4160\ - 4224:$DIR/testfile4.4224\ - 512:$DIR/testfile5.512\ - 520:$DIR/testfile5.520\ - 528:$DIR/testfile5.528\ - 4096:$DIR/testfile5.4096\ - 4160:$DIR/testfile5.4160\ - 4224:$DIR/testfile5.4224\ - 512:$DIR/testfile6.512\ - 520:$DIR/testfile6.520\ - 528:$DIR/testfile6.528\ - 4096:$DIR/testfile6.4096\ - 4160:$DIR/testfile6.4160\ - 4224:$DIR/testfile6.4224\ - 512:$DIR/testfile7.512\ - 520:$DIR/testfile7.520\ - 528:$DIR/testfile7.528\ - 4096:$DIR/testfile7.4096\ - 4160:$DIR/testfile7.4160\ - 4224:$DIR/testfile7.4224 - -check_pools $DIR/testfile2.512\ - $DIR/testfile2.512\ - $DIR/testfile2.520\ - $DIR/testfile2.528\ - $DIR/testfile2.4096\ - $DIR/testfile2.4160\ - $DIR/testfile2.4224\ - $DIR/testfile3.512\ - $DIR/testfile3.520\ - $DIR/testfile3.528\ - $DIR/testfile3.4096\ - $DIR/testfile3.4160\ - $DIR/testfile3.4224\ - $DIR/testfile4.512\ - $DIR/testfile4.520\ - $DIR/testfile4.528\ - $DIR/testfile4.4096\ - $DIR/testfile4.4160\ - $DIR/testfile4.4224\ - $DIR/testfile5.512\ - $DIR/testfile5.520\ - $DIR/testfile5.528\ - $DIR/testfile5.4096\ - $DIR/testfile5.4160\ - $DIR/testfile5.4224\ - $DIR/testfile6.512\ - $DIR/testfile6.520\ - $DIR/testfile6.528\ - $DIR/testfile6.4096\ - $DIR/testfile6.4160\ - $DIR/testfile6.4224\ - $DIR/testfile7.512\ - $DIR/testfile7.520\ - $DIR/testfile7.528\ - $DIR/testfile7.4096\ - $DIR/testfile7.4160\ - $DIR/testfile7.4224 - -check - -pass diff --git a/src/test/blk_nblock/TEST4 b/src/test/blk_nblock/TEST4 deleted file mode 100755 index 80827b9d147..00000000000 --- a/src/test/blk_nblock/TEST4 +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_nblock/TEST4 -- unit test for pmemblk_nblock -# -# This test is equivalent of TEST1 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any -require_ppc64 - -setup - -# -# Create many files with different block sizes - most of -# them corner cases. -# -# These are holey files, so they actually don't take up -# any significant space. -# -truncate -s 1G $DIR/testfile1.2096640 -truncate -s 1G $DIR/testfile1.2096641 -truncate -s 2G $DIR/testfile2.0 -truncate -s 2G $DIR/testfile2.1 -truncate -s 2G $DIR/testfile2.17 -truncate -s 2G $DIR/testfile2.511 -truncate -s 2G $DIR/testfile2.1048576 -truncate -s 2G $DIR/testfile2.2097152 -truncate -s 2G $DIR/testfile2.4194304 -truncate -s 2G $DIR/testfile2.8388608 -truncate -s 2G $DIR/testfile2.16777216 -truncate -s 2G $DIR/testfile2.33554432 -truncate -s 2G $DIR/testfile2.67108864 -truncate -s 2G $DIR/testfile2.134217728 -truncate -s 2G $DIR/testfile2.268435456 -truncate -s 2G $DIR/testfile2.536870912 -truncate -s 2G $DIR/testfile2.1073741824 -truncate -s 2G $DIR/testfile2.2147483648 -truncate -s 2G $DIR/testfile2.-1 - -expect_normal_exit ./blk_nblock$EXESUFFIX\ - 2096640:$DIR/testfile1.2096640\ - 2096641:$DIR/testfile1.2096641\ - 0:$DIR/testfile2.0\ - 1:$DIR/testfile2.1\ - 17:$DIR/testfile2.17\ - 511:$DIR/testfile2.511\ - 1048576:$DIR/testfile2.1048576\ - 2097152:$DIR/testfile2.2097152\ - 4194304:$DIR/testfile2.4194304\ - 8388608:$DIR/testfile2.8388608\ - 16777216:$DIR/testfile2.16777216\ - 33554432:$DIR/testfile2.33554432\ - 67108864:$DIR/testfile2.67108864\ - 134217728:$DIR/testfile2.134217728\ - 268435456:$DIR/testfile2.268435456\ - 536870912:$DIR/testfile2.536870912\ - 1073741824:$DIR/testfile2.1073741824\ - 2147483648:$DIR/testfile2.2147483648\ - -1:$DIR/testfile2.-1 - -check_pools $DIR/testfile1.2096640\ - $DIR/testfile1.2096641\ - $DIR/testfile2.1\ - $DIR/testfile2.17\ - $DIR/testfile2.511\ - $DIR/testfile2.1048576\ - $DIR/testfile2.2097152\ - $DIR/testfile2.4194304\ - $DIR/testfile2.8388608\ - $DIR/testfile2.16777216\ - $DIR/testfile2.33554432\ - $DIR/testfile2.67108864\ - $DIR/testfile2.134217728\ - $DIR/testfile2.268435456\ - $DIR/testfile2.536870912\ - $DIR/testfile2.1073741824\ - $DIR/testfile2.2147483648\ - -check - -pass diff --git a/src/test/blk_nblock/blk_nblock.c b/src/test/blk_nblock/blk_nblock.c deleted file mode 100644 index aa645d272cb..00000000000 --- a/src/test/blk_nblock/blk_nblock.c +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2017, Intel Corporation */ - -/* - * blk_nblock.c -- unit test for pmemblk_nblock() - * - * usage: blk_nblock bsize:file... - * - */ - -#include "unittest.h" - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_nblock"); - - if (argc < 2) - UT_FATAL("usage: %s bsize:file...", argv[0]); - - /* map each file argument with the given map type */ - for (int arg = 1; arg < argc; arg++) { - char *fname; - size_t bsize = strtoul(argv[arg], &fname, 0); - if (*fname != ':') - UT_FATAL("usage: %s bsize:file...", argv[0]); - fname++; - - PMEMblkpool *handle; - handle = pmemblk_create(fname, bsize, 0, S_IWUSR | S_IRUSR); - if (handle == NULL) { - UT_OUT("!%s: pmemblk_create", fname); - } else { - UT_OUT("%s: block size %zu usable blocks: %zu", - fname, bsize, pmemblk_nblock(handle)); - UT_ASSERTeq(pmemblk_bsize(handle), bsize); - pmemblk_close(handle); - int result = pmemblk_check(fname, bsize); - if (result < 0) - UT_OUT("!%s: pmemblk_check", fname); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", - fname); - else { - UT_ASSERTeq(pmemblk_check(fname, bsize + 1), - -1); - UT_ASSERTeq(pmemblk_check(fname, 0), 1); - - handle = pmemblk_open(fname, 0); - UT_ASSERTeq(pmemblk_bsize(handle), bsize); - pmemblk_close(handle); - } - } - } - - DONE(NULL); -} diff --git a/src/test/blk_nblock/out0.log.match b/src/test/blk_nblock/out0.log.match deleted file mode 100644 index d5e1bc1451e..00000000000 --- a/src/test/blk_nblock/out0.log.match +++ /dev/null @@ -1,41 +0,0 @@ -blk_nblock$(nW)TEST0: START: blk_nblock - $(nW)blk_nblock$(nW) 512:$(nW)testfile1 512:$(nW)testfile2.512 4096:$(nW)testfile2.512 520:$(nW)testfile2.520 528:$(nW)testfile2.528 4096:$(nW)testfile2.4096 4160:$(nW)testfile2.4160 4224:$(nW)testfile2.4224 512:$(nW)testfile3.512 520:$(nW)testfile3.520 528:$(nW)testfile3.528 4096:$(nW)testfile3.4096 4160:$(nW)testfile3.4160 4224:$(nW)testfile3.4224 512:$(nW)testfile4.512 520:$(nW)testfile4.520 528:$(nW)testfile4.528 4096:$(nW)testfile4.4096 4160:$(nW)testfile4.4160 4224:$(nW)testfile4.4224 512:$(nW)testfile5.512 520:$(nW)testfile5.520 528:$(nW)testfile5.528 4096:$(nW)testfile5.4096 4160:$(nW)testfile5.4160 4224:$(nW)testfile5.4224 512:$(nW)testfile6.512 520:$(nW)testfile6.520 528:$(nW)testfile6.528 4096:$(nW)testfile6.4096 4160:$(nW)testfile6.4160 4224:$(nW)testfile6.4224 512:$(nW)testfile7.512 520:$(nW)testfile7.520 528:$(nW)testfile7.528 4096:$(nW)testfile7.4096 4160:$(nW)testfile7.4160 4224:$(nW)testfile7.4224 -$(nW)testfile1: pmemblk_create: Invalid argument -$(nW)testfile2.512: block size 512 usable blocks: 4161462 -$(nW)testfile2.512: pmemblk_create: File exists -$(nW)testfile2.520: block size 520 usable blocks: 2781410 -$(nW)testfile2.528: block size 528 usable blocks: 2781410 -$(nW)testfile2.4096: block size 4096 usable blocks: 523511 -$(nW)testfile2.4160: block size 4160 usable blocks: 492729 -$(nW)testfile2.4224: block size 4224 usable blocks: 492729 -$(nW)testfile3.512: block size 512 usable blocks: 1065417916 -$(nW)testfile3.520: block size 520 usable blocks: 712118626 -$(nW)testfile3.528: block size 528 usable blocks: 712118626 -$(nW)testfile3.4096: block size 4096 usable blocks: 134086518 -$(nW)testfile3.4160: block size 4160 usable blocks: 126206304 -$(nW)testfile3.4224: block size 4224 usable blocks: 126206304 -$(nW)testfile4.512: block size 512 usable blocks: 1065417932 -$(nW)testfile4.520: block size 520 usable blocks: 712118636 -$(nW)testfile4.528: block size 528 usable blocks: 712118636 -$(nW)testfile4.4096: block size 4096 usable blocks: 134086520 -$(nW)testfile4.4160: block size 4160 usable blocks: 126206306 -$(nW)testfile4.4224: block size 4224 usable blocks: 126206306 -$(nW)testfile5.512: block size 512 usable blocks: 1067498499 -$(nW)testfile5.520: block size 520 usable blocks: 713509189 -$(nW)testfile5.528: block size 528 usable blocks: 713509189 -$(nW)testfile5.4096: block size 4096 usable blocks: 134348143 -$(nW)testfile5.4160: block size 4160 usable blocks: 126452538 -$(nW)testfile5.4224: block size 4224 usable blocks: 126452538 -$(nW)testfile6.512: block size 512 usable blocks: 1069579394 -$(nW)testfile6.520: block size 520 usable blocks: 714900046 -$(nW)testfile6.528: block size 528 usable blocks: 714900046 -$(nW)testfile6.4096: block size 4096 usable blocks: 134610031 -$(nW)testfile6.4160: block size 4160 usable blocks: 126699035 -$(nW)testfile6.4224: block size 4224 usable blocks: 126699035 -$(nW)testfile7.512: block size 512 usable blocks: 32202 -$(nW)testfile7.520: block size 520 usable blocks: 21439 -$(nW)testfile7.528: block size 528 usable blocks: 21439 -$(nW)testfile7.4096: block size 4096 usable blocks: 3829 -$(nW)testfile7.4160: block size 4160 usable blocks: 3588 -$(nW)testfile7.4224: block size 4224 usable blocks: 3588 -blk_nblock$(nW)TEST0: DONE diff --git a/src/test/blk_nblock/out1.log.match b/src/test/blk_nblock/out1.log.match deleted file mode 100644 index c1405913008..00000000000 --- a/src/test/blk_nblock/out1.log.match +++ /dev/null @@ -1,22 +0,0 @@ -blk_nblock$(nW)TEST1: START: blk_nblock - $(nW)blk_nblock$(nW) 2096896:$(nW)testfile1.2096896 2096897:$(nW)testfile1.2096897 0:$(nW)testfile2.0 1:$(nW)testfile2.1 17:$(nW)testfile2.17 511:$(nW)testfile2.511 1048576:$(nW)testfile2.1048576 2097152:$(nW)testfile2.2097152 4194304:$(nW)testfile2.4194304 8388608:$(nW)testfile2.8388608 16777216:$(nW)testfile2.16777216 33554432:$(nW)testfile2.33554432 67108864:$(nW)testfile2.67108864 134217728:$(nW)testfile2.134217728 268435456:$(nW)testfile2.268435456 536870912:$(nW)testfile2.536870912 1073741824:$(nW)testfile2.1073741824 2147483648:$(nW)testfile2.2147483648 -1:$(nW)testfile2.-1 -$(nW)testfile1.2096896: block size 2096896 usable blocks: 256 -$(nW)testfile1.2096897: pmemblk_create: Invalid argument -$(nW)testfile2.0: pmemblk_create: Invalid argument -$(nW)testfile2.1: block size 1 usable blocks: $(N) -$(nW)testfile2.17: block size 17 usable blocks: $(N) -$(nW)testfile2.511: block size 511 usable blocks: $(N) -$(nW)testfile2.1048576: block size 1048576 usable blocks: 1791 -$(nW)testfile2.2097152: block size 2097152 usable blocks: 767 -$(nW)testfile2.4194304: pmemblk_create: Invalid argument -$(nW)testfile2.8388608: pmemblk_create: Invalid argument -$(nW)testfile2.16777216: pmemblk_create: Invalid argument -$(nW)testfile2.33554432: pmemblk_create: Invalid argument -$(nW)testfile2.67108864: pmemblk_create: Invalid argument -$(nW)testfile2.134217728: pmemblk_create: Invalid argument -$(nW)testfile2.268435456: pmemblk_create: Invalid argument -$(nW)testfile2.536870912: pmemblk_create: Invalid argument -$(nW)testfile2.1073741824: pmemblk_create: Invalid argument -$(nW)testfile2.2147483648: pmemblk_create: Invalid argument -$(nW)testfile2.-1: pmemblk_create: Invalid argument -blk_nblock$(nW)TEST1: DONE diff --git a/src/test/blk_nblock/out2.log.match b/src/test/blk_nblock/out2.log.match deleted file mode 100644 index 49a65f5c8c5..00000000000 --- a/src/test/blk_nblock/out2.log.match +++ /dev/null @@ -1,7 +0,0 @@ -blk_nblock$(nW)TEST2: START: blk_nblock - $(nW)blk_nblock$(nW) 512:$(nW)testset1 512:$(nW)testset2 -$(OPT)$(nW)testset1: block size 512 usable blocks: 129728 -$(OPX)$(nW)testset1: block size 512 usable blocks: 129490 -$(OPT)$(nW)testset2: block size 512 usable blocks: 259776 -$(OPX)$(nW)testset2: block size 512 usable blocks: 259419 -blk_nblock$(nW)TEST2: DONE diff --git a/src/test/blk_nblock/out3.log.match b/src/test/blk_nblock/out3.log.match deleted file mode 100644 index 391a0bca952..00000000000 --- a/src/test/blk_nblock/out3.log.match +++ /dev/null @@ -1,41 +0,0 @@ -blk_nblock$(nW)TEST3: START: blk_nblock - $(nW)blk_nblock$(nW) 512:$(nW)testfile1 512:$(nW)testfile2.512 4096:$(nW)testfile2.512 520:$(nW)testfile2.520 528:$(nW)testfile2.528 4096:$(nW)testfile2.4096 4160:$(nW)testfile2.4160 4224:$(nW)testfile2.4224 512:$(nW)testfile3.512 520:$(nW)testfile3.520 528:$(nW)testfile3.528 4096:$(nW)testfile3.4096 4160:$(nW)testfile3.4160 4224:$(nW)testfile3.4224 512:$(nW)testfile4.512 520:$(nW)testfile4.520 528:$(nW)testfile4.528 4096:$(nW)testfile4.4096 4160:$(nW)testfile4.4160 4224:$(nW)testfile4.4224 512:$(nW)testfile5.512 520:$(nW)testfile5.520 528:$(nW)testfile5.528 4096:$(nW)testfile5.4096 4160:$(nW)testfile5.4160 4224:$(nW)testfile5.4224 512:$(nW)testfile6.512 520:$(nW)testfile6.520 528:$(nW)testfile6.528 4096:$(nW)testfile6.4096 4160:$(nW)testfile6.4160 4224:$(nW)testfile6.4224 512:$(nW)testfile7.512 520:$(nW)testfile7.520 528:$(nW)testfile7.528 4096:$(nW)testfile7.4096 4160:$(nW)testfile7.4160 4224:$(nW)testfile7.4224 -$(nW)testfile1: pmemblk_create: Invalid argument -$(nW)testfile2.512: block size 512 usable blocks: 4161224 -$(nW)testfile2.512: pmemblk_create: File exists -$(nW)testfile2.520: block size 520 usable blocks: 2781251 -$(nW)testfile2.528: block size 528 usable blocks: 2781251 -$(nW)testfile2.4096: block size 4096 usable blocks: 523481 -$(nW)testfile2.4160: block size 4160 usable blocks: 492701 -$(nW)testfile2.4224: block size 4224 usable blocks: 492701 -$(nW)testfile3.512: block size 512 usable blocks: 1065417678 -$(nW)testfile3.520: block size 520 usable blocks: 712118466 -$(nW)testfile3.528: block size 528 usable blocks: 712118466 -$(nW)testfile3.4096: block size 4096 usable blocks: 134086488 -$(nW)testfile3.4160: block size 4160 usable blocks: 126206276 -$(nW)testfile3.4224: block size 4224 usable blocks: 126206276 -$(nW)testfile4.512: block size 512 usable blocks: 1065417678 -$(nW)testfile4.520: block size 520 usable blocks: 712118466 -$(nW)testfile4.528: block size 528 usable blocks: 712118466 -$(nW)testfile4.4096: block size 4096 usable blocks: 134086488 -$(nW)testfile4.4160: block size 4160 usable blocks: 126206276 -$(nW)testfile4.4224: block size 4224 usable blocks: 126206276 -$(nW)testfile5.512: block size 512 usable blocks: 1067498261 -$(nW)testfile5.520: block size 520 usable blocks: 713509030 -$(nW)testfile5.528: block size 528 usable blocks: 713509030 -$(nW)testfile5.4096: block size 4096 usable blocks: 134348113 -$(nW)testfile5.4160: block size 4160 usable blocks: 126452510 -$(nW)testfile5.4224: block size 4224 usable blocks: 126452510 -$(nW)testfile6.512: block size 512 usable blocks: 1069579156 -$(nW)testfile6.520: block size 520 usable blocks: 714899887 -$(nW)testfile6.528: block size 528 usable blocks: 714899887 -$(nW)testfile6.4096: block size 4096 usable blocks: 134610001 -$(nW)testfile6.4160: block size 4160 usable blocks: 126699007 -$(nW)testfile6.4224: block size 4224 usable blocks: 126699007 -$(nW)testfile7.512: block size 512 usable blocks: 32202 -$(nW)testfile7.520: block size 520 usable blocks: 21439 -$(nW)testfile7.528: block size 528 usable blocks: 21439 -$(nW)testfile7.4096: block size 4096 usable blocks: 3829 -$(nW)testfile7.4160: block size 4160 usable blocks: 3588 -$(nW)testfile7.4224: block size 4224 usable blocks: 3588 -blk_nblock$(nW)TEST3: DONE diff --git a/src/test/blk_nblock/out4.log.match b/src/test/blk_nblock/out4.log.match deleted file mode 100644 index d677b5c7180..00000000000 --- a/src/test/blk_nblock/out4.log.match +++ /dev/null @@ -1,22 +0,0 @@ -blk_nblock$(nW)TEST4: START: blk_nblock - $(nW)blk_nblock$(nW) 2096640:$(nW)testfile1.2096640 2096641:$(nW)testfile1.2096641 0:$(nW)testfile2.0 1:$(nW)testfile2.1 17:$(nW)testfile2.17 511:$(nW)testfile2.511 1048576:$(nW)testfile2.1048576 2097152:$(nW)testfile2.2097152 4194304:$(nW)testfile2.4194304 8388608:$(nW)testfile2.8388608 16777216:$(nW)testfile2.16777216 33554432:$(nW)testfile2.33554432 67108864:$(nW)testfile2.67108864 134217728:$(nW)testfile2.134217728 268435456:$(nW)testfile2.268435456 536870912:$(nW)testfile2.536870912 1073741824:$(nW)testfile2.1073741824 2147483648:$(nW)testfile2.2147483648 -1:$(nW)testfile2.-1 -$(nW)testfile1.2096640: block size 2096640 usable blocks: 256 -$(nW)testfile1.2096641: pmemblk_create: Invalid argument -$(nW)testfile2.0: pmemblk_create: Invalid argument -$(nW)testfile2.1: block size 1 usable blocks: $(N) -$(nW)testfile2.17: block size 17 usable blocks: $(N) -$(nW)testfile2.511: block size 511 usable blocks: $(N) -$(nW)testfile2.1048576: block size 1048576 usable blocks: 1791 -$(nW)testfile2.2097152: block size 2097152 usable blocks: 767 -$(nW)testfile2.4194304: pmemblk_create: Invalid argument -$(nW)testfile2.8388608: pmemblk_create: Invalid argument -$(nW)testfile2.16777216: pmemblk_create: Invalid argument -$(nW)testfile2.33554432: pmemblk_create: Invalid argument -$(nW)testfile2.67108864: pmemblk_create: Invalid argument -$(nW)testfile2.134217728: pmemblk_create: Invalid argument -$(nW)testfile2.268435456: pmemblk_create: Invalid argument -$(nW)testfile2.536870912: pmemblk_create: Invalid argument -$(nW)testfile2.1073741824: pmemblk_create: Invalid argument -$(nW)testfile2.2147483648: pmemblk_create: Invalid argument -$(nW)testfile2.-1: pmemblk_create: Invalid argument -blk_nblock$(nW)TEST4: DONE diff --git a/src/test/blk_non_zero/.gitignore b/src/test/blk_non_zero/.gitignore deleted file mode 100644 index f41a897184a..00000000000 --- a/src/test/blk_non_zero/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_non_zero diff --git a/src/test/blk_non_zero/Makefile b/src/test/blk_non_zero/Makefile deleted file mode 100644 index 5e0d89d9cd5..00000000000 --- a/src/test/blk_non_zero/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2023, Intel Corporation - -# -# src/test/blk_non_zero/Makefile -- build blk_non_zero unit test -# -TARGET = blk_non_zero -OBJS = blk_non_zero.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - -INCS += -I../../libpmemblk diff --git a/src/test/blk_non_zero/README b/src/test/blk_non_zero/README deleted file mode 100644 index c9ee8b74f0d..00000000000 --- a/src/test/blk_non_zero/README +++ /dev/null @@ -1,22 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_non_zero/README. - -This directory contains a unit test for pmemblk_read/write/set_zero/set_error -with a deliberately non-zero filled map. - -The program in blk_non_zero.c takes a block size, file and a list of -operation:LBA pairs. For example: - - ./blk_non_zero 4096 file1 r:0 w:5 z:9 e:100 - -this will call pmemblk_open() on file1 and then pmemblk_read() for LBA 0, -pmemblk_write() for LBA 5, pmemblk_set_zero() for LBA 9, and pmem_set_error() -for LBA 100. - -In tests 0-4 the map is filled with pseudo-random data before any read/write -operation is made. In tests 5-8 the pool is created by the libpmemblk Library -and is zero filled. Each block written is filled up with the ordinal number of -the write operation (a block full of 8-bit 1s, then a block filled with 8-bit -2s, etc.). When a block is read, the number it was filled with is reported -(and the program verifies the entire block is filled with that number). diff --git a/src/test/blk_non_zero/TEST0 b/src/test/blk_non_zero/TEST0 deleted file mode 100755 index 511386f52a9..00000000000 --- a/src/test/blk_non_zero/TEST0 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST0 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -exclude_ppc64 - -setup - -SIZE=$(blk_pool_desc_size) -# single arena and minimum pmemblk pool file case -create_nonzeroed_file 17M ${SIZE} $DIR/testfile1 - -# -# All reads to an unwritten block pool should return zeros. -# Block 32202 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - r:0 r:1 r:34217 r:34218 z:0 z:1 r:0 e:3 r:4 - -check - -pass diff --git a/src/test/blk_non_zero/TEST1 b/src/test/blk_non_zero/TEST1 deleted file mode 100755 index 8bdfa040258..00000000000 --- a/src/test/blk_non_zero/TEST1 +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST1 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -exclude_ppc64 - -setup - -# single arena write case -create_nonzeroed_file 1G 824K $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check - -pass diff --git a/src/test/blk_non_zero/TEST10 b/src/test/blk_non_zero/TEST10 deleted file mode 100755 index 51d253c0109..00000000000 --- a/src/test/blk_non_zero/TEST10 +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST10 -- unit test for error injection -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any - -setup - -# single arena and minimum pmemblk pool file case -create_nonzeroed_file 17M $(blk_pool_desc_size) $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - t:3 - -rm $DIR/testfile1 -create_nonzeroed_file 17M $(blk_pool_desc_size) $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - m:3 - -check - -pass diff --git a/src/test/blk_non_zero/TEST11 b/src/test/blk_non_zero/TEST11 deleted file mode 100755 index 5ab89cd2e24..00000000000 --- a/src/test/blk_non_zero/TEST11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST11 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST0 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_ppc64 - -setup - -SIZE=$(blk_pool_desc_size) -# single arena and minimum pmemblk pool file case -create_nonzeroed_file 17M ${SIZE} $DIR/testfile1 - -# -# All reads to an unwritten block pool should return zeros. -# Block 32202 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - r:0 r:1 r:33979 r:34280 z:0 z:1 r:0 e:3 r:4 - -check - -pass diff --git a/src/test/blk_non_zero/TEST12 b/src/test/blk_non_zero/TEST12 deleted file mode 100755 index 7d9c9b4a43c..00000000000 --- a/src/test/blk_non_zero/TEST12 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST12 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST1 for ppc64le platform. -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -require_ppc64 - -setup - -# single arena write case -create_nonzeroed_file 1G 824K $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check - -pass diff --git a/src/test/blk_non_zero/TEST13 b/src/test/blk_non_zero/TEST13 deleted file mode 100755 index 73bff5ab767..00000000000 --- a/src/test/blk_non_zero/TEST13 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST13 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST2 for ppc64le platform. -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -require_ppc64 - -setup - -# write re-use test case -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:0 w:1 w:2 w:3 w:4 r:4 r:3 r:2 r:1 r:0 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 o\ - w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 - -check - -pass diff --git a/src/test/blk_non_zero/TEST14 b/src/test/blk_non_zero/TEST14 deleted file mode 100755 index 0c91a230930..00000000000 --- a/src/test/blk_non_zero/TEST14 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST14 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST3 for ppc64le platform. -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -require_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check - -pass diff --git a/src/test/blk_non_zero/TEST15 b/src/test/blk_non_zero/TEST15 deleted file mode 100755 index e8f17db1ac1..00000000000 --- a/src/test/blk_non_zero/TEST15 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST15 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST4 for ppc64le platform. -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -require_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check - -pass diff --git a/src/test/blk_non_zero/TEST16 b/src/test/blk_non_zero/TEST16 deleted file mode 100755 index e150fa1cbf2..00000000000 --- a/src/test/blk_non_zero/TEST16 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_non_zero/TEST16 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST5 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_ppc64 - -setup - -# single arena and minimum pmemblk pool file case -MIN_POOL_SIZE=$((16*1024*1024 + 128*1024)) - -# -# All reads to an unwritten block pool should return zeros. -# Block 32202 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $MIN_POOL_SIZE\ - r:0 r:1 r:32201 r:32202 z:0 z:1 r:0 - -check - -pass diff --git a/src/test/blk_non_zero/TEST17 b/src/test/blk_non_zero/TEST17 deleted file mode 100755 index 8f56bdae41f..00000000000 --- a/src/test/blk_non_zero/TEST17 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_non_zero/TEST17 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST6 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_ppc64 - -setup - -# single arena write case -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check - -pass diff --git a/src/test/blk_non_zero/TEST18 b/src/test/blk_non_zero/TEST18 deleted file mode 100755 index fefd119cb38..00000000000 --- a/src/test/blk_non_zero/TEST18 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_non_zero/TEST18 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST7 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check - -pass diff --git a/src/test/blk_non_zero/TEST19 b/src/test/blk_non_zero/TEST19 deleted file mode 100755 index 5c2f27a76b8..00000000000 --- a/src/test/blk_non_zero/TEST19 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_non_zero/TEST19 -- unit test for -# pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST8 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check - -pass diff --git a/src/test/blk_non_zero/TEST2 b/src/test/blk_non_zero/TEST2 deleted file mode 100755 index b9fe0b02ff1..00000000000 --- a/src/test/blk_non_zero/TEST2 +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST4 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -exclude_ppc64 - -setup - -# write re-use test case -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:0 w:1 w:2 w:3 w:4 r:4 r:3 r:2 r:1 r:0 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 o\ - w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 - -check - -pass diff --git a/src/test/blk_non_zero/TEST3 b/src/test/blk_non_zero/TEST3 deleted file mode 100755 index dd5146460cb..00000000000 --- a/src/test/blk_non_zero/TEST3 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST3 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -exclude_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check - -pass diff --git a/src/test/blk_non_zero/TEST4 b/src/test/blk_non_zero/TEST4 deleted file mode 100755 index 2931ca643c2..00000000000 --- a/src/test/blk_non_zero/TEST4 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST4 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_test_type long -exclude_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -create_nonzeroed_file 1G 824M $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check - -pass diff --git a/src/test/blk_non_zero/TEST5 b/src/test/blk_non_zero/TEST5 deleted file mode 100755 index 8521da79e4b..00000000000 --- a/src/test/blk_non_zero/TEST5 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_non_zero/TEST5 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -exclude_ppc64 - -setup - -# single arena and minimum pmemblk pool file case -MIN_POOL_SIZE=$((16*1024*1024 + 64*1024)) - -# -# All reads to an unwritten block pool should return zeros. -# Block 32202 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $MIN_POOL_SIZE\ - r:0 r:1 r:32312 r:32313 z:0 z:1 r:0 - -check - -pass diff --git a/src/test/blk_non_zero/TEST6 b/src/test/blk_non_zero/TEST6 deleted file mode 100755 index 4203b5b0631..00000000000 --- a/src/test/blk_non_zero/TEST6 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_non_zero/TEST6 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -exclude_ppc64 - -setup - -# single arena write case -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check - -pass diff --git a/src/test/blk_non_zero/TEST7 b/src/test/blk_non_zero/TEST7 deleted file mode 100755 index e5458fbd756..00000000000 --- a/src/test/blk_non_zero/TEST7 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_non_zero/TEST7 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -exclude_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check - -pass diff --git a/src/test/blk_non_zero/TEST8 b/src/test/blk_non_zero/TEST8 deleted file mode 100755 index 8320f3ec89d..00000000000 --- a/src/test/blk_non_zero/TEST8 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_non_zero/TEST8 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -exclude_ppc64 - -setup - -# mix writes with set_zero and set_error and check results -FILE_SIZE=$((1024*1024*1024)) -require_free_space $FILE_SIZE - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c $FILE_SIZE\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check - -pass diff --git a/src/test/blk_non_zero/TEST9 b/src/test/blk_non_zero/TEST9 deleted file mode 100755 index f2ba4b74536..00000000000 --- a/src/test/blk_non_zero/TEST9 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_non_zero/TEST9 -- unit test for -# pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# long test, run only on pmem -require_fs_type pmem -require_test_type long -configure_valgrind pmemcheck force-enable -setup - -# mix writes with set_zero and set_error and check results -create_nonzeroed_file 128M 8K $DIR/testfile1 - -expect_normal_exit ./blk_non_zero$EXESUFFIX 512 $DIR/testfile1 c 0\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check - -pass diff --git a/src/test/blk_non_zero/blk_non_zero.c b/src/test/blk_non_zero/blk_non_zero.c deleted file mode 100644 index 9cf1e150f6b..00000000000 --- a/src/test/blk_non_zero/blk_non_zero.c +++ /dev/null @@ -1,198 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2020, Intel Corporation */ - -/* - * blk_non_zero.c -- unit test for pmemblk_read/write/set_zero/ - * set_error/inject_fault - * - * usage: blk_non_zero bsize file func operation:lba... - * - * func is 'c' or 'o' (create or open) - * operations are 'r' or 'w' or 'z' or 'e' or 't' or 'm' - * - */ -#define _GNU_SOURCE - -#include -#include "unittest.h" - -#include "blk.h" - -static size_t Bsize; - -/* - * construct -- build a buffer for writing - */ -static void -construct(unsigned char *buf) -{ - static int ord = 1; - - for (int i = 0; i < Bsize; i++) - buf[i] = ord; - - ord++; - - if (ord > 255) - ord = 1; -} - -/* - * ident -- identify what a buffer holds - */ -static char * -ident(unsigned char *buf) -{ - static char descr[100]; - unsigned val = *buf; - - for (int i = 1; i < Bsize; i++) - if (buf[i] != val) { - sprintf(descr, "{%u} TORN at byte %d", val, i); - return descr; - } - - sprintf(descr, "{%u}", val); - return descr; -} - -/* - * is_zeroed -- read is_zeroed flag from header - */ -static int -is_zeroed(const char *path) -{ - int fd = OPEN(path, O_RDWR); - os_stat_t stbuf; - - FSTAT(fd, &stbuf); - - void *addr = MMAP(NULL, (size_t)stbuf.st_size, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, 0); - - struct pmemblk *header = addr; - - int ret = header->is_zeroed; - - MUNMAP(addr, (size_t)stbuf.st_size); - CLOSE(fd); - - return ret; -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_non_zero"); - - if (argc < 5) - UT_FATAL("usage: %s bsize file func [file_size] op:lba...", - argv[0]); - - int read_arg = 1; - - Bsize = strtoul(argv[read_arg++], NULL, 0); - - const char *path = argv[read_arg++]; - - PMEMblkpool *handle = NULL; - switch (*argv[read_arg++]) { - case 'c': { - size_t fsize = strtoul(argv[read_arg++], NULL, 0); - handle = pmemblk_create(path, Bsize, fsize, - S_IRUSR | S_IWUSR); - if (handle == NULL) - UT_FATAL("!%s: pmemblk_create", path); - break; - } - case 'o': - handle = pmemblk_open(path, Bsize); - if (handle == NULL) - UT_FATAL("!%s: pmemblk_open", path); - break; - default: - UT_FATAL("unrecognized command %s", argv[read_arg - 1]); - } - - UT_OUT("%s block size %zu usable blocks %zu", - argv[1], Bsize, pmemblk_nblock(handle)); - - UT_OUT("is zeroed:\t%d", is_zeroed(path)); - - unsigned char *buf = MALLOC(Bsize); - if (buf == NULL) - UT_FATAL("cannot allocate buf"); - - /* map each file argument with the given map type */ - for (; read_arg < argc; read_arg++) { - if (strchr("rwzetm", argv[read_arg][0]) == NULL || - argv[read_arg][1] != ':') - UT_FATAL("op must be r: or w: or z: or e: or t: or m:"); - os_off_t lba = STRTOL(&argv[read_arg][2], NULL, 0); - - switch (argv[read_arg][0]) { - case 'r': - if (pmemblk_read(handle, buf, lba) < 0) - UT_OUT("!read lba %zu", lba); - else - UT_OUT("read lba %zu: %s", lba, - ident(buf)); - break; - - case 'w': - construct(buf); - if (pmemblk_write(handle, buf, lba) < 0) - UT_OUT("!write lba %zu", lba); - else - UT_OUT("write lba %zu: %s", lba, - ident(buf)); - break; - - case 'z': - if (pmemblk_set_zero(handle, lba) < 0) - UT_OUT("!set_zero lba %zu", lba); - else - UT_OUT("set_zero lba %zu", lba); - break; - - case 'e': - if (pmemblk_set_error(handle, lba) < 0) - UT_OUT("!set_error lba %zu", lba); - else - UT_OUT("set_error lba %zu", lba); - break; - - case 't': - if (!pmemblk_fault_injection_enabled()) - break; - - pmemblk_inject_fault_at(PMEM_MALLOC, 1, "build_rtt"); - int ret = pmemblk_set_error(handle, lba); - UT_ASSERTne(ret, 0); - UT_ASSERTeq(errno, ENOMEM); - break; - case 'm': - if (!pmemblk_fault_injection_enabled()) - break; - - pmemblk_inject_fault_at(PMEM_MALLOC, 1, - "build_map_locks"); - ret = pmemblk_set_error(handle, lba); - UT_ASSERTne(ret, 0); - UT_ASSERTeq(errno, ENOMEM); - break; - } - } - - FREE(buf); - - pmemblk_close(handle); - - int result = pmemblk_check(path, Bsize); - if (result < 0) - UT_OUT("!%s: pmemblk_check", path); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", path); - - DONE(NULL); -} diff --git a/src/test/blk_non_zero/out0.log.match b/src/test/blk_non_zero/out0.log.match deleted file mode 100644 index 1562769e95f..00000000000 --- a/src/test/blk_non_zero/out0.log.match +++ /dev/null @@ -1,14 +0,0 @@ -blk_non_zero$(nW)TEST0: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 r:0 r:1 r:34217 r:34218 z:0 z:1 r:0 e:3 r:4 -512 block size 512 usable blocks 34218 -is zeroed: 0 -read lba 0: {0} -read lba 1: {0} -read lba 34217: {0} -read lba 34218: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -set_error lba 3 -read lba 4: {0} -blk_non_zero$(nW)TEST0: DONE diff --git a/src/test/blk_non_zero/out1.log.match b/src/test/blk_non_zero/out1.log.match deleted file mode 100644 index 623406fd9a9..00000000000 --- a/src/test/blk_non_zero/out1.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST1: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080567 -is zeroed: 0 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_non_zero$(nW)TEST1: DONE diff --git a/src/test/blk_non_zero/out11.log.match b/src/test/blk_non_zero/out11.log.match deleted file mode 100644 index e0c65b6f508..00000000000 --- a/src/test/blk_non_zero/out11.log.match +++ /dev/null @@ -1,14 +0,0 @@ -blk_non_zero$(nW)TEST11: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 r:0 r:1 r:33979 r:34280 z:0 z:1 r:0 e:3 r:4 -512 block size 512 usable blocks 33980 -is zeroed: 0 -read lba 0: {0} -read lba 1: {0} -read lba 33979: {0} -read lba 34280: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -set_error lba 3 -read lba 4: {0} -blk_non_zero$(nW)TEST11: DONE diff --git a/src/test/blk_non_zero/out12.log.match b/src/test/blk_non_zero/out12.log.match deleted file mode 100644 index 30c6b189d92..00000000000 --- a/src/test/blk_non_zero/out12.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST12: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080329 -is zeroed: 0 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_non_zero$(nW)TEST12: DONE diff --git a/src/test/blk_non_zero/out13.log.match b/src/test/blk_non_zero/out13.log.match deleted file mode 100644 index cbcf80d1cb8..00000000000 --- a/src/test/blk_non_zero/out13.log.match +++ /dev/null @@ -1,13 +0,0 @@ -blk_non_zero$(nW)TEST13: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 o w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 -512 block size 512 usable blocks 2080329 -is zeroed: 0 -write lba 0: {1} -read lba 4: {5} -read lba 3: {4} -read lba 2: {3} -read lba 1: {2} -read lba 0: {1} -write lba 0: {2} -read lba 0: {2} -blk_non_zero$(nW)TEST13: DONE diff --git a/src/test/blk_non_zero/out14.log.match b/src/test/blk_non_zero/out14.log.match deleted file mode 100644 index 804f4770548..00000000000 --- a/src/test/blk_non_zero/out14.log.match +++ /dev/null @@ -1,29 +0,0 @@ -blk_non_zero$(nW)TEST14: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080329 -is zeroed: 0 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_non_zero$(nW)TEST14: DONE diff --git a/src/test/blk_non_zero/out15.log.match b/src/test/blk_non_zero/out15.log.match deleted file mode 100644 index 273f942af86..00000000000 --- a/src/test/blk_non_zero/out15.log.match +++ /dev/null @@ -1,24 +0,0 @@ -blk_non_zero$(nW)TEST15: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080329 -is zeroed: 0 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_non_zero$(nW)TEST15: DONE diff --git a/src/test/blk_non_zero/out16.log.match b/src/test/blk_non_zero/out16.log.match deleted file mode 100644 index 79e92c74dcd..00000000000 --- a/src/test/blk_non_zero/out16.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST16: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N)$(S) r:0 r:1 r:32201 r:32202 z:0 z:1 r:0 -512 block size 512 usable blocks 32202 -is zeroed: 1 -read lba 0: {0} -read lba 1: {0} -read lba 32201: {0} -read lba 32202: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -blk_non_zero$(nW)TEST16: DONE diff --git a/src/test/blk_non_zero/out17.log.match b/src/test/blk_non_zero/out17.log.match deleted file mode 100644 index cf79b7981af..00000000000 --- a/src/test/blk_non_zero/out17.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST17: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080329 -is zeroed: 1 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_non_zero$(nW)TEST17: DONE diff --git a/src/test/blk_non_zero/out18.log.match b/src/test/blk_non_zero/out18.log.match deleted file mode 100644 index 37e05f61523..00000000000 --- a/src/test/blk_non_zero/out18.log.match +++ /dev/null @@ -1,29 +0,0 @@ -blk_non_zero$(nW)/TEST18: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080329 -is zeroed: 1 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_non_zero$(nW)TEST18: DONE diff --git a/src/test/blk_non_zero/out19.log.match b/src/test/blk_non_zero/out19.log.match deleted file mode 100644 index 70bb28857bf..00000000000 --- a/src/test/blk_non_zero/out19.log.match +++ /dev/null @@ -1,24 +0,0 @@ -blk_non_zero$(nW)TEST19: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080329 -is zeroed: 1 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_non_zero$(nW)TEST19: DONE diff --git a/src/test/blk_non_zero/out2.log.match b/src/test/blk_non_zero/out2.log.match deleted file mode 100644 index 996851fc1b5..00000000000 --- a/src/test/blk_non_zero/out2.log.match +++ /dev/null @@ -1,13 +0,0 @@ -blk_non_zero$(nW)TEST2: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 o w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 -512 block size 512 usable blocks 2080567 -is zeroed: 0 -write lba 0: {1} -read lba 4: {5} -read lba 3: {4} -read lba 2: {3} -read lba 1: {2} -read lba 0: {1} -write lba 0: {2} -read lba 0: {2} -blk_non_zero$(nW)TEST2: DONE diff --git a/src/test/blk_non_zero/out3.log.match b/src/test/blk_non_zero/out3.log.match deleted file mode 100644 index 53dab57c91d..00000000000 --- a/src/test/blk_non_zero/out3.log.match +++ /dev/null @@ -1,29 +0,0 @@ -blk_non_zero$(nW)TEST3: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080567 -is zeroed: 0 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_non_zero$(nW)TEST3: DONE diff --git a/src/test/blk_non_zero/out4.log.match b/src/test/blk_non_zero/out4.log.match deleted file mode 100644 index 1c6803f2ef3..00000000000 --- a/src/test/blk_non_zero/out4.log.match +++ /dev/null @@ -1,24 +0,0 @@ -blk_non_zero$(nW)TEST4: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080567 -is zeroed: 0 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_non_zero$(nW)TEST4: DONE diff --git a/src/test/blk_non_zero/out5.log.match b/src/test/blk_non_zero/out5.log.match deleted file mode 100644 index f521864ce17..00000000000 --- a/src/test/blk_non_zero/out5.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST5: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N)$(S) r:0 r:1 r:32312 r:32313 z:0 z:1 r:0 -512 block size 512 usable blocks 32313 -is zeroed: 1 -read lba 0: {0} -read lba 1: {0} -read lba 32312: {0} -read lba 32313: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -blk_non_zero$(nW)TEST5: DONE diff --git a/src/test/blk_non_zero/out6.log.match b/src/test/blk_non_zero/out6.log.match deleted file mode 100644 index 9fef569d1db..00000000000 --- a/src/test/blk_non_zero/out6.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_non_zero$(nW)TEST6: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080567 -is zeroed: 1 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_non_zero$(nW)TEST6: DONE diff --git a/src/test/blk_non_zero/out7.log.match b/src/test/blk_non_zero/out7.log.match deleted file mode 100644 index f1a9a8c31aa..00000000000 --- a/src/test/blk_non_zero/out7.log.match +++ /dev/null @@ -1,29 +0,0 @@ -blk_non_zero$(nW)TEST7: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080567 -is zeroed: 1 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_non_zero$(nW)TEST7: DONE diff --git a/src/test/blk_non_zero/out8.log.match b/src/test/blk_non_zero/out8.log.match deleted file mode 100644 index f32beb3e3b9..00000000000 --- a/src/test/blk_non_zero/out8.log.match +++ /dev/null @@ -1,24 +0,0 @@ -blk_non_zero$(nW)TEST8: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c $(N) e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080567 -is zeroed: 1 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_non_zero$(nW)TEST8: DONE diff --git a/src/test/blk_non_zero/out9.log.match b/src/test/blk_non_zero/out9.log.match deleted file mode 100644 index 49234de7037..00000000000 --- a/src/test/blk_non_zero/out9.log.match +++ /dev/null @@ -1,24 +0,0 @@ -blk_non_zero$(nW)TEST9: START: blk_non_zero - $(nW)blk_non_zero$(nW) 512 $(nW)testfile1 c 0 e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 259784 -is zeroed: 0 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_non_zero$(nW)TEST9: DONE diff --git a/src/test/blk_pool/.gitignore b/src/test/blk_pool/.gitignore deleted file mode 100644 index 084a4b7590c..00000000000 --- a/src/test/blk_pool/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_pool diff --git a/src/test/blk_pool/Makefile b/src/test/blk_pool/Makefile deleted file mode 100644 index 154c0378065..00000000000 --- a/src/test/blk_pool/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2023, Intel Corporation - -# -# src/test/blk_pool/Makefile -- build blk_pool unit test -# -TARGET = blk_pool -OBJS = blk_pool.o - -LIBPMEMBLK=y -USE_PMEMSPOIL=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_pool/README b/src/test/blk_pool/README deleted file mode 100644 index 6a7375077b3..00000000000 --- a/src/test/blk_pool/README +++ /dev/null @@ -1,78 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_pool/README. - -This directory contains a unit test for pmemblk_create() and pmemblk_open(). - -The program in blk_pool.c takes: operation, path, bsize, poolsize, mode -Operation can be: - c - create - o - open - f - do fault injection - -"poolsize and "mode" arguments are ignored if operation is "open". - -For example: - - ./blk_pool c /my/file 4096 20 0640 - -This calls pmemblk_create() with the given arguments. Note that poolsize -is given in megabytes. - -Test cases: - -- pmemblk_create: - -TEST0 (pass) non-existing file, poolsize >= min required size, bsize >= min blk size, fault_injection == 1 -TEST1 (pass) existing file, file length >= min required size, poolsize == 0, bsize >= min blk size -TEST2 (fail) non-existing file, poolsize == 0, bsize >= min blk size -TEST3 (fail) existing file, file length >= min required size, poolsize != 0, bsize >= min blk size -TEST4 (fail) existing file, file length < min required size, poolsize == 0, bsize >= min blk size -TEST5 (fail) non-existing file, poolsize >= min required size, bsize >= min blk size - path is invalid, directory does not exist -TEST6 (fail) existing file, file length >= min required size, poolsize == 0, bsize == 0 -TEST7 (fail) existing file, file length >= min required size, poolsize == 0, bsize >= min blk size - file contains garbage -TEST8 (pass) existing file, file length >= min required size, poolsize == 0, bsize >= min blk size - file contains garbage, except for header -TEST9 (fail) non-existing file, poolsize < min required size, bsize >= min blk size -TEST10 (fail) existing file, file length >= min required size, poolsize == 0, bsize >= min blk size - no read permissions -TEST11 (fail) existing file, file length >= min required size, poolsize == 0, bsize >= min blk size - no write permissions -TEST12 (fail) non-existing file, poolsize >= min required size, bsize == 0 -TEST13 (pass) non-existing file, poolsize >= min required size, bsize < min blk size -TEST14 (fail) non-existing file, poolsize >= min required size, bsize > min blk size - block size is too large -TEST15 (pass) non-existing file, poolsize >= min required size, bsize < min blk size - pool set -TEST16 (fail) non-existing file, poolsize >= min required size, bsize < min blk size - pool set with replica section - -- pmemblk_open: - -TEST20 (fail) non-existing file, bsize == 0 -TEST21 (fail) existing file, file length < min required size, bsize == 0 -TEST22 (fail) existing file, file length < min required size, bsize == 0 - valid pool header -TEST23 (fail) existing file, file length >= min required size, bsize == 0 - empty pool header -TEST24 (fail) existing file, file length >= min required size, bsize == 1024 - bsize doesn't match the value from pool header -TEST25 (fail) existing file, file length >= min required size, bsize == 0 - no read permissions -TEST26 (fail) existing file, file length >= min required size, bsize == 0 - no write permissions -TEST27 (pass) existing file, file length >= min required size, bsize == 0 -TEST28 (pass) existing file, file length >= min required size, bsize == 300 - bsize matches the value from pool header -TEST29 (pass) existing file, file length >= min required size, bsize == 300 - bsize matches the value from pool header - pool set -TEST30 (fail) existing file, file length >= min required size, bsize == 300 - bsize matches the value from pool header - pool set with replica section - -- each case outputs: - - error, if error happened - - resulting file size, nblocks, mode, consistency check results diff --git a/src/test/blk_pool/TEST0 b/src/test/blk_pool/TEST0 deleted file mode 100755 index 6a7e3aab087..00000000000 --- a/src/test/blk_pool/TEST0 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST0 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -# -# TEST0 non-existing file, poolsize > 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX f $DIR/testfile 4096 20 0600 - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST1 b/src/test/blk_pool/TEST1 deleted file mode 100755 index ca6d595274e..00000000000 --- a/src/test/blk_pool/TEST1 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST1 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -create_holey_file 40M $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST1 existing file, file length >= min required size, poolsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST10 b/src/test/blk_pool/TEST10 deleted file mode 100755 index adaae4dbeee..00000000000 --- a/src/test/blk_pool/TEST10 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST10 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0240 $DIR/testfile - -# -# TEST10 existing file, file length >= min required size, poolsize > 0 -# (no read permissions) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 20 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST11 b/src/test/blk_pool/TEST11 deleted file mode 100755 index 6bc56c32bd3..00000000000 --- a/src/test/blk_pool/TEST11 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST11 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0440 $DIR/testfile - -# -# TEST11 existing file, file length >= min required size, poolsize > 0 -# (no write permissions) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 20 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST12 b/src/test/blk_pool/TEST12 deleted file mode 100755 index e5c3bb9e67f..00000000000 --- a/src/test/blk_pool/TEST12 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST12 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST12 non-existing file, poolsize >= min required size, bsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 0 20 0640 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST13 b/src/test/blk_pool/TEST13 deleted file mode 100755 index 4e33e4ac57d..00000000000 --- a/src/test/blk_pool/TEST13 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST13 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -# -# TEST13 non-existing file, poolsize >= min required size, bsize < min bsize -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 10 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST14 b/src/test/blk_pool/TEST14 deleted file mode 100755 index bfde7add7a1..00000000000 --- a/src/test/blk_pool/TEST14 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST14 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST14 non-existing file, poolsize >= min required size, bsize > min bsize -# block size is too large -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile $((64*1024)) 20 0640 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST15 b/src/test/blk_pool/TEST15 deleted file mode 100755 index b29708f2836..00000000000 --- a/src/test/blk_pool/TEST15 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/blk_pool/TEST15 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -# -# TEST15 non-existing file, poolsize >= min required size, bsize > min bsize -# (pool set) -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x 20M:$DIR/testfile2:x - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0640 - -check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 - -check - -pass diff --git a/src/test/blk_pool/TEST16 b/src/test/blk_pool/TEST16 deleted file mode 100755 index b8436db9d0d..00000000000 --- a/src/test/blk_pool/TEST16 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/blk_pool/TEST16 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST16 non-existing file, poolsize >= min required size, bsize > min bsize -# (pool set with replica section) -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x R 20M:$DIR/testfile2:x - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0600 - -check_files $DIR/testset -check_no_files $DIR/testfile1 $DIR/testfile2 - -check - -pass diff --git a/src/test/blk_pool/TEST17 b/src/test/blk_pool/TEST17 deleted file mode 100755 index 85d4ec13d1f..00000000000 --- a/src/test/blk_pool/TEST17 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_pool/TEST17 -- unit test for pmemblk_create with unicode -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -# -# TEST0 non-existing file, poolsize > 0 -# - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/ㅹestㆅile 4096 20 0600 - -check_files $DIR/ㅹestㆅile - -check - -pass diff --git a/src/test/blk_pool/TEST2 b/src/test/blk_pool/TEST2 deleted file mode 100755 index 394b0822f39..00000000000 --- a/src/test/blk_pool/TEST2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST2 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST2 non-existing file, poolsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0640 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST20 b/src/test/blk_pool/TEST20 deleted file mode 100755 index 9f4144dd119..00000000000 --- a/src/test/blk_pool/TEST20 +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST20 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST20 non-existing file, bsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST21 b/src/test/blk_pool/TEST21 deleted file mode 100755 index 0d068e1e8cd..00000000000 --- a/src/test/blk_pool/TEST21 +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST21 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 1M $DIR/testfile - -# -# TEST21 existing file, file size < min required size, bsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST22 b/src/test/blk_pool/TEST22 deleted file mode 100755 index d6b62b0ebbf..00000000000 --- a/src/test/blk_pool/TEST22 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST22 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST22 existing file, file size < min required size, bsize == 0 -# (valid pool header) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 512 20 0640 -truncate -s 1M $DIR/testfile - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST23 b/src/test/blk_pool/TEST23 deleted file mode 100755 index 049c03fb3f8..00000000000 --- a/src/test/blk_pool/TEST23 +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST23 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 20M $DIR/testfile - -# -# TEST23 existing file, file size >= min required size, bsize == 0 -# (empty pool header) -# -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST24 b/src/test/blk_pool/TEST24 deleted file mode 100755 index d55dcd9273f..00000000000 --- a/src/test/blk_pool/TEST24 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST24 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST24 existing file, file size >= min required size, bsize == 1024 -# (bsize doesn't match the value from pool header) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 512 20 0640 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 1024 - -check - -pass diff --git a/src/test/blk_pool/TEST25 b/src/test/blk_pool/TEST25 deleted file mode 100755 index 157fa3d914b..00000000000 --- a/src/test/blk_pool/TEST25 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST25 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -# -# TEST25 existing file, file size >= min required size, bsize == 0 -# (no read permissions) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 512 20 0640 -chmod -r $DIR/testfile - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST26 b/src/test/blk_pool/TEST26 deleted file mode 100755 index a12df131f35..00000000000 --- a/src/test/blk_pool/TEST26 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST26 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -# -# TEST26 existing file, file size >= min required size, bsize == 0 -# (no write permissions) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 512 20 0640 -chmod -w $DIR/testfile - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST27 b/src/test/blk_pool/TEST27 deleted file mode 100755 index 1faf97dc260..00000000000 --- a/src/test/blk_pool/TEST27 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST27 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST27 existing file, file size >= min required size, bsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 512 20 0640 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 0 - -check - -pass diff --git a/src/test/blk_pool/TEST28 b/src/test/blk_pool/TEST28 deleted file mode 100755 index 247f1f85f57..00000000000 --- a/src/test/blk_pool/TEST28 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST28 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST28 existing file, file size >= min required size, bsize == 300 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 300 20 0640 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testfile 300 - -check - -pass diff --git a/src/test/blk_pool/TEST29 b/src/test/blk_pool/TEST29 deleted file mode 100755 index 2cc51652c87..00000000000 --- a/src/test/blk_pool/TEST29 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/blk_pool/TEST29 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST29 existing file, file size >= min required size, bsize == 300 -# (pool set) -# -create_poolset $DIR/testset 20M:$DIR/testfile1 20M:$DIR/testfile2 - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 300 0 0640 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testset 300 - -check - -pass diff --git a/src/test/blk_pool/TEST3 b/src/test/blk_pool/TEST3 deleted file mode 100755 index 6e60d368942..00000000000 --- a/src/test/blk_pool/TEST3 +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST3 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0640 $DIR/testfile - -# -# TEST3 existing file, file length >= min required size, poolsize > 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 20 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST30 b/src/test/blk_pool/TEST30 deleted file mode 100755 index 5dfe9f901cc..00000000000 --- a/src/test/blk_pool/TEST30 +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/blk_pool/TEST30 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST30 existing file, file size >= min required size, bsize == 300 -# (pool set with replica section) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile1 300 20 0640 - -cp $DIR/testfile1 $DIR/testfile2 - -$PMEMSPOIL $DIR/testfile1 pool_hdr.uuid=1111111111111111 \ - pool_hdr.next_part_uuid=1111111111111111 \ - pool_hdr.prev_part_uuid=1111111111111111 \ - pool_hdr.next_repl_uuid=2222222222222222 \ - pool_hdr.prev_repl_uuid=2222222222222222 \ - "pool_hdr.f:checksum_gen" - -$PMEMSPOIL $DIR/testfile2 pool_hdr.uuid=2222222222222222 \ - pool_hdr.next_part_uuid=2222222222222222 \ - pool_hdr.prev_part_uuid=2222222222222222 \ - pool_hdr.next_repl_uuid=1111111111111111 \ - pool_hdr.prev_repl_uuid=1111111111111111 \ - "pool_hdr.f:checksum_gen" - -create_poolset $DIR/testset 20M:$DIR/testfile1 R 20M:$DIR/testfile2 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testset 300 - -check - -pass diff --git a/src/test/blk_pool/TEST31 b/src/test/blk_pool/TEST31 deleted file mode 100755 index eac9b91a7cb..00000000000 --- a/src/test/blk_pool/TEST31 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_pool/TEST31 -- unit test for pmemblk_open with unicode -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST31 existing file, file size >= min required size, layout matches -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/ㅹestㆅile 4096 20 0640 - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/ㅹestㆅile 4096 - -check - -pass diff --git a/src/test/blk_pool/TEST32 b/src/test/blk_pool/TEST32 deleted file mode 100755 index 71228373f85..00000000000 --- a/src/test/blk_pool/TEST32 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_pool/TEST32 -- unit test for blk poolsets with unicode -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type non-pmem - -setup -umask 0 - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile⮸ 300 20 0640 - -cp $DIR/testfile⮸ $DIR/testfileⰊ - -create_poolset $DIR/testsetㅓㅹ 20M:$DIR/testfile⮸ R 20M:$DIR/testfileⰊ - -expect_normal_exit ./blk_pool$EXESUFFIX o $DIR/testsetㅓㅹ 300 - -check - -pass diff --git a/src/test/blk_pool/TEST33 b/src/test/blk_pool/TEST33 deleted file mode 100755 index b89d635a288..00000000000 --- a/src/test/blk_pool/TEST33 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_pool/TEST33 -- create a pool with the smallest parts -# possible -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -# -# TEST33 non-existing file, poolsize >= min required size, bsize > min bsize -# part size == min part size (pool set) -# -CMD="$DIR/testset" -MIN_PART=$((2 * 1024 * 1024)) # 2MiB -for i in {1..9}; do - CMD="$CMD $MIN_PART:$DIR/testfile$i:x" -done -create_poolset $CMD - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0640 - -check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 $DIR/testfile3 \ - $DIR/testfile4 $DIR/testfile5 $DIR/testfile6 $DIR/testfile7 $DIR/testfile8 \ - $DIR/testfile9 - -check - -pass diff --git a/src/test/blk_pool/TEST34 b/src/test/blk_pool/TEST34 deleted file mode 100755 index c26bd96fbd0..00000000000 --- a/src/test/blk_pool/TEST34 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_pool/TEST34 -- unit test for pmemblk_create -# -# This test is equivalent of TEST0 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -# -# TEST34 non-existing file, poolsize > 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX f $DIR/testfile 4096 20 0600 - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST35 b/src/test/blk_pool/TEST35 deleted file mode 100755 index 533c9e074df..00000000000 --- a/src/test/blk_pool/TEST35 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST35 -- unit test for pmemblk_create -# -# This test is equivalent of TEST1 for ppc64le platform -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -create_holey_file 40M $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST35 existing file, file length >= min required size, poolsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST36 b/src/test/blk_pool/TEST36 deleted file mode 100755 index 0051aba4400..00000000000 --- a/src/test/blk_pool/TEST36 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST36 -- unit test for pmemblk_create -# -# This test is equivalent of TEST8 for ppc64le platform -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -create_nonzeroed_file 17M 8K $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST36 existing file, file length >= min required size, poolsize == 0 -# (file contains garbage, except for header) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST37 b/src/test/blk_pool/TEST37 deleted file mode 100755 index cd55f0f5ade..00000000000 --- a/src/test/blk_pool/TEST37 +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_pool/TEST37 -- unit test for pmemblk_create -# -# This test is equivalent of TEST13 for ppc64le platform -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -# -# TEST37 non-existing file, poolsize >= min required size, bsize < min bsize -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 10 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST38 b/src/test/blk_pool/TEST38 deleted file mode 100755 index 0b1fc5fbfc6..00000000000 --- a/src/test/blk_pool/TEST38 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_pool/TEST38 -- unit test for pmemblk_create -# -# This test is equivalent of TEST15 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -# -# TEST38 non-existing file, poolsize >= min required size, bsize > min bsize -# (pool set) -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x 20M:$DIR/testfile2:x - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0640 - -check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 - -check - -pass diff --git a/src/test/blk_pool/TEST39 b/src/test/blk_pool/TEST39 deleted file mode 100755 index 7f02b2709ed..00000000000 --- a/src/test/blk_pool/TEST39 +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_pool/TEST39 -- unit test for pmemblk_create with unicode -# -# This test is equivalent of TEST17 for ppc64le platform -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -# -# TEST39 non-existing file, poolsize > 0 -# - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/ㅹestㆅile 4096 20 0600 - -check_files $DIR/ㅹestㆅile - -check - -pass diff --git a/src/test/blk_pool/TEST4 b/src/test/blk_pool/TEST4 deleted file mode 100755 index e04220de459..00000000000 --- a/src/test/blk_pool/TEST4 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST4 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -touch $DIR/testfile -chmod 0640 $DIR/testfile - -# -# TEST4 existing file, file length < min required size, poolsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST40 b/src/test/blk_pool/TEST40 deleted file mode 100755 index 33bad780cd6..00000000000 --- a/src/test/blk_pool/TEST40 +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_pool/TEST40 -- create a pool with the smallest parts -# possible -# -# This test is equivalent of TEST33 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -setup -umask 0 - -# -# TEST40 non-existing file, poolsize >= min required size, bsize > min bsize -# part size == min part size (pool set) -# -CMD="$DIR/testset" -MIN_PART=$((2 * 1024 * 1024)) # 2MiB -for i in {1..9}; do - CMD="$CMD $MIN_PART:$DIR/testfile$i:x" -done -create_poolset $CMD - -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0640 - -check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 $DIR/testfile3 \ - $DIR/testfile4 $DIR/testfile5 $DIR/testfile6 $DIR/testfile7 $DIR/testfile8 \ - $DIR/testfile9 - -check - -pass diff --git a/src/test/blk_pool/TEST5 b/src/test/blk_pool/TEST5 deleted file mode 100755 index 86c301f5af2..00000000000 --- a/src/test/blk_pool/TEST5 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST5 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST5 non-existing file, poolsize > 0 -# path is invalid (directory not exist) -# -expect_normal_exit ./blk_pool$EXESUFFIX c /NULL/testfile 4096 20 0640 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST6 b/src/test/blk_pool/TEST6 deleted file mode 100755 index 57748c0c9fb..00000000000 --- a/src/test/blk_pool/TEST6 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST6 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -touch $DIR/testfile -chmod 0640 $DIR/testfile - -# -# TEST6 existing file, file length < min required size, poolsize == 0, -# bsize == 0 -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 0 0 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST7 b/src/test/blk_pool/TEST7 deleted file mode 100755 index 9da036bc813..00000000000 --- a/src/test/blk_pool/TEST7 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST7 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_nonzeroed_file 17M 0K $DIR/testfile -chmod 0640 $DIR/testfile - -# -# TEST7 existing file, file length >= min required size, poolsize == 0 -# (file contains garbage) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0640 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST8 b/src/test/blk_pool/TEST8 deleted file mode 100755 index c3d774dab77..00000000000 --- a/src/test/blk_pool/TEST8 +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_pool/TEST8 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -setup -umask 0 - -create_nonzeroed_file 17M 8K $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST8 existing file, file length >= min required size, poolsize == 0 -# (file contains garbage, except for header) -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/TEST9 b/src/test/blk_pool/TEST9 deleted file mode 100755 index 54628a793f4..00000000000 --- a/src/test/blk_pool/TEST9 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool/TEST9 -- unit test for pmemblk_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST9 non-existing file, poolsize < min required size -# -expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testfile 4096 1 0640 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/blk_pool/blk_pool.c b/src/test/blk_pool/blk_pool.c deleted file mode 100644 index c834b3746a8..00000000000 --- a/src/test/blk_pool/blk_pool.c +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2019, Intel Corporation */ - -/* - * blk_pool.c -- unit test for pmemblk_create() and pmemblk_open() - * - * usage: blk_pool op path bsize [poolsize mode] - * - * op can be: - * c - create - * o - open - * f - do fault injection - * - * "poolsize" and "mode" arguments are ignored for "open" - */ -#include "unittest.h" -#include "../libpmemblk/blk.h" - -#define MB ((size_t)1 << 20) - -static void -do_fault_injection(const char *path, size_t bsize, - size_t poolsize, unsigned mode) -{ - if (!pmemblk_fault_injection_enabled()) - return; - - pmemblk_inject_fault_at(PMEM_MALLOC, 1, "blk_runtime_init"); - PMEMblkpool *pbp = pmemblk_create(path, bsize, poolsize, mode); - UT_ASSERTeq(pbp, NULL); - UT_ASSERTeq(errno, ENOMEM); -} - -static void -pool_create(const char *path, size_t bsize, size_t poolsize, unsigned mode) -{ - PMEMblkpool *pbp = pmemblk_create(path, bsize, poolsize, mode); - - if (pbp == NULL) - UT_OUT("!%s: pmemblk_create", path); - else { - os_stat_t stbuf; - STAT(path, &stbuf); - - UT_OUT("%s: file size %zu usable blocks %zu mode 0%o", - path, stbuf.st_size, - pmemblk_nblock(pbp), - stbuf.st_mode & 0777); - - pmemblk_close(pbp); - - int result = pmemblk_check(path, bsize); - - if (result < 0) - UT_OUT("!%s: pmemblk_check", path); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", path); - else - UT_ASSERTeq(pmemblk_check(path, bsize * 2), -1); - } -} - -static void -pool_open(const char *path, size_t bsize) -{ - PMEMblkpool *pbp = pmemblk_open(path, bsize); - if (pbp == NULL) - UT_OUT("!%s: pmemblk_open", path); - else { - UT_OUT("%s: pmemblk_open: Success", path); - pmemblk_close(pbp); - } -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_pool"); - - if (argc < 4) - UT_FATAL("usage: %s op path bsize [poolsize mode]", argv[0]); - - size_t bsize = strtoul(argv[3], NULL, 0); - size_t poolsize; - unsigned mode; - - switch (argv[1][0]) { - case 'c': - poolsize = strtoul(argv[4], NULL, 0) * MB; /* in megabytes */ - mode = strtoul(argv[5], NULL, 8); - - pool_create(argv[2], bsize, poolsize, mode); - break; - - case 'o': - pool_open(argv[2], bsize); - break; - case 'f': - poolsize = strtoul(argv[4], NULL, 0) * MB; /* in megabytes */ - mode = strtoul(argv[5], NULL, 8); - - do_fault_injection(argv[2], bsize, poolsize, mode); - break; - - default: - UT_FATAL("unknown operation"); - } - - DONE(NULL); -} diff --git a/src/test/blk_pool/out0.log.match b/src/test/blk_pool/out0.log.match deleted file mode 100644 index 9f75b54f27a..00000000000 --- a/src/test/blk_pool/out0.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST0: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0600 -$(nW)testfile: file size 20971520 usable blocks 4850 mode 0600 -blk_pool$(nW)TEST0: DONE diff --git a/src/test/blk_pool/out1.log.match b/src/test/blk_pool/out1.log.match deleted file mode 100644 index fe981afb797..00000000000 --- a/src/test/blk_pool/out1.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST1: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0600 -$(nW)testfile: file size 41943040 usable blocks 9965 mode 0600 -blk_pool$(nW)TEST1: DONE diff --git a/src/test/blk_pool/out10.log.match b/src/test/blk_pool/out10.log.match deleted file mode 100644 index 0429dab9d6a..00000000000 --- a/src/test/blk_pool/out10.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST10: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0640 -$(nW)testfile: pmemblk_create: File exists -blk_pool$(nW)TEST10: DONE diff --git a/src/test/blk_pool/out11.log.match b/src/test/blk_pool/out11.log.match deleted file mode 100644 index b73ae085544..00000000000 --- a/src/test/blk_pool/out11.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST11: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0640 -$(nW)testfile: pmemblk_create: File exists -blk_pool$(nW)TEST11: DONE diff --git a/src/test/blk_pool/out12.log.match b/src/test/blk_pool/out12.log.match deleted file mode 100644 index dd3f8688a8e..00000000000 --- a/src/test/blk_pool/out12.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST12: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 0 20 0640 -$(nW)testfile: pmemblk_create: Invalid argument -blk_pool$(nW)TEST12: DONE diff --git a/src/test/blk_pool/out13.log.match b/src/test/blk_pool/out13.log.match deleted file mode 100644 index f6275ad2753..00000000000 --- a/src/test/blk_pool/out13.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST13: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 10 20 0600 -$(nW)testfile: file size 20971520 usable blocks 40315 mode 0600 -blk_pool$(nW)TEST13: DONE diff --git a/src/test/blk_pool/out14.log.match b/src/test/blk_pool/out14.log.match deleted file mode 100644 index 4d077478753..00000000000 --- a/src/test/blk_pool/out14.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST14: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 65536 20 0640 -$(nW)testfile: pmemblk_create: Invalid argument -blk_pool$(nW)TEST14: DONE diff --git a/src/test/blk_pool/out15.log.match b/src/test/blk_pool/out15.log.match deleted file mode 100644 index 64b62a700eb..00000000000 --- a/src/test/blk_pool/out15.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST15: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testset 100 0 0640 -$(nW)testset: file size $(N) usable blocks 80949 mode 0666 -blk_pool$(nW)TEST15: DONE diff --git a/src/test/blk_pool/out16.log.match b/src/test/blk_pool/out16.log.match deleted file mode 100644 index 14f68e01ed7..00000000000 --- a/src/test/blk_pool/out16.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST16: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testset 100 0 0600 -$(nW)testset: pmemblk_create: $(*) -blk_pool$(nW)TEST16: DONE diff --git a/src/test/blk_pool/out17.log.match b/src/test/blk_pool/out17.log.match deleted file mode 100644 index f0cf9b9fb7e..00000000000 --- a/src/test/blk_pool/out17.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST17: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)ㅹestㆅile 4096 20 0600 -$(nW)ㅹestㆅile: file size 20971520 usable blocks 4850 mode 0600 -blk_pool$(nW)TEST17: DONE diff --git a/src/test/blk_pool/out2.log.match b/src/test/blk_pool/out2.log.match deleted file mode 100644 index 63fd19b8d2a..00000000000 --- a/src/test/blk_pool/out2.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST2: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0640 -$(nW)testfile: pmemblk_create: No such file or directory -blk_pool$(nW)TEST2: DONE diff --git a/src/test/blk_pool/out20.log.match b/src/test/blk_pool/out20.log.match deleted file mode 100644 index ad06e7949a6..00000000000 --- a/src/test/blk_pool/out20.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST20: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: No such file or directory -blk_pool$(nW)TEST20: DONE diff --git a/src/test/blk_pool/out21.log.match b/src/test/blk_pool/out21.log.match deleted file mode 100644 index 86984205016..00000000000 --- a/src/test/blk_pool/out21.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST21: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Invalid argument -blk_pool$(nW)TEST21: DONE diff --git a/src/test/blk_pool/out22.log.match b/src/test/blk_pool/out22.log.match deleted file mode 100644 index 1e0a75eb93f..00000000000 --- a/src/test/blk_pool/out22.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST22: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Invalid argument -blk_pool$(nW)TEST22: DONE diff --git a/src/test/blk_pool/out23.log.match b/src/test/blk_pool/out23.log.match deleted file mode 100644 index 728f0b15e59..00000000000 --- a/src/test/blk_pool/out23.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST23: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Invalid argument -blk_pool$(nW)TEST23: DONE diff --git a/src/test/blk_pool/out24.log.match b/src/test/blk_pool/out24.log.match deleted file mode 100644 index 93191088d40..00000000000 --- a/src/test/blk_pool/out24.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST24: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 1024 -$(nW)testfile: pmemblk_open: Invalid argument -blk_pool$(nW)TEST24: DONE diff --git a/src/test/blk_pool/out25.log.match b/src/test/blk_pool/out25.log.match deleted file mode 100644 index 7995d7cb8a7..00000000000 --- a/src/test/blk_pool/out25.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST25: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Permission denied -blk_pool$(nW)TEST25: DONE diff --git a/src/test/blk_pool/out26.log.match b/src/test/blk_pool/out26.log.match deleted file mode 100644 index b5e4955c557..00000000000 --- a/src/test/blk_pool/out26.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST26: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Permission denied -blk_pool$(nW)TEST26: DONE diff --git a/src/test/blk_pool/out27.log.match b/src/test/blk_pool/out27.log.match deleted file mode 100644 index 61e08172276..00000000000 --- a/src/test/blk_pool/out27.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST27: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 0 -$(nW)testfile: pmemblk_open: Success -blk_pool$(nW)TEST27: DONE diff --git a/src/test/blk_pool/out28.log.match b/src/test/blk_pool/out28.log.match deleted file mode 100644 index a8dd19b3118..00000000000 --- a/src/test/blk_pool/out28.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST28: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testfile 300 -$(nW)testfile: pmemblk_open: Success -blk_pool$(nW)TEST28: DONE diff --git a/src/test/blk_pool/out29.log.match b/src/test/blk_pool/out29.log.match deleted file mode 100644 index ec09572fe12..00000000000 --- a/src/test/blk_pool/out29.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST29: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testset 300 -$(nW)testset: pmemblk_open: Success -blk_pool$(nW)TEST29: DONE diff --git a/src/test/blk_pool/out3.log.match b/src/test/blk_pool/out3.log.match deleted file mode 100644 index b1262ca122d..00000000000 --- a/src/test/blk_pool/out3.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST3: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0640 -$(nW)testfile: pmemblk_create: File exists -blk_pool$(nW)TEST3: DONE diff --git a/src/test/blk_pool/out30.log.match b/src/test/blk_pool/out30.log.match deleted file mode 100644 index dac1b3ec9a1..00000000000 --- a/src/test/blk_pool/out30.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST30: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testset 300 -$(nW)testset: pmemblk_open: Operation not supported -blk_pool$(nW)TEST30: DONE diff --git a/src/test/blk_pool/out31.log.match b/src/test/blk_pool/out31.log.match deleted file mode 100644 index 710f5396109..00000000000 --- a/src/test/blk_pool/out31.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST31: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)ㅹestㆅile 4096 -$(nW)ㅹestㆅile: pmemblk_open: Success -blk_pool$(nW)TEST31: DONE diff --git a/src/test/blk_pool/out32.log.match b/src/test/blk_pool/out32.log.match deleted file mode 100644 index 6bd6a03ffd5..00000000000 --- a/src/test/blk_pool/out32.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST32: START: blk_pool$(nW) - $(nW)blk_pool$(nW) o $(nW)testsetㅓㅹ 300 -$(nW)testsetㅓㅹ: pmemblk_open: Operation not supported -blk_pool$(nW)TEST32: DONE diff --git a/src/test/blk_pool/out33.log.match b/src/test/blk_pool/out33.log.match deleted file mode 100644 index 15ca1be56c0..00000000000 --- a/src/test/blk_pool/out33.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST33: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testset 100 0 0640 -$(nW)testset: file size $(N) usable blocks 36187 mode 0666 -blk_pool$(nW)TEST33: DONE diff --git a/src/test/blk_pool/out34.log.match b/src/test/blk_pool/out34.log.match deleted file mode 100644 index 598b87ba26d..00000000000 --- a/src/test/blk_pool/out34.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST34: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0600 -$(nW)testfile: file size 20971520 usable blocks 4820 mode 0600 -blk_pool$(nW)TEST34: DONE diff --git a/src/test/blk_pool/out35.log.match b/src/test/blk_pool/out35.log.match deleted file mode 100644 index 923fbc8aea5..00000000000 --- a/src/test/blk_pool/out35.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST35: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0600 -$(nW)testfile: file size 41943040 usable blocks 9935 mode 0600 -blk_pool$(nW)TEST35: DONE diff --git a/src/test/blk_pool/out36.log.match b/src/test/blk_pool/out36.log.match deleted file mode 100644 index de00fda108f..00000000000 --- a/src/test/blk_pool/out36.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST36: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0600 -$(nW)testfile: pmemblk_create: File exists -blk_pool$(nW)TEST36: DONE diff --git a/src/test/blk_pool/out37.log.match b/src/test/blk_pool/out37.log.match deleted file mode 100644 index 57d75cae472..00000000000 --- a/src/test/blk_pool/out37.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST37: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testfile 10 20 0600 -$(nW)testfile: file size 20971520 usable blocks 40076 mode 0600 -blk_pool$(nW)TEST37: DONE diff --git a/src/test/blk_pool/out38.log.match b/src/test/blk_pool/out38.log.match deleted file mode 100644 index 360d53bdec1..00000000000 --- a/src/test/blk_pool/out38.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST38: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testset 100 0 0640 -$(nW)testset: file size $(N) usable blocks 80592 mode 0666 -blk_pool$(nW)TEST38: DONE diff --git a/src/test/blk_pool/out39.log.match b/src/test/blk_pool/out39.log.match deleted file mode 100644 index 0f254bf2a5a..00000000000 --- a/src/test/blk_pool/out39.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST39: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)ㅹestㆅile 4096 20 0600 -$(nW)ㅹestㆅile: file size 20971520 usable blocks 4820 mode 0600 -blk_pool$(nW)TEST39: DONE diff --git a/src/test/blk_pool/out4.log.match b/src/test/blk_pool/out4.log.match deleted file mode 100644 index cbb6dc1c147..00000000000 --- a/src/test/blk_pool/out4.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST4: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0640 -$(nW)testfile: pmemblk_create: Invalid argument -blk_pool$(nW)TEST4: DONE diff --git a/src/test/blk_pool/out40.log.match b/src/test/blk_pool/out40.log.match deleted file mode 100644 index 60475c683ff..00000000000 --- a/src/test/blk_pool/out40.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST40: START: blk_pool - $(nW)blk_pool$(nW) c $(nW)testset 100 0 0640 -$(nW)testset: file size $(N) usable blocks 34996 mode 0666 -blk_pool$(nW)TEST40: DONE diff --git a/src/test/blk_pool/out5.log.match b/src/test/blk_pool/out5.log.match deleted file mode 100644 index c235a645516..00000000000 --- a/src/test/blk_pool/out5.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST5: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 20 0640 -$(nW)testfile: pmemblk_create: No such file or directory -blk_pool$(nW)TEST5: DONE diff --git a/src/test/blk_pool/out6.log.match b/src/test/blk_pool/out6.log.match deleted file mode 100644 index 21614d723ac..00000000000 --- a/src/test/blk_pool/out6.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST6: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 0 0 0640 -$(nW)testfile: pmemblk_create: Invalid argument -blk_pool$(nW)TEST6: DONE diff --git a/src/test/blk_pool/out7.log.match b/src/test/blk_pool/out7.log.match deleted file mode 100644 index adece4dec22..00000000000 --- a/src/test/blk_pool/out7.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST7: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0640 -$(nW)testfile: pmemblk_create: File exists -blk_pool$(nW)TEST7: DONE diff --git a/src/test/blk_pool/out8.log.match b/src/test/blk_pool/out8.log.match deleted file mode 100644 index 3fe5185db1a..00000000000 --- a/src/test/blk_pool/out8.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST8: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 0 0600 -$(nW)testfile: file size 17825792 usable blocks 4082 mode 0600 -blk_pool$(nW)TEST8: DONE diff --git a/src/test/blk_pool/out9.log.match b/src/test/blk_pool/out9.log.match deleted file mode 100644 index 496f176deb2..00000000000 --- a/src/test/blk_pool/out9.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_pool$(nW)TEST9: START: blk_pool$(nW) - $(nW)blk_pool$(nW) c $(nW)testfile 4096 1 0640 -$(nW)testfile: pmemblk_create: Invalid argument -blk_pool$(nW)TEST9: DONE diff --git a/src/test/blk_pool_lock/.gitignore b/src/test/blk_pool_lock/.gitignore deleted file mode 100644 index a20241fa495..00000000000 --- a/src/test/blk_pool_lock/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_pool_lock diff --git a/src/test/blk_pool_lock/Makefile b/src/test/blk_pool_lock/Makefile deleted file mode 100644 index a8e9a0388e0..00000000000 --- a/src/test/blk_pool_lock/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2023, Intel Corporation - -# -# src/test/blk_pool_lock/Makefile -- build blk_pool_lock unit test -# -TARGET = blk_pool_lock -OBJS = blk_pool_lock.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_pool_lock/TEST0 b/src/test/blk_pool_lock/TEST0 deleted file mode 100755 index c482ad2aa62..00000000000 --- a/src/test/blk_pool_lock/TEST0 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_pool_lock/TEST0 -- unit test for pmemblk_open -# - -. ../unittest/unittest.sh - -require_test_type medium -require_no_superuser - -setup - -expect_normal_exit ./blk_pool_lock$EXESUFFIX $DIR/testfile - -pass diff --git a/src/test/blk_pool_lock/blk_pool_lock.c b/src/test/blk_pool_lock/blk_pool_lock.c deleted file mode 100644 index bb43abda780..00000000000 --- a/src/test/blk_pool_lock/blk_pool_lock.c +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2023, Intel Corporation */ - -/* - * blk_pool_lock.c -- unit test which checks whether it's possible to - * simultaneously open the same blk pool - */ - -#include "unittest.h" - -static void -test_reopen(const char *path) -{ - PMEMblkpool *blk1 = pmemblk_create(path, 4096, PMEMBLK_MIN_POOL, - S_IWUSR | S_IRUSR); - if (!blk1) - UT_FATAL("!create"); - - PMEMblkpool *blk2 = pmemblk_open(path, 4096); - if (blk2) - UT_FATAL("pmemblk_open should not succeed"); - - if (errno != EWOULDBLOCK) - UT_FATAL("!pmemblk_open failed but for unexpected reason"); - - pmemblk_close(blk1); - - blk2 = pmemblk_open(path, 4096); - if (!blk2) - UT_FATAL("pmemobj_open should succeed after close"); - - pmemblk_close(blk2); - - UNLINK(path); -} - -static void -test_open_in_different_process(int argc, char **argv, unsigned sleep) -{ - pid_t pid = fork(); - PMEMblkpool *blk; - char *path = argv[1]; - - if (pid < 0) - UT_FATAL("fork failed"); - - if (pid == 0) { - /* child */ - if (sleep) - usleep(sleep); - while (os_access(path, R_OK)) - usleep(100 * 1000); - - blk = pmemblk_open(path, 4096); - if (blk) - UT_FATAL("pmemblk_open after fork should not succeed"); - - if (errno != EWOULDBLOCK) - UT_FATAL("!pmemblk_open after fork failed but for " - "unexpected reason"); - - exit(0); - } - - blk = pmemblk_create(path, 4096, PMEMBLK_MIN_POOL, - S_IWUSR | S_IRUSR); - if (!blk) - UT_FATAL("!create"); - - int status; - - if (waitpid(pid, &status, 0) < 0) - UT_FATAL("!waitpid failed"); - - if (!WIFEXITED(status)) - UT_FATAL("child process failed"); - - pmemblk_close(blk); - - UNLINK(path); -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_pool_lock"); - - if (argc != 2) { - UT_FATAL("usage: %s path", argv[0]); - } else { - test_reopen(argv[1]); - test_open_in_different_process(argc, argv, 0); - for (unsigned i = 1; i < 100000; i *= 2) - test_open_in_different_process(argc, argv, i); - } - - DONE(NULL); -} diff --git a/src/test/blk_recovery/.gitignore b/src/test/blk_recovery/.gitignore deleted file mode 100644 index 4431b0205e3..00000000000 --- a/src/test/blk_recovery/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_recovery diff --git a/src/test/blk_recovery/Makefile b/src/test/blk_recovery/Makefile deleted file mode 100644 index 55623799e99..00000000000 --- a/src/test/blk_recovery/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/blk_recovery/Makefile -- build blk_recovery unit test -# -TARGET = blk_recovery -OBJS = blk_recovery.o - -LIBPMEMBLK=y - -include ../Makefile.inc -CFLAGS += -I../../libpmemblk - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_recovery/README b/src/test/blk_recovery/README deleted file mode 100644 index 7feb5051254..00000000000 --- a/src/test/blk_recovery/README +++ /dev/null @@ -1,23 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_recovery/README. - -This directory contains a unit test for pmemblk recovery. It works only -in non-debug mode. - -The program in blk_recovery.c takes a block size, file and two LBAs. -A write to the first LBA is performed, then the arena map data structure -protections are modified to be read-only, then the remaining LBA is written. - -For example: - - ./blk_recovery 4096 file1 5 10 - -this will call pmemblk_open() on file1, call pmemblk_write() for LBA 5 -(causing all the layout to be written), then it will change the memory -protection on the arena map area to read-only. Next, pmemblk_write() -is called for for LBA 10 and SIGSEGV is caught and reported. Finally, -pmemblk_check() is called. - -This is not a perfect simulation of a system interruption, but does allow -creating a file where a write was interrupted before updating the map. diff --git a/src/test/blk_recovery/TEST0 b/src/test/blk_recovery/TEST0 deleted file mode 100755 index 3992157b1f6..00000000000 --- a/src/test/blk_recovery/TEST0 +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_recovery/TEST0 -- unit test for pmemblk recovery -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_build_type nondebug static-nondebug - -setup - -# single arena case -truncate -s 2G $DIR/testfile1 - -# -# Simple case, one write interrupted. pmemblk_check() should note -# that testfile1 is consistent (after recovery steps were taken). -# -expect_abnormal_exit ./blk_recovery$EXESUFFIX 4096 $DIR/testfile1 5 10 2>/dev/null -mv out0.log interrupted0.log - -expect_normal_exit ./blk_recovery$EXESUFFIX 4096 $DIR/testfile1 -mv out0.log check0.log - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_recovery/blk_recovery.c b/src/test/blk_recovery/blk_recovery.c deleted file mode 100644 index 37f1071da78..00000000000 --- a/src/test/blk_recovery/blk_recovery.c +++ /dev/null @@ -1,149 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ -/* - * Copyright (c) 2016, Microsoft Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * blk_recovery.c -- unit test for pmemblk recovery - * - * usage: blk_recovery bsize file first_lba lba - * - */ - -#include "unittest.h" - -#include - -#include "blk.h" -#include "btt_layout.h" -#include - -static size_t Bsize; - -/* - * construct -- build a buffer for writing - */ -static void -construct(unsigned char *buf) -{ - static int ord = 1; - - for (int i = 0; i < Bsize; i++) - buf[i] = ord; - - ord++; - - if (ord > 255) - ord = 1; -} - -/* - * ident -- identify what a buffer holds - */ -static char * -ident(unsigned char *buf) -{ - static char descr[100]; - unsigned val = *buf; - - for (int i = 1; i < Bsize; i++) - if (buf[i] != val) { - sprintf(descr, "{%u} TORN at byte %d", val, i); - return descr; - } - - sprintf(descr, "{%u}", val); - return descr; -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_recovery"); - - if (argc != 5 && argc != 3) - UT_FATAL("usage: %s bsize file [first_lba lba]", argv[0]); - - Bsize = strtoul(argv[1], NULL, 0); - const char *path = argv[2]; - - if (argc > 3) { - PMEMblkpool *handle; - if ((handle = pmemblk_create(path, Bsize, 0, - S_IWUSR | S_IRUSR)) == NULL) - UT_FATAL("!%s: pmemblk_create", path); - - UT_OUT("%s block size %zu usable blocks %zu", - argv[1], Bsize, pmemblk_nblock(handle)); - - /* write the first lba */ - os_off_t lba = STRTOL(argv[3], NULL, 0); - unsigned char *buf = MALLOC(Bsize); - - construct(buf); - if (pmemblk_write(handle, buf, lba) < 0) - UT_FATAL("!write lba %zu", lba); - - UT_OUT("write lba %zu: %s", lba, ident(buf)); - - /* reach into the layout and write-protect the map */ - struct btt_info *infop = (void *)((char *)handle + - roundup(sizeof(struct pmemblk), BLK_FORMAT_DATA_ALIGN)); - - char *mapaddr = (char *)infop + le32toh(infop->mapoff); - char *flogaddr = (char *)infop + le32toh(infop->flogoff); - - UT_OUT("write-protecting map, length %zu", - (size_t)(flogaddr - mapaddr)); - MPROTECT(mapaddr, (size_t)(flogaddr - mapaddr), PROT_READ); - - /* map each file argument with the given map type */ - lba = STRTOL(argv[4], NULL, 0); - - construct(buf); - - if (pmemblk_write(handle, buf, lba) < 0) - UT_FATAL("!write lba %zu", lba); - else - UT_FATAL("write lba %zu: %s", lba, ident(buf)); - } else { - int result = pmemblk_check(path, Bsize); - if (result < 0) - UT_OUT("!%s: pmemblk_check", path); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", path); - else - UT_OUT("%s: consistent", path); - } - - DONE(NULL); -} diff --git a/src/test/blk_recovery/check0.log.match b/src/test/blk_recovery/check0.log.match deleted file mode 100644 index c0e9e081b3f..00000000000 --- a/src/test/blk_recovery/check0.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_recovery$(nW)TEST0: START: blk_recovery - $(nW)blk_recovery$(nW) 4096 $(nW)testfile1 -$(nW)testfile1: consistent -blk_recovery$(nW)TEST0: DONE diff --git a/src/test/blk_rw/.gitignore b/src/test/blk_rw/.gitignore deleted file mode 100644 index 25eb07ae885..00000000000 --- a/src/test/blk_rw/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_rw diff --git a/src/test/blk_rw/Makefile b/src/test/blk_rw/Makefile deleted file mode 100644 index e8ecb804079..00000000000 --- a/src/test/blk_rw/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/blk_rw/Makefile -- build blk_rw unit test -# -TARGET = blk_rw -OBJS = blk_rw.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_rw/README b/src/test/blk_rw/README deleted file mode 100644 index f8196017e8c..00000000000 --- a/src/test/blk_rw/README +++ /dev/null @@ -1,19 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_rw/README. - -This directory contains a unit test for pmemblk_read/write/set_zero/set_error. - -The program in blk_rw.c takes a block size, file and a list of -operation:LBA pairs. For example: - - ./blk_rw 4096 file1 r:0 w:5 z:9 e:100 - -this will call pmemblk_open() on file1 and then pmemblk_read() for LBA 0, -pmemblk_write() for LBA 5, pmemblk_set_zero() for LBA 9, and pmem_set_error() -for LAB 100. - -Each block written is filled up with the ordinal number of the write -operation (a block full of 8-bit 1s, then a block filled with 8-bit 2s, -etc.). When a block is read, the number it was filled with is reported -(and the program verifies the entire block is filled with that number). diff --git a/src/test/blk_rw/TEST0 b/src/test/blk_rw/TEST0 deleted file mode 100755 index 243a16c8435..00000000000 --- a/src/test/blk_rw/TEST0 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_rw/TEST0 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# single arena and minimum pmemblk pool file case -MIN_POOL_SIZE=$((16*1024*1024 + 64*1024)) -truncate -s $MIN_POOL_SIZE $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 32313 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST1 b/src/test/blk_rw/TEST1 deleted file mode 100755 index 9d7fa628cd2..00000000000 --- a/src/test/blk_rw/TEST1 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST1 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_unlimited_vm - -# this test creates huge file -configure_valgrind force-disable - -setup - -# multi-arena case -truncate -s 1026G $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 2134997374 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - r:0 r:1 r:4161480 r:2134997325 r:2134997326 z:0 z:4161480 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST10 b/src/test/blk_rw/TEST10 deleted file mode 100755 index b0d9b5cb0e4..00000000000 --- a/src/test/blk_rw/TEST10 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/blk_rw/TEST10 -- unit test for pmemblk_read/write/set_zero/set_error -# -# Same as TEST0, but run on a single Device DAX device. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_devices 1 - -setup - -dax_device_zero - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DEVICE_DAX_PATH c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -check_pool $DEVICE_DAX_PATH - -pass diff --git a/src/test/blk_rw/TEST11 b/src/test/blk_rw/TEST11 deleted file mode 100755 index ed2c44739ba..00000000000 --- a/src/test/blk_rw/TEST11 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_rw/TEST11 -- unit test for pmemblk_read/write/set_zero/set_error -# -# Same as TEST10, but run on a pool set that spans two Device DAX devices -# with 4K alignment. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 4096 4096 - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -check_pool DIR/testset - -pass diff --git a/src/test/blk_rw/TEST12 b/src/test/blk_rw/TEST12 deleted file mode 100755 index dc3280969fa..00000000000 --- a/src/test/blk_rw/TEST12 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_rw/TEST12 -- unit test for pmemblk_read/write/set_zero/set_error -# -# Same as TEST10, but run on a pool set that spans two Device DAX devices -# with 2M alignment. Expected failure, as 2M alignment is not supported -# if NODHRS option is not specified. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 2097152 2097152 # 2MiB - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} - -expect_abnormal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -pass diff --git a/src/test/blk_rw/TEST13 b/src/test/blk_rw/TEST13 deleted file mode 100755 index 85bce41ca46..00000000000 --- a/src/test/blk_rw/TEST13 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/blk_rw/TEST13 -- unit test for pmemblk_read/write/set_zero/set_error -# -# Same as TEST10, but run on a pool set that spans two Device DAX devices -# with 2M alignment. Expected success, as pool is created with SINGLEHDR option. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 2097152 2097152 # 2MiB - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} \ - O SINGLEHDR - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -pass diff --git a/src/test/blk_rw/TEST14 b/src/test/blk_rw/TEST14 deleted file mode 100755 index 9abb6b1799e..00000000000 --- a/src/test/blk_rw/TEST14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# Copyright 2019, IBM Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/blk_rw/TEST14 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST0 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# single arena and minimum pmemblk pool file case -MIN_POOL_SIZE=$((16*1024*1024 + 128*1024)) -truncate -s $MIN_POOL_SIZE $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 32313 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST15 b/src/test/blk_rw/TEST15 deleted file mode 100755 index 2086827b129..00000000000 --- a/src/test/blk_rw/TEST15 +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST15 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST1 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_unlimited_vm - -# this test creates huge file -configure_valgrind force-disable - -setup - -# multi-arena case -truncate -s 1026G $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 2134997374 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - r:0 r:1 r:4161480 r:2134997087 r:2134997088 z:0 z:4161480 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST16 b/src/test/blk_rw/TEST16 deleted file mode 100755 index 5377ce0cba3..00000000000 --- a/src/test/blk_rw/TEST16 +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST16 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST2 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_unlimited_vm - -# this test creates huge file -configure_valgrind force-disable - -setup - -# multi-arena case -truncate -s 1026G $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 268696557 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 4096 $DIR/testfile1 c\ - r:0 r:1 r:4161480 r:268696520 r:268696521 z:0 z:4161480 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST17 b/src/test/blk_rw/TEST17 deleted file mode 100755 index 1763bcac977..00000000000 --- a/src/test/blk_rw/TEST17 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST17 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST3 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# single arena write case -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST18 b/src/test/blk_rw/TEST18 deleted file mode 100755 index 2cf3d90b538..00000000000 --- a/src/test/blk_rw/TEST18 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST18 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST4 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# write re-use test case -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:0 w:1 w:2 w:3 w:4 r:4 r:3 r:2 r:1 r:0 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 o\ - w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST19 b/src/test/blk_rw/TEST19 deleted file mode 100755 index 1ed89129c69..00000000000 --- a/src/test/blk_rw/TEST19 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST19 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST5 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# mix writes with set_zero and set_error and check results -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST2 b/src/test/blk_rw/TEST2 deleted file mode 100755 index 4579cabcc4a..00000000000 --- a/src/test/blk_rw/TEST2 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST2 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem -require_unlimited_vm - -# this test creates huge file -configure_valgrind force-disable - -setup - -# multi-arena case -truncate -s 1026G $DIR/testfile1 -# -# All reads to an unwritten block pool should return zeros. -# Block 268696557 is out of range and should return EINVAL. -# Attempts to zero uninitialized blocks are nops (should succeed). -# -expect_normal_exit ./blk_rw$EXESUFFIX 4096 $DIR/testfile1 c\ - r:0 r:1 r:4161480 r:268696550 r:268696551 z:0 z:4161480 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST20 b/src/test/blk_rw/TEST20 deleted file mode 100755 index 4a892632cb5..00000000000 --- a/src/test/blk_rw/TEST20 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST20 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST6 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# mix writes with set_zero and set_error and check results -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST21 b/src/test/blk_rw/TEST21 deleted file mode 100755 index 9b910a8a017..00000000000 --- a/src/test/blk_rw/TEST21 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST21 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST7 for ppc64le platform. -# - -. ../unittest/unittest.sh - -# long test, run only on pmem -require_ppc64 -require_fs_type pmem -require_test_type long -configure_valgrind pmemcheck force-enable -setup - -# mix writes with set_zero and set_error and check results -truncate -s 128M $DIR/testfile1 - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST22 b/src/test/blk_rw/TEST22 deleted file mode 100755 index 59845ec83c0..00000000000 --- a/src/test/blk_rw/TEST22 +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST22 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST8 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -require_free_space 2G - -create_poolset $DIR/testset1 1G:$DIR/testfile1:x 1G:$DIR/testfile2:x - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset1 c\ - w:0 w:1 r:1 r:0\ - w:4161096 r:4161096 - -check_pool $DIR/testfile2 - -check - -pass diff --git a/src/test/blk_rw/TEST23 b/src/test/blk_rw/TEST23 deleted file mode 100755 index aeb42469c3f..00000000000 --- a/src/test/blk_rw/TEST23 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# Copyright 2019, IBM Corporation - -# -# src/test/blk_rw/TEST23 -- unit test for pmemblk_read/write/set_zero/set_error -# -# This test is equivalent of TEST9 for ppc64le platform. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -require_free_space 2G - -create_poolset $DIR/testset1 1G:$DIR/testfile1:x 1G:$DIR/testfile2:x - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset1 c\ - w:-1 r:-1 z:-1 e:-1 - -check - -pass diff --git a/src/test/blk_rw/TEST3 b/src/test/blk_rw/TEST3 deleted file mode 100755 index 7371bd328ce..00000000000 --- a/src/test/blk_rw/TEST3 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST3 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# single arena write case -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:0 r:1 r:0 w:1 r:0 r:1 r:2 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST4 b/src/test/blk_rw/TEST4 deleted file mode 100755 index 7a47e00c24e..00000000000 --- a/src/test/blk_rw/TEST4 +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST4 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh -exclude_ppc64 - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# write re-use test case -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:0 w:1 w:2 w:3 w:4 r:4 r:3 r:2 r:1 r:0 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 o\ - w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST5 b/src/test/blk_rw/TEST5 deleted file mode 100755 index bd9d24cbc42..00000000000 --- a/src/test/blk_rw/TEST5 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST5 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# mix writes with set_zero and set_error and check results -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - w:100 w:200 w:300 w:400\ - r:100 r:200 r:300 r:400\ - w:100 z:200 w:300 z:400\ - r:100 r:200 r:300 r:400\ - e:100 w:200 e:300 w:400\ - r:100 r:200 r:300 r:400 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST6 b/src/test/blk_rw/TEST6 deleted file mode 100755 index bc553fb7e0e..00000000000 --- a/src/test/blk_rw/TEST6 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw/TEST6 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# mix writes with set_zero and set_error and check results -truncate -s 1G $DIR/testfile1 -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST7 b/src/test/blk_rw/TEST7 deleted file mode 100755 index 12a0ccba4ee..00000000000 --- a/src/test/blk_rw/TEST7 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_rw/TEST7 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -# long test, run only on pmem -exclude_ppc64 -require_fs_type pmem -require_test_type long -configure_valgrind pmemcheck force-enable -setup - -# mix writes with set_zero and set_error and check results -truncate -s 128M $DIR/testfile1 - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\ - e:1 r:1\ - e:2 w:2 r:2\ - z:3 e:3 r:3\ - e:4 z:4 r:4\ - w:5 e:5 z:5 r:5\ - w:6 z:6 e:6 r:6 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw/TEST8 b/src/test/blk_rw/TEST8 deleted file mode 100755 index 338d46fc39f..00000000000 --- a/src/test/blk_rw/TEST8 +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_rw/TEST8 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -require_free_space 2G - -create_poolset $DIR/testset1 1G:$DIR/testfile1:x 1G:$DIR/testfile2:x - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset1 c\ - w:0 w:1 r:1 r:0\ - w:4161445 r:4161445 - -check_pool $DIR/testfile2 - -check - -pass diff --git a/src/test/blk_rw/TEST9 b/src/test/blk_rw/TEST9 deleted file mode 100755 index e629e4ac858..00000000000 --- a/src/test/blk_rw/TEST9 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/blk_rw/TEST9 -- unit test for pmemblk_read/write/set_zero/set_error -# - -. ../unittest/unittest.sh - -require_test_type medium -exclude_ppc64 - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -require_free_space 2G - -create_poolset $DIR/testset1 1G:$DIR/testfile1:x 1G:$DIR/testfile2:x - -expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset1 c\ - w:-1 r:-1 z:-1 e:-1 - -check - -pass diff --git a/src/test/blk_rw/blk_rw.c b/src/test/blk_rw/blk_rw.c deleted file mode 100644 index fe0eefcaf73..00000000000 --- a/src/test/blk_rw/blk_rw.c +++ /dev/null @@ -1,138 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2017, Intel Corporation */ - -/* - * blk_rw.c -- unit test for pmemblk_read/write/set_zero/set_error - * - * usage: blk_rw bsize file func operation:lba... - * - * func is 'c' or 'o' (create or open) - * operations are 'r' or 'w' or 'z' or 'e' - * - */ - -#include "unittest.h" - -static size_t Bsize; - -/* - * construct -- build a buffer for writing - */ -static void -construct(unsigned char *buf) -{ - static int ord = 1; - - for (int i = 0; i < Bsize; i++) - buf[i] = ord; - - ord++; - - if (ord > 255) - ord = 1; -} - -/* - * ident -- identify what a buffer holds - */ -static char * -ident(unsigned char *buf) -{ - static char descr[100]; - unsigned val = *buf; - - for (int i = 1; i < Bsize; i++) - if (buf[i] != val) { - sprintf(descr, "{%u} TORN at byte %d", val, i); - return descr; - } - - sprintf(descr, "{%u}", val); - return descr; -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_rw"); - - if (argc < 5) - UT_FATAL("usage: %s bsize file func op:lba...", argv[0]); - - Bsize = strtoul(argv[1], NULL, 0); - - const char *path = argv[2]; - - PMEMblkpool *handle; - switch (*argv[3]) { - case 'c': - handle = pmemblk_create(path, Bsize, 0, - S_IWUSR | S_IRUSR); - if (handle == NULL) - UT_FATAL("!%s: pmemblk_create", path); - break; - case 'o': - handle = pmemblk_open(path, Bsize); - if (handle == NULL) - UT_FATAL("!%s: pmemblk_open", path); - break; - } - - UT_OUT("%s block size %zu usable blocks %zu", - argv[1], Bsize, pmemblk_nblock(handle)); - - unsigned char *buf = MALLOC(Bsize); - if (buf == NULL) - UT_FATAL("cannot allocate buf"); - - /* map each file argument with the given map type */ - for (int arg = 4; arg < argc; arg++) { - if (strchr("rwze", argv[arg][0]) == NULL || argv[arg][1] != ':') - UT_FATAL("op must be r: or w: or z: or e:"); - os_off_t lba = strtol(&argv[arg][2], NULL, 0); - - switch (argv[arg][0]) { - case 'r': - if (pmemblk_read(handle, buf, lba) < 0) - UT_OUT("!read lba %jd", lba); - else - UT_OUT("read lba %jd: %s", lba, - ident(buf)); - break; - - case 'w': - construct(buf); - if (pmemblk_write(handle, buf, lba) < 0) - UT_OUT("!write lba %jd", lba); - else - UT_OUT("write lba %jd: %s", lba, - ident(buf)); - break; - - case 'z': - if (pmemblk_set_zero(handle, lba) < 0) - UT_OUT("!set_zero lba %jd", lba); - else - UT_OUT("set_zero lba %jd", lba); - break; - - case 'e': - if (pmemblk_set_error(handle, lba) < 0) - UT_OUT("!set_error lba %jd", lba); - else - UT_OUT("set_error lba %jd", lba); - break; - } - } - - FREE(buf); - pmemblk_close(handle); - - int result = pmemblk_check(path, Bsize); - if (result < 0) - UT_OUT("!%s: pmemblk_check", path); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", path); - - DONE(NULL); -} diff --git a/src/test/blk_rw/out0.log.match b/src/test/blk_rw/out0.log.match deleted file mode 100644 index 52d87ae7a28..00000000000 --- a/src/test/blk_rw/out0.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST0: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 -512 block size 512 usable blocks 32313 -read lba 0: {0} -read lba 1: {0} -read lba 32201: {0} -read lba 32313: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -blk_rw$(nW)TEST0: DONE diff --git a/src/test/blk_rw/out1.log.match b/src/test/blk_rw/out1.log.match deleted file mode 100644 index 8ae083cc835..00000000000 --- a/src/test/blk_rw/out1.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST1: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c r:0 r:1 r:4161480 r:2134997325 r:2134997326 z:0 z:4161480 -512 block size 512 usable blocks 2134997326 -read lba 0: {0} -read lba 1: {0} -read lba 4161480: {0} -read lba 2134997325: {0} -read lba 2134997326: Invalid argument -set_zero lba 0 -set_zero lba 4161480 -blk_rw$(nW)TEST1: DONE diff --git a/src/test/blk_rw/out14.log.match b/src/test/blk_rw/out14.log.match deleted file mode 100644 index a854f55ed4b..00000000000 --- a/src/test/blk_rw/out14.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST14: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c r:0 r:1 r:32201 r:32313 z:0 z:1 r:0 -512 block size 512 usable blocks 32202 -read lba 0: {0} -read lba 1: {0} -read lba 32201: {0} -read lba 32313: Invalid argument -set_zero lba 0 -set_zero lba 1 -read lba 0: {0} -blk_rw$(nW)TEST14: DONE diff --git a/src/test/blk_rw/out15.log.match b/src/test/blk_rw/out15.log.match deleted file mode 100644 index 3b9ea1dec53..00000000000 --- a/src/test/blk_rw/out15.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST15: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c r:0 r:1 r:4161480 r:2134997087 r:2134997088 z:0 z:4161480 -512 block size 512 usable blocks 2134997088 -read lba 0: {0} -read lba 1: {0} -read lba 4161480: {0} -read lba 2134997087: {0} -read lba 2134997088: Invalid argument -set_zero lba 0 -set_zero lba 4161480 -blk_rw$(nW)TEST15: DONE diff --git a/src/test/blk_rw/out16.log.match b/src/test/blk_rw/out16.log.match deleted file mode 100644 index 0cbeb3ee57c..00000000000 --- a/src/test/blk_rw/out16.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST16: START: blk_rw - $(nW)blk_rw$(nW) 4096 $(nW)testfile1 c r:0 r:1 r:4161480 r:268696520 r:268696521 z:0 z:4161480 -4096 block size 4096 usable blocks 268696521 -read lba 0: {0} -read lba 1: {0} -read lba 4161480: {0} -read lba 268696520: {0} -read lba 268696521: Invalid argument -set_zero lba 0 -set_zero lba 4161480 -blk_rw$(nW)TEST16: DONE diff --git a/src/test/blk_rw/out17.log.match b/src/test/blk_rw/out17.log.match deleted file mode 100644 index 11f5701a2a4..00000000000 --- a/src/test/blk_rw/out17.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST17: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080329 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_rw$(nW)TEST17: DONE diff --git a/src/test/blk_rw/out18.log.match b/src/test/blk_rw/out18.log.match deleted file mode 100644 index e011061d306..00000000000 --- a/src/test/blk_rw/out18.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_rw$(nW)TEST18: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 o w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 -512 block size 512 usable blocks 2080329 -write lba 0: {1} -read lba 4: {5} -read lba 3: {4} -read lba 2: {3} -read lba 1: {2} -read lba 0: {1} -write lba 0: {2} -read lba 0: {2} -blk_rw$(nW)TEST18: DONE diff --git a/src/test/blk_rw/out19.log.match b/src/test/blk_rw/out19.log.match deleted file mode 100644 index 713b7e4c5c2..00000000000 --- a/src/test/blk_rw/out19.log.match +++ /dev/null @@ -1,28 +0,0 @@ -blk_rw$(nW)TEST19: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080329 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_rw$(nW)TEST19: DONE diff --git a/src/test/blk_rw/out2.log.match b/src/test/blk_rw/out2.log.match deleted file mode 100644 index 656dcf97447..00000000000 --- a/src/test/blk_rw/out2.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST2: START: blk_rw - $(nW)blk_rw$(nW) 4096 $(nW)testfile1 c r:0 r:1 r:4161480 r:268696550 r:268696551 z:0 z:4161480 -4096 block size 4096 usable blocks 268696551 -read lba 0: {0} -read lba 1: {0} -read lba 4161480: {0} -read lba 268696550: {0} -read lba 268696551: Invalid argument -set_zero lba 0 -set_zero lba 4161480 -blk_rw$(nW)TEST2: DONE diff --git a/src/test/blk_rw/out20.log.match b/src/test/blk_rw/out20.log.match deleted file mode 100644 index df94c655914..00000000000 --- a/src/test/blk_rw/out20.log.match +++ /dev/null @@ -1,23 +0,0 @@ -blk_rw$(nW)TEST20: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080329 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_rw$(nW)TEST20: DONE diff --git a/src/test/blk_rw/out22.log.match b/src/test/blk_rw/out22.log.match deleted file mode 100644 index 6c523d36e13..00000000000 --- a/src/test/blk_rw/out22.log.match +++ /dev/null @@ -1,10 +0,0 @@ -blk_rw$(nW)TEST22: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testset1 c w:0 w:1 r:1 r:0 w:4161096 r:4161096 -512 block size 512 usable blocks 4161097 -write lba 0: {1} -write lba 1: {2} -read lba 1: {2} -read lba 0: {1} -write lba 4161096: {3} -read lba 4161096: {3} -blk_rw$(nW)TEST22: DONE diff --git a/src/test/blk_rw/out23.log.match b/src/test/blk_rw/out23.log.match deleted file mode 100644 index 9260cee491e..00000000000 --- a/src/test/blk_rw/out23.log.match +++ /dev/null @@ -1,8 +0,0 @@ -blk_rw$(nW)TEST23: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testset1 c w:-1 r:-1 z:-1 e:-1 -512 block size 512 usable blocks 4161097 -write lba -1: Invalid argument -read lba -1: Invalid argument -set_zero lba -1: Invalid argument -set_error lba -1: Invalid argument -blk_rw$(nW)TEST23: DONE diff --git a/src/test/blk_rw/out3.log.match b/src/test/blk_rw/out3.log.match deleted file mode 100644 index 1c75c567622..00000000000 --- a/src/test/blk_rw/out3.log.match +++ /dev/null @@ -1,11 +0,0 @@ -blk_rw$(nW)TEST3: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c w:0 r:1 r:0 w:1 r:0 r:1 r:2 -512 block size 512 usable blocks 2080567 -write lba 0: {1} -read lba 1: {0} -read lba 0: {1} -write lba 1: {2} -read lba 0: {1} -read lba 1: {2} -read lba 2: {0} -blk_rw$(nW)TEST3: DONE diff --git a/src/test/blk_rw/out4.log.match b/src/test/blk_rw/out4.log.match deleted file mode 100644 index 7e3b6a6fb89..00000000000 --- a/src/test/blk_rw/out4.log.match +++ /dev/null @@ -1,12 +0,0 @@ -blk_rw$(nW)TEST4: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 o w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0 -512 block size 512 usable blocks 2080567 -write lba 0: {1} -read lba 4: {5} -read lba 3: {4} -read lba 2: {3} -read lba 1: {2} -read lba 0: {1} -write lba 0: {2} -read lba 0: {2} -blk_rw$(nW)TEST4: DONE diff --git a/src/test/blk_rw/out5.log.match b/src/test/blk_rw/out5.log.match deleted file mode 100644 index 733782f0f9a..00000000000 --- a/src/test/blk_rw/out5.log.match +++ /dev/null @@ -1,28 +0,0 @@ -blk_rw$(nW)TEST5: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c w:100 w:200 w:300 w:400 r:100 r:200 r:300 r:400 w:100 z:200 w:300 z:400 r:100 r:200 r:300 r:400 e:100 w:200 e:300 w:400 r:100 r:200 r:300 r:400 -512 block size 512 usable blocks 2080567 -write lba 100: {1} -write lba 200: {2} -write lba 300: {3} -write lba 400: {4} -read lba 100: {1} -read lba 200: {2} -read lba 300: {3} -read lba 400: {4} -write lba 100: {5} -set_zero lba 200 -write lba 300: {6} -set_zero lba 400 -read lba 100: {5} -read lba 200: {0} -read lba 300: {6} -read lba 400: {0} -set_error lba 100 -write lba 200: {7} -set_error lba 300 -write lba 400: {8} -read lba 100: Input/output error -read lba 200: {7} -read lba 300: Input/output error -read lba 400: {8} -blk_rw$(nW)TEST5: DONE diff --git a/src/test/blk_rw/out6.log.match b/src/test/blk_rw/out6.log.match deleted file mode 100644 index eb36953e4c1..00000000000 --- a/src/test/blk_rw/out6.log.match +++ /dev/null @@ -1,23 +0,0 @@ -blk_rw$(nW)TEST6: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 2080567 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_rw$(nW)TEST6: DONE diff --git a/src/test/blk_rw/out7.log.match b/src/test/blk_rw/out7.log.match deleted file mode 100644 index 61f4df46853..00000000000 --- a/src/test/blk_rw/out7.log.match +++ /dev/null @@ -1,23 +0,0 @@ -blk_rw$(nW)TEST7: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testfile1 c e:1 r:1 e:2 w:2 r:2 z:3 e:3 r:3 e:4 z:4 r:4 w:5 e:5 z:5 r:5 w:6 z:6 e:6 r:6 -512 block size 512 usable blocks 259784 -set_error lba 1 -read lba 1: Input/output error -set_error lba 2 -write lba 2: {1} -read lba 2: {1} -set_zero lba 3 -set_error lba 3 -read lba 3: Input/output error -set_error lba 4 -set_zero lba 4 -read lba 4: {0} -write lba 5: {2} -set_error lba 5 -set_zero lba 5 -read lba 5: {0} -write lba 6: {3} -set_zero lba 6 -set_error lba 6 -read lba 6: Input/output error -blk_rw$(nW)TEST7: DONE diff --git a/src/test/blk_rw/out8.log.match b/src/test/blk_rw/out8.log.match deleted file mode 100644 index b6f81b1081a..00000000000 --- a/src/test/blk_rw/out8.log.match +++ /dev/null @@ -1,10 +0,0 @@ -blk_rw$(nW)TEST8: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testset1 c w:0 w:1 r:1 r:0 w:4161445 r:4161445 -512 block size 512 usable blocks 4161454 -write lba 0: {1} -write lba 1: {2} -read lba 1: {2} -read lba 0: {1} -write lba 4161445: {3} -read lba 4161445: {3} -blk_rw$(nW)TEST8: DONE diff --git a/src/test/blk_rw/out9.log.match b/src/test/blk_rw/out9.log.match deleted file mode 100644 index c3a76b12950..00000000000 --- a/src/test/blk_rw/out9.log.match +++ /dev/null @@ -1,8 +0,0 @@ -blk_rw$(nW)TEST9: START: blk_rw - $(nW)blk_rw$(nW) 512 $(nW)testset1 c w:-1 r:-1 z:-1 e:-1 -512 block size 512 usable blocks 4161454 -write lba -1: Invalid argument -read lba -1: Invalid argument -set_zero lba -1: Invalid argument -set_error lba -1: Invalid argument -blk_rw$(nW)TEST9: DONE diff --git a/src/test/blk_rw_mt/.gitignore b/src/test/blk_rw_mt/.gitignore deleted file mode 100644 index c9a111b2e56..00000000000 --- a/src/test/blk_rw_mt/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blk_rw_mt diff --git a/src/test/blk_rw_mt/Makefile b/src/test/blk_rw_mt/Makefile deleted file mode 100644 index c29c613e9b9..00000000000 --- a/src/test/blk_rw_mt/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/blk_rw_mt/Makefile -- build blk_rw_mt unit test -# -TARGET = blk_rw_mt -OBJS = blk_rw_mt.o - -LIBPMEMBLK=y - -include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/blk_rw_mt/README b/src/test/blk_rw_mt/README deleted file mode 100644 index a5de2982a26..00000000000 --- a/src/test/blk_rw_mt/README +++ /dev/null @@ -1,14 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/blk_rw_mt/README. - -This directory contains a unit test for MT reads & writes. - -The program in blk_rw_mt.c takes a block size, a file, a random number -generator seed (to make the results repeatable), a thread count, and the -number of I/Os to do per thread. For example: - - ./blk_rw_mt 4096 file1 123 300 500 - -this will create a pool in file1 with block size 4096, fork 300 threads, -and each thread will do 500 random I/Os (50/50 reads/writes). diff --git a/src/test/blk_rw_mt/TEST0 b/src/test/blk_rw_mt/TEST0 deleted file mode 100755 index 01961759021..00000000000 --- a/src/test/blk_rw_mt/TEST0 +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw_mt/TEST0 -- unit test for MT I/O on blk pool -# - -. ../unittest/unittest.sh - -# this is the short version of the test -require_test_type short - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -# libpmemblk does not support race detection tools -configure_valgrind helgrind force-disable -configure_valgrind drd force-disable - -setup - -truncate -s 1G $DIR/testfile1 -# 5 threads, each doing 80 random I/Os -expect_normal_exit ./blk_rw_mt$EXESUFFIX 4096 $DIR/testfile1 123 5 80 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw_mt/TEST1 b/src/test/blk_rw_mt/TEST1 deleted file mode 100755 index b62cdda1d9f..00000000000 --- a/src/test/blk_rw_mt/TEST1 +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw_mt/TEST1 -- unit test for MT I/O on blk pool -# - -. ../unittest/unittest.sh - -require_test_type medium - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -# libpmemblk does not support race detection tools -configure_valgrind helgrind force-disable -configure_valgrind drd force-disable - -setup - -truncate -s 1G $DIR/testfile1 -# 100 threads, each doing 100 random I/Os -expect_normal_exit ./blk_rw_mt$EXESUFFIX 4096 $DIR/testfile1 456 100 100 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw_mt/TEST2 b/src/test/blk_rw_mt/TEST2 deleted file mode 100755 index 7d163e54f2b..00000000000 --- a/src/test/blk_rw_mt/TEST2 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/blk_rw_mt/TEST2 -- unit test for MT I/O on blk pool -# - -. ../unittest/unittest.sh - -# this is the long version of the test -require_test_type long - -# libpmemblk does not support race detection tools -configure_valgrind helgrind force-disable -configure_valgrind drd force-disable - -# doesn't make sense to run in local directory -require_fs_type pmem non-pmem - -setup - -# limit number of emitted logs due to excessive log size -export PMEMBLK_LOG_LEVEL=2 - -truncate -s 1G $DIR/testfile1 -# 300 threads, each doing 100000 random I/Os -expect_normal_exit ./blk_rw_mt$EXESUFFIX 4096 $DIR/testfile1 789 300 100000 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/blk_rw_mt/blk_rw_mt.c b/src/test/blk_rw_mt/blk_rw_mt.c deleted file mode 100644 index 97d01ffa19f..00000000000 --- a/src/test/blk_rw_mt/blk_rw_mt.c +++ /dev/null @@ -1,161 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2020, Intel Corporation */ -/* - * Copyright (c) 2016, Microsoft Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * blk_rw_mt.c -- unit test for multi-threaded random I/O - * - * usage: blk_rw_mt bsize file seed nthread nops - * - */ - -#include "unittest.h" -#include "rand.h" - -static size_t Bsize; -/* all I/O below this LBA (increases collisions) */ -static const unsigned Nblock = 100; -static unsigned Seed; -static unsigned Nthread; -static unsigned Nops; -static PMEMblkpool *Handle; - -/* - * construct -- build a buffer for writing - */ -static void -construct(int *ordp, unsigned char *buf) -{ - for (int i = 0; i < Bsize; i++) - buf[i] = *ordp; - - (*ordp)++; - - if (*ordp > 255) - *ordp = 1; -} - -/* - * check -- check for torn buffers - */ -static void -check(unsigned char *buf) -{ - unsigned val = *buf; - - for (int i = 1; i < Bsize; i++) - if (buf[i] != val) { - UT_OUT("{%u} TORN at byte %d", val, i); - break; - } -} - -/* - * worker -- the work each thread performs - */ -static void * -worker(void *arg) -{ - uintptr_t mytid = (uintptr_t)arg; - unsigned char *buf = MALLOC(Bsize); - int ord = 1; - rng_t rng; - - randomize_r(&rng, Seed + mytid); - - for (unsigned i = 0; i < Nops; i++) { - os_off_t lba = (os_off_t)(rnd64_r(&rng) % Nblock); - - if (rnd64_r(&rng) % 2) { - /* read */ - if (pmemblk_read(Handle, buf, lba) < 0) - UT_OUT("!read lba %zu", lba); - else - check(buf); - } else { - /* write */ - construct(&ord, buf); - if (pmemblk_write(Handle, buf, lba) < 0) - UT_OUT("!write lba %zu", lba); - } - } - - FREE(buf); - - return NULL; -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "blk_rw_mt"); - - if (argc != 6) - UT_FATAL("usage: %s bsize file seed nthread nops", argv[0]); - - Bsize = strtoul(argv[1], NULL, 0); - - const char *path = argv[2]; - - if ((Handle = pmemblk_create(path, Bsize, 0, - S_IWUSR | S_IRUSR)) == NULL) - UT_FATAL("!%s: pmemblk_create", path); - - Seed = strtoul(argv[3], NULL, 0); - Nthread = strtoul(argv[4], NULL, 0); - Nops = strtoul(argv[5], NULL, 0); - - UT_OUT("%s block size %zu usable blocks %u", argv[1], Bsize, Nblock); - - os_thread_t *threads = MALLOC(Nthread * sizeof(os_thread_t)); - - /* kick off nthread threads */ - for (unsigned i = 0; i < Nthread; i++) - THREAD_CREATE(&threads[i], NULL, worker, (void *)(intptr_t)i); - - /* wait for all the threads to complete */ - for (unsigned i = 0; i < Nthread; i++) - THREAD_JOIN(&threads[i], NULL); - - FREE(threads); - pmemblk_close(Handle); - - /* XXX not ready to pass this part of the test yet */ - int result = pmemblk_check(path, Bsize); - if (result < 0) - UT_OUT("!%s: pmemblk_check", path); - else if (result == 0) - UT_OUT("%s: pmemblk_check: not consistent", path); - - DONE(NULL); -} diff --git a/src/test/blk_rw_mt/config.sh b/src/test/blk_rw_mt/config.sh deleted file mode 100644 index 1140277f500..00000000000 --- a/src/test/blk_rw_mt/config.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017, Intel Corporation -# -# -# blk_rw_mt/config.sh -- test configuration -# - -# Extend timeout for this test, as it may take a few minutes -# when run on a non-pmem file system. - -CONF_GLOBAL_TIMEOUT='10m' - diff --git a/src/test/blk_rw_mt/out0.log.match b/src/test/blk_rw_mt/out0.log.match deleted file mode 100644 index 496b5d8cb72..00000000000 --- a/src/test/blk_rw_mt/out0.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_rw_mt$(nW)TEST0: START: blk_rw_mt - $(nW)blk_rw_mt$(nW) 4096 $(nW)testfile1 123 5 80 -4096 block size 4096 usable blocks 100 -blk_rw_mt$(nW)TEST0: DONE diff --git a/src/test/blk_rw_mt/out1.log.match b/src/test/blk_rw_mt/out1.log.match deleted file mode 100644 index 9f851ed0ea5..00000000000 --- a/src/test/blk_rw_mt/out1.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_rw_mt$(nW)TEST1: START: blk_rw_mt - $(nW)blk_rw_mt$(nW) 4096 $(nW)testfile1 456 100 100 -4096 block size 4096 usable blocks 100 -blk_rw_mt$(nW)TEST1: DONE diff --git a/src/test/blk_rw_mt/out2.log.match b/src/test/blk_rw_mt/out2.log.match deleted file mode 100644 index 6868ce9069a..00000000000 --- a/src/test/blk_rw_mt/out2.log.match +++ /dev/null @@ -1,4 +0,0 @@ -blk_rw_mt$(nW)TEST2: START: blk_rw_mt - $(nW)blk_rw_mt$(nW) 4096 $(nW)testfile1 789 300 100000 -4096 block size 4096 usable blocks 100 -blk_rw_mt$(nW)TEST2: DONE diff --git a/src/test/compat_incompat_features/Makefile b/src/test/compat_incompat_features/Makefile index 2dc0bafa71e..ffbfa6a1ec3 100644 --- a/src/test/compat_incompat_features/Makefile +++ b/src/test/compat_incompat_features/Makefile @@ -12,8 +12,3 @@ LIBPMEMOBJ=y USE_PMEMSPOIL=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/compat_incompat_features/pool_open.c b/src/test/compat_incompat_features/pool_open.c index 70ed9a3e967..b555fb79549 100644 --- a/src/test/compat_incompat_features/pool_open.c +++ b/src/test/compat_incompat_features/pool_open.c @@ -2,9 +2,9 @@ /* Copyright 2017-2023, Intel Corporation */ /* - * pool_open.c -- a tool for verifying that an obj/blk pool opens correctly + * pool_open.c -- a tool for verifying that an obj pool opens correctly * - * usage: pool_open + * usage: pool_open */ #include "unittest.h" diff --git a/src/test/ctl_cow/Makefile b/src/test/ctl_cow/Makefile index becf3089181..93bac305bcc 100644 --- a/src/test/ctl_cow/Makefile +++ b/src/test/ctl_cow/Makefile @@ -10,8 +10,3 @@ OBJS = ctl_cow.o LIBPMEMOBJ=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/ctl_prefault/Makefile b/src/test/ctl_prefault/Makefile index 17fadc2ff64..386455bfeaa 100644 --- a/src/test/ctl_prefault/Makefile +++ b/src/test/ctl_prefault/Makefile @@ -10,8 +10,3 @@ OBJS = ctl_prefault.o LIBPMEMOBJ=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/ctl_prefault/ctl_prefault.c b/src/test/ctl_prefault/ctl_prefault.c index 28705a68576..865dd42ac8c 100644 --- a/src/test/ctl_prefault/ctl_prefault.c +++ b/src/test/ctl_prefault/ctl_prefault.c @@ -104,8 +104,7 @@ test_obj(const char *path, int open) } #define USAGE() do {\ - UT_FATAL("usage: %s file-name type(obj/blk) prefault(0/1/2) "\ - "open(0/1)", argv[0]);\ + UT_FATAL("usage: %s file-name prefault(0/1/2) open(0/1)", argv[0]);\ } while (0) int diff --git a/src/test/ex_libpmemblk/Makefile b/src/test/ex_libpmemblk/Makefile deleted file mode 100644 index 7e1310d4000..00000000000 --- a/src/test/ex_libpmemblk/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2016, Intel Corporation - -# -# src/test/ex_libpmemblk/Makefile -- build ex_libpmemblk unittest -# - -all: $(EXAMPLES) - $(MAKE) -C $(EX_LIBPMEMBLK) - -include ../Makefile.inc - -EXAMPLES=$(EX_LIBPMEMBLK)/assetdb/asset_load \ - $(EX_LIBPMEMBLK)/assetdb/asset_checkin \ - $(EX_LIBPMEMBLK)/assetdb/asset_checkout \ - $(EX_LIBPMEMBLK)/assetdb/asset_list - diff --git a/src/test/ex_libpmemblk/README b/src/test/ex_libpmemblk/README deleted file mode 100644 index 6d16de1fc26..00000000000 --- a/src/test/ex_libpmemblk/README +++ /dev/null @@ -1,7 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/ex_libpmemblk/README. - -This directory contains unit tests for libpmemblk examples. - -The unit tests utilizes examples from src/examples/libpmemblk directory. diff --git a/src/test/ex_libpmemblk/TEST0 b/src/test/ex_libpmemblk/TEST0 deleted file mode 100755 index 0fa764c0179..00000000000 --- a/src/test/ex_libpmemblk/TEST0 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/ex_libpmemblk/TEST0 -- unit test for libpmemblk examples -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type debug nondebug - -setup - -EX_PATH=../../examples/libpmemblk/assetdb - -create_holey_file 32M $DIR/testfile1 - -expect_normal_exit $EX_PATH/asset_load $DIR/testfile1 ./asset_list.txt > out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/asset_list $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/asset_checkout $DIR/testfile1 2 Joe >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/asset_list $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/asset_checkin $DIR/testfile1 2 >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/asset_list $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/ex_libpmemblk/asset_list.txt b/src/test/ex_libpmemblk/asset_list.txt deleted file mode 100644 index 7736a96a51a..00000000000 --- a/src/test/ex_libpmemblk/asset_list.txt +++ /dev/null @@ -1,4 +0,0 @@ -Hello -World! -foo -bar diff --git a/src/test/ex_libpmemblk/out0.log.match b/src/test/ex_libpmemblk/out0.log.match deleted file mode 100644 index 9fa2f478b7e..00000000000 --- a/src/test/ex_libpmemblk/out0.log.match +++ /dev/null @@ -1,50 +0,0 @@ -Asset ID: 0 - State: Free - Name: Hello - -Asset ID: 1 - State: Free - Name: World! - -Asset ID: 2 - State: Free - Name: foo - -Asset ID: 3 - State: Free - Name: bar - -Asset ID: 0 - State: Free - Name: Hello - -Asset ID: 1 - State: Free - Name: World! - -Asset ID: 2 - State: Checked out - User: Joe - Time: $(*) - Name: foo - -Asset ID: 3 - State: Free - Name: bar - -Asset ID: 0 - State: Free - Name: Hello - -Asset ID: 1 - State: Free - Name: World! - -Asset ID: 2 - State: Free - Name: foo - -Asset ID: 3 - State: Free - Name: bar - diff --git a/src/test/libpmempool_api/libpmempool_test.c b/src/test/libpmempool_api/libpmempool_test.c index f2f0f0e6e75..0a50fb3bf5b 100644 --- a/src/test/libpmempool_api/libpmempool_test.c +++ b/src/test/libpmempool_api/libpmempool_test.c @@ -112,9 +112,7 @@ main(int argc, char *argv[]) while ((opt = getopt(argc, argv, "t:r:d:a:y:s:b:")) != -1) { switch (opt) { case 't': - if (strcmp(optarg, "blk") == 0) { - args.pool_type = PMEMPOOL_POOL_TYPE_BLK; - } else if (strcmp(optarg, "log") == 0) { + if (strcmp(optarg, "log") == 0) { args.pool_type = PMEMPOOL_POOL_TYPE_LOG; } else if (strcmp(optarg, "obj") == 0) { args.pool_type = PMEMPOOL_POOL_TYPE_OBJ; diff --git a/src/test/libpmempool_backup/common.sh b/src/test/libpmempool_backup/common.sh index 189cc8e8b0d..36a966b1332 100755 --- a/src/test/libpmempool_backup/common.sh +++ b/src/test/libpmempool_backup/common.sh @@ -17,10 +17,10 @@ OUT_TEMP=out${UNITTEST_NUM}_temp.log DIFF=diff${UNITTEST_NUM}.log rm -f $LOG $DIFF $OUT_TEMP && touch $LOG $DIFF $OUT_TEMP -# params for blk, log and obj pools -POOL_TYPES=( blk log obj ) -POOL_CREATE_PARAMS=( "--write-layout 512" "" "--layout test_layout" ) -POOL_CHECK_PARAMS=( "-smgB" "-s" "-soOaAbZH -l -C" ) +# params for log and obj pools +POOL_TYPES=( log obj ) +POOL_CREATE_PARAMS=( "" "--layout test_layout" ) +POOL_CHECK_PARAMS=( "-s" "-soOaAbZH -l -C" ) POOL_OBJ=2 # create_poolset_variation -- create one from the tested poolset variation diff --git a/src/test/libpmempool_backup/out0.log.match b/src/test/libpmempool_backup/out0.log.match index d918f4b7783..658e6a1b267 100644 --- a/src/test/libpmempool_backup/out0.log.match +++ b/src/test/libpmempool_backup/out0.log.match @@ -1,27 +1,3 @@ -libpmempool_backup$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -creating backup file: $(nW)pool.part1_backup -creating backup file: $(nW)pool.part2_backup -creating backup file: $(nW)pool.part3_backup -creating backup file: $(nW)pool.part4_backup -checking shutdown state -shutdown state correct -replica 0 part 0: checking pool header -replica 0 part 0: pool header correct -replica 0 part 1: checking pool header -replica 0 part 1: pool header correct -replica 0 part 2: checking pool header -replica 0 part 2: pool header correct -replica 0 part 3: checking pool header -replica 0 part 3: pool header correct -checking pmemblk header -pmemblk header correct -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_backup$(nW)TEST0: DONE libpmempool_backup$(nW)TEST0: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set creating backup file: $(nW)pool.part1_backup diff --git a/src/test/libpmempool_backup/out1.log.match b/src/test/libpmempool_backup/out1.log.match index 3a177763907..9749f0cd244 100644 --- a/src/test/libpmempool_backup/out1.log.match +++ b/src/test/libpmempool_backup/out1.log.match @@ -1,9 +1,3 @@ -libpmempool_backup$(nW)TEST1: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -invalid poolset backup file: $(nW)pool.set_backup: No such file or directory -unable to backup poolset -status = fatal -libpmempool_backup$(nW)TEST1: DONE libpmempool_backup$(nW)TEST1: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set invalid poolset backup file: $(nW)pool.set_backup: No such file or directory diff --git a/src/test/libpmempool_backup/out2.log.match b/src/test/libpmempool_backup/out2.log.match index ccf40704b1e..ac1c6ff48d9 100644 --- a/src/test/libpmempool_backup/out2.log.match +++ b/src/test/libpmempool_backup/out2.log.match @@ -1,9 +1,3 @@ -libpmempool_backup$(nW)TEST2: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -invalid poolset backup file: $(nW)pool.set_backup: Invalid argument -unable to backup poolset -status = fatal -libpmempool_backup$(nW)TEST2: DONE libpmempool_backup$(nW)TEST2: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set invalid poolset backup file: $(nW)pool.set_backup: Invalid argument diff --git a/src/test/libpmempool_backup/out3.log.match b/src/test/libpmempool_backup/out3.log.match index ae8220fe658..d27227d1291 100644 --- a/src/test/libpmempool_backup/out3.log.match +++ b/src/test/libpmempool_backup/out3.log.match @@ -1,9 +1,3 @@ -libpmempool_backup$(nW)TEST3: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -backup to a poolset with multiple replicas is not supported -unable to backup poolset -status = fatal -libpmempool_backup$(nW)TEST3: DONE libpmempool_backup$(nW)TEST3: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set backup to a poolset with multiple replicas is not supported diff --git a/src/test/libpmempool_backup/out4.log.match b/src/test/libpmempool_backup/out4.log.match index 9e47592461c..8e4ce57c5fe 100644 --- a/src/test/libpmempool_backup/out4.log.match +++ b/src/test/libpmempool_backup/out4.log.match @@ -1,9 +1,3 @@ -libpmempool_backup$(nW)TEST4: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -number of part files in the backup poolset must match number of part files in the source poolset -unable to backup poolset -status = fatal -libpmempool_backup$(nW)TEST4: DONE libpmempool_backup$(nW)TEST4: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set number of part files in the backup poolset must match number of part files in the source poolset diff --git a/src/test/libpmempool_backup/out5.log.match b/src/test/libpmempool_backup/out5.log.match index 34788504f7b..108ff076939 100644 --- a/src/test/libpmempool_backup/out5.log.match +++ b/src/test/libpmempool_backup/out5.log.match @@ -1,9 +1,3 @@ -libpmempool_backup$(nW)TEST5: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -size of the part 3 of the backup poolset does not match source poolset -unable to backup poolset -status = fatal -libpmempool_backup$(nW)TEST5: DONE libpmempool_backup$(nW)TEST5: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set size of the part 3 of the backup poolset does not match source poolset diff --git a/src/test/libpmempool_backup/out6.log.match b/src/test/libpmempool_backup/out6.log.match index 05610fa1b6b..019e9391f52 100644 --- a/src/test/libpmempool_backup/out6.log.match +++ b/src/test/libpmempool_backup/out6.log.match @@ -1,51 +1,3 @@ -libpmempool_backup/TEST6: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -part files of the destination poolset of the backup already exist. Do you want to overwrite them? -checking shutdown state -shutdown state correct -replica 0 part 0: checking pool header -replica 0 part 0: pool header correct -replica 0 part 1: checking pool header -replica 0 part 1: pool header correct -replica 0 part 2: checking pool header -replica 0 part 2: pool header correct -replica 0 part 3: checking pool header -replica 0 part 3: pool header correct -checking pmemblk header -pmemblk header correct -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_backup/TEST6: DONE -libpmempool_backup/TEST6: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -destination of the backup part does not match size of the source part file: $(nW)pool.part3_backup -unable to backup poolset -status = fatal -libpmempool_backup/TEST6: DONE -libpmempool_backup/TEST6: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t blk -r 1 $(nW)pool.set -part files of the destination poolset of the backup already exist. Do you want to overwrite them? -checking shutdown state -shutdown state correct -replica 0 part 0: checking pool header -replica 0 part 0: pool header correct -replica 0 part 1: checking pool header -replica 0 part 1: pool header correct -replica 0 part 2: checking pool header -replica 0 part 2: pool header correct -replica 0 part 3: checking pool header -replica 0 part 3: pool header correct -checking pmemblk header -pmemblk header correct -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_backup/TEST6: DONE libpmempool_backup/TEST6: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.set_backup -t log -r 1 $(nW)pool.set part files of the destination poolset of the backup already exist. Do you want to overwrite them? diff --git a/src/test/libpmempool_backup/out7.log.match b/src/test/libpmempool_backup/out7.log.match index 51f16ea87ca..da2d02fdad6 100644 --- a/src/test/libpmempool_backup/out7.log.match +++ b/src/test/libpmempool_backup/out7.log.match @@ -1,23 +1,3 @@ -libpmempool_backup/TEST7: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.blk_backup -t blk -r 1 $(nW)pool.blk -destination of the backup already exists. Do you want to overwrite it? -checking shutdown state -shutdown state correct -checking pool header -pool header correct -checking pmemblk header -pmemblk header correct -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_backup/TEST7: DONE -libpmempool_backup/TEST7: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -b $(nW)pool.blk_backup -t blk -r 1 $(nW)pool.blk -destination of the backup does not match the size of the source pool file: $(nW)pool.blk_backup -status = fatal -libpmempool_backup/TEST7: DONE libpmempool_backup/TEST7: START: libpmempool_test$(nW) $(nW)libpmempool_test$(nW) -b $(nW)pool.log_backup -t log -r 1 $(nW)pool.log destination of the backup already exists. Do you want to overwrite it? diff --git a/src/test/libpmempool_include/Makefile b/src/test/libpmempool_include/Makefile index 2823e44c9ab..7723112dc85 100644 --- a/src/test/libpmempool_include/Makefile +++ b/src/test/libpmempool_include/Makefile @@ -2,7 +2,7 @@ # Copyright 2016-2019, Intel Corporation # -# src/test/libpmempool_include/Makefile -- compilation test for libpmemblk +# src/test/libpmempool_include/Makefile -- compilation test for libpmempool # TARGET = libpmempool_include OBJS = libpmempool_include.o diff --git a/src/test/out_err_mt/Makefile b/src/test/out_err_mt/Makefile index 389a487af7b..00deddc1b29 100644 --- a/src/test/out_err_mt/Makefile +++ b/src/test/out_err_mt/Makefile @@ -13,8 +13,3 @@ LIBPMEMOBJ=y LIBPMEMPOOL=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/pmempool_dump/TEST3 b/src/test/pmempool_dump/TEST3 deleted file mode 100755 index 23504d65b4e..00000000000 --- a/src/test/pmempool_dump/TEST3 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2018, Intel Corporation -# -# -# pmempool_dump/TEST3 -- test for dump command -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type pmem non-pmem - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG - -expect_normal_exit $PMEMPOOL$EXESUFFIX create blk 512 $POOL -expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL 0:w:TEST0 -expect_normal_exit $PMEMPOOL$EXESUFFIX dump -r-1 -o dump.log $POOL -cat dump.log | $GREP "^00000000" >> $LOG -expect_normal_exit $PMEMPOOL$EXESUFFIX dump -r0 $POOL | $GREP "^00000000" >> $LOG - -check - -pass diff --git a/src/test/pmempool_dump/TEST6 b/src/test/pmempool_dump/TEST6 deleted file mode 100755 index 61b2ee3a89a..00000000000 --- a/src/test/pmempool_dump/TEST6 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2018, Intel Corporation -# -# -# pmempool_dump/TEST6 -- test for dump command -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type pmem non-pmem -require_build_type nondebug - -setup - -POOLSET=$DIR/pool.set -POOL_PART1=$DIR/pool.part1 -POOL_PART2=$DIR/pool.part2 -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG - -create_poolset $POOLSET 32M:$POOL_PART1:z 32M:$POOL_PART2:z - -expect_normal_exit $PMEMPOOL create blk 512 $POOLSET -expect_normal_exit $PMEMWRITE $POOLSET 0:w:PMEMPOOL_DUMP_TEST -expect_normal_exit $PMEMPOOL dump -r 0 $POOLSET >> $LOG - -check - -pass diff --git a/src/test/pmempool_dump/out3.log.match b/src/test/pmempool_dump/out3.log.match deleted file mode 100644 index 6765b6bc4fd..00000000000 --- a/src/test/pmempool_dump/out3.log.match +++ /dev/null @@ -1,2 +0,0 @@ -00000000 54 45 53 54 30 $(*) |TEST0$(*)| -00000000 54 45 53 54 30 $(*) |TEST0$(*)| diff --git a/src/test/pmempool_dump/out6.log.match b/src/test/pmempool_dump/out6.log.match deleted file mode 100644 index 72cd984153b..00000000000 --- a/src/test/pmempool_dump/out6.log.match +++ /dev/null @@ -1,5 +0,0 @@ -00000000 50 4d 45 4d 50 4f 4f 4c 5f 44 55 4d 50 5f 54 45 |PMEMPOOL_DUMP_TE| -00000010 53 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |ST..............| -00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -* -000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| diff --git a/src/test/scope/TESTS.py b/src/test/scope/TESTS.py index ec9b0d4ae4b..8d352a43b0a 100755 --- a/src/test/scope/TESTS.py +++ b/src/test/scope/TESTS.py @@ -79,11 +79,6 @@ class TEST2(Common): checked_lib = 'libpmem' -class TEST4(Common): - """Check scope of libpmemblk library (*nix)""" - checked_lib = 'libpmemblk' - - class TEST5(Common): """Check scope of libpmemobj library (*nix)""" checked_lib = 'libpmemobj' diff --git a/src/test/scope/out4.log.match b/src/test/scope/out4.log.match deleted file mode 100644 index 3c3fc9bc385..00000000000 --- a/src/test/scope/out4.log.match +++ /dev/null @@ -1,18 +0,0 @@ -pmemblk_bsize$(nW) -pmemblk_check$(nW) -pmemblk_check_version$(nW) -pmemblk_close$(nW) -pmemblk_create$(nW) -pmemblk_ctl_exec$(nW) -pmemblk_ctl_get$(nW) -pmemblk_ctl_set$(nW) -pmemblk_errormsg$(nW) -$(OPT)pmemblk_fault_injection_enabled$(nW) -$(OPT)pmemblk_inject_fault_at$(nW) -pmemblk_nblock$(nW) -pmemblk_open$(nW) -pmemblk_read$(nW) -pmemblk_set_error$(nW) -pmemblk_set_funcs$(nW) -pmemblk_set_zero$(nW) -pmemblk_write$(nW) diff --git a/src/test/set_funcs/Makefile b/src/test/set_funcs/Makefile index 34eb2570ad9..44e0fda46c1 100644 --- a/src/test/set_funcs/Makefile +++ b/src/test/set_funcs/Makefile @@ -11,8 +11,3 @@ LIBPMEM=y LIBPMEMOBJ=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/tools/pmemdetect/Makefile b/src/test/tools/pmemdetect/Makefile index 81d17b7bd04..e1127f7ff03 100644 --- a/src/test/tools/pmemdetect/Makefile +++ b/src/test/tools/pmemdetect/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2022, Intel Corporation +# Copyright 2016-2023, Intel Corporation # # Makefile -- Makefile for pmemdetect tool # @@ -12,6 +12,5 @@ OBJS = pmemdetect.o LIBPMEM=y TOOLS_COMMON=y -LIBPMEMBLK_PRIV=btt_info_convert2h include $(TOP)/src/tools/Makefile.inc diff --git a/src/test/tools/pmemspoil/README b/src/test/tools/pmemspoil/README index 1ede7b7c5d9..b8b953253c4 100644 --- a/src/test/tools/pmemspoil/README +++ b/src/test/tools/pmemspoil/README @@ -23,7 +23,6 @@ contain index of specified structure if there is more than one in a pool file. The pmemspoil supports the following structures: - pool_hdr - see util.h for details - pmemlog - see log.h for details - - pmemblk - see blk.h for details - arena - specify arena index Examples: diff --git a/src/test/tools/pmemspoil/spoil.c b/src/test/tools/pmemspoil/spoil.c index a51d4eb1ee5..3c32038e5a9 100644 --- a/src/test/tools/pmemspoil/spoil.c +++ b/src/test/tools/pmemspoil/spoil.c @@ -494,44 +494,6 @@ pmemspoil_parse_args(struct pmemspoil *psp, char *appname, return 0; } -/* - * pmemspoil_get_arena_offset -- get offset to arena of given id - */ -static uint64_t -pmemspoil_get_arena_offset(struct pmemspoil *psp, uint32_t id, - uint64_t start_offset) -{ - struct btt_info *infop = calloc(sizeof(struct btt_info), 1); - if (!infop) - err(1, NULL); - - infop->nextoff = start_offset; - - uint64_t offset = 0; - ssize_t ret = 0; - id++; - while (id > 0) { - if (infop->nextoff == 0) { - free(infop); - return 0; - } - offset = offset + infop->nextoff; - if ((ret = pmemspoil_read(psp, infop, - sizeof(*infop), offset))) { - free(infop); - return 0; - } - - btt_info_convert2h(infop); - - id--; - } - - free(infop); - - return offset; -} - /* * pmemspoil_check_field -- compares field name and moves pointer if the same */ @@ -777,255 +739,6 @@ pmemspoil_process_pool_hdr(struct pmemspoil *psp, return PROCESS_RET; } -/* - * pmemspoil_process_btt_info_struct -- process btt_info at given offset - */ -static int -pmemspoil_process_btt_info_struct(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint64_t offset) -{ - struct btt_info btt_info; - - if (pmemspoil_read(psp, &btt_info, sizeof(btt_info), offset)) - return -1; - - PROCESS_BEGIN(psp, pfp) { - PROCESS_FIELD(&btt_info, sig, char); - PROCESS_FIELD(&btt_info, uuid, char); - PROCESS_FIELD(&btt_info, parent_uuid, char); - PROCESS_FIELD_LE(&btt_info, flags, uint32_t); - PROCESS_FIELD_LE(&btt_info, major, uint16_t); - PROCESS_FIELD_LE(&btt_info, minor, uint16_t); - PROCESS_FIELD_LE(&btt_info, external_lbasize, uint32_t); - PROCESS_FIELD_LE(&btt_info, external_nlba, uint32_t); - PROCESS_FIELD_LE(&btt_info, internal_lbasize, uint32_t); - PROCESS_FIELD_LE(&btt_info, internal_nlba, uint32_t); - PROCESS_FIELD_LE(&btt_info, nfree, uint32_t); - PROCESS_FIELD_LE(&btt_info, infosize, uint32_t); - PROCESS_FIELD_LE(&btt_info, nextoff, uint64_t); - PROCESS_FIELD_LE(&btt_info, dataoff, uint64_t); - PROCESS_FIELD_LE(&btt_info, mapoff, uint64_t); - PROCESS_FIELD_LE(&btt_info, flogoff, uint64_t); - PROCESS_FIELD_LE(&btt_info, infooff, uint64_t); - PROCESS_FIELD(&btt_info, unused, char); - PROCESS_FIELD_LE(&btt_info, checksum, uint64_t); - } PROCESS_END - - if (PROCESS_STATE == PROCESS_STATE_FIELD) { - if (pmemspoil_write(psp, &btt_info, sizeof(btt_info), offset)) - return -1; - } - - return PROCESS_RET; -} - -/* - * pmemspoil_process_btt_info_backup -- process btt_info backup fields - */ -static int -pmemspoil_process_btt_info_backup(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint32_t index) -{ - struct btt_info btt_info_backup; - - if (pmemspoil_read(psp, &btt_info_backup, sizeof(btt_info_backup), - psp->arena_offset)) - return -1; - - uint64_t backup_offset = psp->arena_offset + - le64toh(btt_info_backup.infooff); - - return pmemspoil_process_btt_info_struct(psp, pfp, backup_offset); -} - -/* - * pmemspoil_process_btt_info -- process btt_info fields - */ -static int -pmemspoil_process_btt_info(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint32_t index) -{ - return pmemspoil_process_btt_info_struct(psp, pfp, psp->arena_offset); -} - -/* - * pmemspoil_process_btt_map -- process btt map fields - */ -static int -pmemspoil_process_btt_map(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint32_t index) -{ - struct btt_info btt_info; - - if (pmemspoil_read(psp, &btt_info, sizeof(btt_info), - psp->arena_offset)) - return -1; - - btt_info_convert2h(&btt_info); - - uint64_t mapoff = psp->arena_offset + btt_info.mapoff; - uint64_t mapsize = roundup(btt_info.external_nlba * BTT_MAP_ENTRY_SIZE, - BTT_ALIGNMENT); - - uint32_t *mapp = malloc(mapsize); - if (!mapp) - err(1, NULL); - int ret = 0; - - if (pmemspoil_read(psp, mapp, mapsize, mapoff)) { - ret = -1; - } else { - uint32_t v; - if (sscanf(pfp->value, "0x%x", &v) != 1 && - sscanf(pfp->value, "%u", &v) != 1) { - ret = -1; - } else { - mapp[index] = v; - if (pmemspoil_write(psp, mapp, mapsize, mapoff)) - ret = -1; - } - } - - free(mapp); - return ret; -} - -/* - * pmemspoil_process_btt_flog -- process btt_flog first or second fields - */ -static int -pmemspoil_process_btt_nflog(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint64_t arena_offset, int off, - uint32_t index) -{ - struct btt_info btt_info; - if (pmemspoil_read(psp, &btt_info, sizeof(btt_info), arena_offset)) - return -1; - - btt_info_convert2h(&btt_info); - - uint64_t flogoff = arena_offset + btt_info.flogoff; - uint64_t flogsize = btt_info.nfree * - roundup(2 * sizeof(struct btt_flog), BTT_FLOG_PAIR_ALIGN); - flogsize = roundup(flogsize, BTT_ALIGNMENT); - - uint8_t *flogp = malloc(flogsize); - if (!flogp) - err(1, NULL); - - int ret = 0; - - if (pmemspoil_read(psp, flogp, flogsize, flogoff)) { - ret = -1; - goto error; - } - - struct btt_flog *flog_entryp = (struct btt_flog *)(flogp + - index * BTT_FLOG_PAIR_ALIGN); - if (off) - flog_entryp++; - - PROCESS_BEGIN(psp, pfp) { - PROCESS_FIELD_LE(flog_entryp, lba, uint32_t); - PROCESS_FIELD_LE(flog_entryp, old_map, uint32_t); - PROCESS_FIELD_LE(flog_entryp, new_map, uint32_t); - PROCESS_FIELD_LE(flog_entryp, seq, uint32_t); - } PROCESS_END - - if (PROCESS_STATE == PROCESS_STATE_FIELD) { - if (pmemspoil_write(psp, flogp, flogsize, flogoff)) { - ret = -1; - goto error; - } - } - ret = PROCESS_RET; -error: - free(flogp); - - return ret; -} - -/* - * pmemspoil_process_btt_flog -- process first btt flog entry - */ -static int -pmemspoil_process_btt_flog(struct pmemspoil *psp, struct pmemspoil_list *pfp, - uint32_t index) -{ - return pmemspoil_process_btt_nflog(psp, pfp, - psp->arena_offset, 0, index); -} - -/* - * pmemspoil_process_btt_flog_prime -- process second btt flog entry - */ -static int -pmemspoil_process_btt_flog_prime(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint32_t index) -{ - return pmemspoil_process_btt_nflog(psp, pfp, - psp->arena_offset, 1, index); -} - -/* - * pmemspoil_process_arena -- process arena fields - */ -static int -pmemspoil_process_arena(struct pmemspoil *psp, - struct pmemspoil_list *pfp, uint64_t arena_offset) -{ - if (!arena_offset) - return -1; - - struct btt_info btt_info; - if (pmemspoil_read(psp, &btt_info, sizeof(btt_info), arena_offset)) - return -1; - - btt_info_convert2h(&btt_info); - psp->arena_offset = arena_offset; - - PROCESS_BEGIN(psp, pfp) { - PROCESS(btt_info, PROCESS_INDEX, 1, uint32_t); - PROCESS(btt_info_backup, PROCESS_INDEX, 1, uint32_t); - PROCESS(btt_map, PROCESS_INDEX, btt_info.external_nlba, - uint32_t); - PROCESS(btt_flog, PROCESS_INDEX, btt_info.nfree, uint32_t); - PROCESS(btt_flog_prime, PROCESS_INDEX, btt_info.nfree, - uint32_t); - } PROCESS_END - - return PROCESS_RET; -} - -/* - * pmemspoil_process_pmemblk -- process pmemblk fields - */ -static int -pmemspoil_process_pmemblk(struct pmemspoil *psp, - struct pmemspoil_list *pfp, void *arg) -{ - struct pmemblk pmemblk; - if (pmemspoil_read(psp, &pmemblk, sizeof(pmemblk), 0)) - return -1; - - PROCESS_BEGIN(psp, pfp) { - PROCESS_FIELD_LE(&pmemblk, bsize, uint32_t); - - PROCESS(arena, - pmemspoil_get_arena_offset(psp, PROCESS_INDEX, - ALIGN_UP(sizeof(struct pmemblk), - BLK_FORMAT_DATA_ALIGN)), - UINT32_MAX, uint64_t); - } PROCESS_END - - if (PROCESS_STATE == PROCESS_STATE_FIELD) { - if (pmemspoil_write(psp, &pmemblk, sizeof(pmemblk), 0)) - return -1; - } - - return PROCESS_RET; -} - /* * pmemspoil_process_pmemlog -- process pmemlog fields */ @@ -1213,7 +926,6 @@ pmemspoil_process(struct pmemspoil *psp, PROCESS_BEGIN(psp, pfp) { PROCESS(pool_hdr, NULL, 1, void *); PROCESS(pmemlog, NULL, 1, void *); - PROCESS(pmemblk, NULL, 1, void *); PROCESS(pmemobj, NULL, 1, void *); } PROCESS_END diff --git a/src/test/tools/pmemwrite/Makefile b/src/test/tools/pmemwrite/Makefile index f9e6f1bd91c..043767f10b6 100644 --- a/src/test/tools/pmemwrite/Makefile +++ b/src/test/tools/pmemwrite/Makefile @@ -20,7 +20,7 @@ LIBPMEMBLK_PRIV=btt_info_convert2h include $(TOP)/src/tools/Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemlog is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemlog despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/tools/pmemwrite/write.c b/src/test/tools/pmemwrite/write.c index edd0d3c136c..36cb6660610 100644 --- a/src/test/tools/pmemwrite/write.c +++ b/src/test/tools/pmemwrite/write.c @@ -15,7 +15,6 @@ #include "common.h" #include "output.h" #include -#include #include #include "mmap.h" #include "queue.h" @@ -78,96 +77,6 @@ pmemwrite_log(struct pmemwrite *pwp) return ret; } -/* - * pmemwrite_blk -- write data to pmemblk pool file - */ -static int -pmemwrite_blk(struct pmemwrite *pwp) -{ - PMEMblkpool *pbp = pmemblk_open(pwp->fname, 0); - - if (!pbp) { - warn("%s", pwp->fname); - return -1; - } - - int i; - int ret = 0; - size_t blksize = pmemblk_bsize(pbp); - char *blk = malloc(blksize); - if (!blk) { - ret = -1; - outv_err("malloc(%lu) failed\n", blksize); - goto nomem; - } - - for (i = 0; i < pwp->nargs; i++) { - int64_t blockno; - char *buff; - size_t buffsize = strlen(pwp->args[i]) + 1; - buff = malloc(buffsize); - if (buff == NULL) { - ret = -1; - outv_err("malloc(%lu) failed\n", buffsize); - goto end; - } - char flag; - /* :w: - write string to */ - if (sscanf(pwp->args[i], "%" SCNi64 ":w:%[^:]", - &blockno, buff) == 2) { - memset(blk, 0, blksize); - size_t bufflen = strlen(buff); - if (bufflen == 0) { - free(buff); - goto end; - } - if (bufflen > blksize) { - outv_err("String is longer than block size. " - "Truncating.\n"); - bufflen = blksize; - } - - memcpy(blk, buff, bufflen); - ret = pmemblk_write(pbp, blk, blockno); - free(buff); - if (ret) - goto end; - /* : - set flag on */ - } else if (sscanf(pwp->args[i], "%" SCNi64 ":%c", - &blockno, &flag) == 2) { - free(buff); - switch (flag) { - case 'z': - ret = pmemblk_set_zero(pbp, blockno); - break; - case 'e': - ret = pmemblk_set_error(pbp, blockno); - break; - default: - outv_err("Invalid flag '%c'\n", flag); - ret = -1; - goto end; - } - if (ret) { - warn("%s", pwp->fname); - goto end; - } - } else { - free(buff); - outv_err("Invalid argument '%s'\n", pwp->args[i]); - ret = -1; - goto end; - } - } -end: - free(blk); - -nomem: - pmemblk_close(pbp); - - return ret; -} - /* * pmemwrite_obj -- write data to pmemobj pool file */ @@ -242,9 +151,6 @@ main(int argc, char *argv[]) pmem_pool_parse_params(pmemwrite.fname, ¶ms, 1); switch (params.type) { - case PMEM_POOL_TYPE_BLK: - ret = pmemwrite_blk(&pmemwrite); - break; case PMEM_POOL_TYPE_LOG: ret = pmemwrite_log(&pmemwrite); break; diff --git a/src/test/traces_pmem/Makefile b/src/test/traces_pmem/Makefile index c96953bc6e4..662a1bb3a48 100644 --- a/src/test/traces_pmem/Makefile +++ b/src/test/traces_pmem/Makefile @@ -11,8 +11,3 @@ LIBPMEM=y LIBPMEMOBJ=y include ../Makefile.inc - -# Libpmemblk is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemblk despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/unittest/consts.py b/src/test/unittest/consts.py index 1c94d8cf602..80ace3f5043 100644 --- a/src/test/unittest/consts.py +++ b/src/test/unittest/consts.py @@ -6,7 +6,7 @@ from os.path import join, abspath, dirname # List of libraries for logging PMDK debug output -LIBS_LIST = ('pmem', 'pmem2', 'pmemobj', 'pmemblk', 'pmemlog', 'pmempool') +LIBS_LIST = ('pmem', 'pmem2', 'pmemobj', 'pmemlog', 'pmempool') # Constant paths to repository elements ROOTDIR = abspath(join(dirname(__file__), '..')) diff --git a/src/test/unittest/unittest.h b/src/test/unittest/unittest.h index 311334a2b75..b1ec78ffcb6 100644 --- a/src/test/unittest/unittest.h +++ b/src/test/unittest/unittest.h @@ -57,7 +57,6 @@ #include #include -#include #include #include diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index be077a9d1ba..23b65a7b125 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -285,8 +285,6 @@ fi # export PMEM_LOG_LEVEL=3 export PMEM_LOG_FILE=pmem$UNITTEST_NUM.log -export PMEMBLK_LOG_LEVEL=3 -export PMEMBLK_LOG_FILE=pmemblk$UNITTEST_NUM.log export PMEMLOG_LOG_LEVEL=3 export PMEMLOG_LOG_FILE=pmemlog$UNITTEST_NUM.log export PMEMOBJ_LOG_LEVEL=3 @@ -1845,7 +1843,6 @@ function setup() { lock_devdax fi - export PMEMBLK_CONF="fallocate.at_create=0;" export PMEMOBJ_CONF="fallocate.at_create=0;" export PMEMLOG_CONF="fallocate.at_create=0;" }