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
