Added test.py support for tmpfs-backed disks

RAM-backed testing is faster than file-backed testing. This is why
test.py uses rambd by default.

So why add support for tmpfs-backed disks if we can already run tests in
RAM? For reentrant testing.

Under reentrant testing we simulate power-loss by forcefully exiting the
test program at specific times. To make this power-loss meaningful, we need to
persist the disk across these power-losses. However, it's interesting to
note this persistence doesn't need to be actually backed by the
filesystem.

It may be possible to rearchitecture the tests to simulate power-loss a
different way, by say, using coroutines or setjmp/longjmp to leave
behind ongoing filesystem operations without terminating the program
completely. But at this point, I think it's best to work with what we
have.

And simply putting the test disks into a tmpfs mount-point seems to
work just fine.

Note this does force serialization of the tests, which isn't required
otherwise. Currently they are only serialized due to limitations in
test.py. If a future change wants to perallelize the tests, it may need
to rework RAM-backed reentrant tests.
This commit is contained in:
Christopher Haster
2020-02-12 10:48:54 -06:00
parent 9f546f154f
commit f4b17b379c
2 changed files with 15 additions and 6 deletions

View File

@@ -15,6 +15,12 @@ script:
-Duser_provided_block_device_sync=NULL
-include stdio.h"
# setup a ram-backed disk to speed up reentrant tests
- |
mkdir disks
sudo mount -t tmpfs -o size=100m tmpfs disks
export TFLAGS="$TFLAGS --disk=disks/disk"
# run tests
- make clean test TFLAGS+="-nrk"