On Tue, Mar 19, 2019 at 03:58:24PM +0800, Qu Wenruo wrote: > Should we put kernel test cases into btrfs-progs?
We collect all the images in btrfs-progs. > We have fuzzed test groups for btrfs-progs mainly, but we don't really > have kernel tests in btrfs-progs. > Is it proper to put kernel-crashing tests into btrfs-progs? Yes, but they should not be run by default. Currently there's not even a test script for mounting the images. But the testsuite can be run independently in a VM so the kernel tests make sense too. > If not, where should we put such tests? > > And BTW, I originally wanted to craft the minimal image for those tests, > but quite a lot of the image needs several corruption combined to hit > the pitfall. I'm not sure if it's worthy to create the minimal image. That probably depends how much other work does the minimal image save. The plan is to use python-btrfs to craft the images on-the-fly. We could do that by specific tools written in C or enhance btrfs-corroupt-block, but I'm strongly in favor of the python way due to simplicity. Another way is to use the script only to generate the image and then store it for tests to avoid the run-time dependency on python-btrfs.