Allow for '-h' and other options such as disabling the journal sync tests,
defining it is to be run on a btrfs FS, enabling exit on error (default is
now 'off'), and allow certain env variables to specify additional options
to each store.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
Make them unique by appending -<ptr>, so that the json we dump will remain
valid.
We may also want to allow people to share counters of the same type.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
The prt() varargs function generates this warning
test/rbd/fsx.c: In function ‘prt’:
warning: test/rbd/fsx.c:203:2: format not a string literal and no format arguments [-Wformat-security]
warning: test/rbd/fsx.c:205:3: format not a string literal and no format arguments [-Wformat-security]
Disable that check for the fsx build only.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
I was seeing failures of LibRBD.TestIOToSnapshot where we would fail to
refresh after rollback, even though the snap existed. I assume it is
because the std::string whose c_str() we were pointing to was reallocated.
Use a std::string here instead.
This code is weird.
Signed-off-by: Sage Weil <sage@newdream.net>
In collection_add we have a two-phase guard set on the linked object via
the old name. During replay, we might see that the dest name is missing
and replay the operation, and in the process overwrite a newer guard with
an older one.
Avoid this by checking the source name too, and skipping the operation
entirely if a new guard exists.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Use FileStoreDiff instead of having the diff code embedded in the test,
allowing for more tests and people to use the code in case it comes in
hand.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
This code should be on a stand-alone class, instead of being embedded on
a single test, in case someone or something find it useful somewhere down
the line.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
The caller is still invalidating the entire cache, so we don't need to
deal with discard at this level. That might be worth cleaning up
later, though.
Fixes: #2296
Signed-off-by: Sage Weil <sage@newdream.net>
Do not assume the object extents are at the trailing edge of objects.
Instead, discard arbitrary extents. Fix callers.
Signed-off-by: Sage Weil <sage@newdream.net>
handle_sparse_read() was taking buf_ofs and buf_len, but buf_len was being
interpreted as the total size of the buffer, not the length of the extent
in the buffer start at buf_ofs. Both callers pass in an extent length, so
fix the zero code to do the right thing.
Specifically, the behavior I saw was:
- read range spanning 2 objects, trailing 20k and leading 50k
- first object didn't exist, zeroed first 20k of buffer
- second object didn't exist, zeroed next 30k (50k-20k) of buffer
- the last 20k of buffer was unzeroed.
Signed-off-by: Sage Weil <sage@newdream.net>
This makes it easier to interpret the dump, and makes it obvious what is
dump (and potentially a dup of something that was already logged) and what
is not.
Signed-off-by: Sage Weil <sage@newdream.net>