unionmount-testsuite icon indicating copy to clipboard operation
unionmount-testsuite copied to clipboard

Overlayfs/snapshot tests

To run these tests:

 If testing overlayfs, do:

./run --ov

 To run the tests with nested overlayfs, do:

./run --ovov

 To run the tests without any unioning, do:

./run --no

 To just set up the environment and exit without doing any tests,
 add the -s flag, e.g.:

./run --ov -s

 To run overlayfs tests with all layers on the same underlying fs,
 add the --samefs flag, e.g.:

./run --ov --samefs

 To run overlayfs tests with lower layer on a squashfs image,
 add the --squashfs flag, e.g.:

./run --ov --squashfs

 To run overlayfs tests with up to N middle layers, do:

./run --ov=<N>

 The run will start with two layers and during some tests, upper layer
 will be rotated to the top of the lower layer stack and a new upper
 layer will be created.

 To run overlayfs tests with up to N middle layers, M middle layers on
 unique underlying filesystems, do:

./run --ov=<N> --maxfs=<M>

 The first M rotations will create a new filesystem as the upper layer.

 To run the tests using a FUSE overlay file system implementation:

./run --ov --fuse=<subfs-type>

The following environment variables are supported:

 UNIONMOUNT_BASEDIR  - parent dir of all samefs layers (default: /base)
 UNIONMOUNT_LOWERDIR - lower layer path for non samefs (default: /lower)
 UNIONMOUNT_MNTPOINT - mount point for executing tests (default: /mnt)

 When user provides UNIONMOUNT_LOWERDIR:

 1) Path should be an existing directory whose content will be deleted.
 2) Path is assumed to be on a different filesystem than base dir, so
    --samefs setup is not supported.

 When user provides UNIONMOUNT_BASEDIR:

 1) Path should be an existing directory whose content will be deleted.
 2) Upper layer and middle layers will be created under base dir.
 3) If UNIONMOUNT_MNTPOINT is not provided, the overlay mount point will
    be created under base dir.
 4) If UNIONMOUNT_LOWERDIR is not provided, the lower layer dir will be
    created under base dir.
 5) If UNIONMOUNT_LOWERDIR is not provided, the test setup defaults to
    --samefs (i.e. lower and upper layers are on the same base fs).
    However, if --maxfs=<M> is specified, a tmpfs instance will be mounted
    on the lower layer dir that was created under base dir.

For more advanced overlayfs test options and more examples, see: https://github.com/amir73il/overlayfs/wiki/Overlayfs-testing