For testing purposes, we're adding a mock WNBD daemon which is
going to record the requests it receives and send predetermined
replies. It's based on our Ceph WnbdHandler.
This commit provides a few relatively simple test cases that:
map a mock WNBD disk and validate the WnbdShow output
test invalid wnbd disk parameters
cover various scenarios:
cache enabled/disabled
various sector sizes
various disk sizes, up to 2PB (we haven't defined a maximum
disk size yet though)
perform a few simple IO operations
read, write, flush
various offsets, including the beginning/end of the disk as well
as invalid offsets, expecting an error
various IO sizes: one sector and then twice the maximum transfer
size, expecting fragmented operations
check the returned data as well as the recorder requests, ensuring
that flags such as FUA are set if required
While at it, we're fixing a few issues that were uncovered by the tests:
libwnbd incorrect log formatting that can lead to a crash
have WnbdWaitDispatcher wait for dispatcher threads instead of immediately returning once receiving the disconnect event
temporarily enforce the sector size to be 512 due to issues that we're experiencing with larger sector sizes
Add wnbd tests
For testing purposes, we're adding a mock WNBD daemon which is going to record the requests it receives and send predetermined replies. It's based on our Ceph WnbdHandler.
This commit provides a few relatively simple test cases that:
While at it, we're fixing a few issues that were uncovered by the tests:
Signed-off-by: Lucian Petrut lpetrut@cloudbasesolutions.com