summaryrefslogtreecommitdiff
path: root/tests/README.md
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-23 15:29:41 +0100
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:15:55 +0200
commitacd4df738165e1e4b16e199ee70b77d3e64a260a (patch)
tree1169ad5ed2ea183524887ae22a236675e3036139 /tests/README.md
parentf3219ad42fc3608aee629065c5a33863b5d7082b (diff)
btrfs-progs: tests: update README, images, coding style
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/README.md')
-rw-r--r--tests/README.md24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/README.md b/tests/README.md
index d4b80da..d14d727 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -189,6 +189,27 @@ $ TEST=012\* ./misc-tests.sh # from tests/
7. A commit that fixes a bug should be applied before the test that verifies
the fix. This is to keep the git history bisectable.
+
+### Test images
+
+Most tests should be able to create the test images from scratch, using regular
+commands and file operation. The commands also document the testcase and use
+the teste code and kernel of the environment.
+
+In other cases, a pre-created image may be the right way if the above does not
+work (eg. comparing output, requesting an exact layout or some intermediate
+state that would be hard to achieve otherwise).
+
+* images that don't need data and valid checksums can be created by
+ `btrfs-image`, the image can be compressed by the tool itself (file extension
+ `.img`) or compressed externally (recognized is `.img.xz`)
+
+* raw images that are binary dump of an existing image, created eg. from a
+ sparse file (`.raw` or `.raw.xz`)
+
+Use `xz --best` and try to get the smallest size as the file is stored in git.
+
+
### Crafted/fuzzed images
Images that are created by fuzzing or specially crafted to trigger some error
@@ -232,9 +253,10 @@ The tests assume write acesss to their directories.
* quote all variables by default, any path, even the TOP could need that, and
we use it everywhere
+ * even if the variable is safe, use quotes for consistency and to ease
+ reading the code
* there are exceptions:
* `$SUDO_HELPER` as it might be intentionally unset
- * the variable is obviously set to a value that does not require it
* use `#!/bin/bash` explicitly
* check for all external dependencies (`check_prereq_global`)
* check for internal dependencies (`check_prereq`), though the basic set is