diff --git a/runners/test_runner.c b/runners/test_runner.c index b4ee92a5..423bd1b7 100644 --- a/runners/test_runner.c +++ b/runners/test_runner.c @@ -859,9 +859,10 @@ static void summary(void) { char perm_buf[64]; sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total); char flag_buf[64]; - sprintf(flag_buf, "%s%s%s", - (flags & TEST_REENTRANT) ? "r" : "", + sprintf(flag_buf, "%s%s%s%s", (flags & TEST_INTERNAL) ? "i" : "", + (flags & TEST_REENTRANT) ? "r" : "", + (flags & TEST_FUZZ) ? "f" : "", (!flags) ? "-" : ""); printf("%-23s %7s %7zu %7zu %15s\n", "TOTAL", @@ -918,9 +919,10 @@ static void list_suites(void) { char perm_buf[64]; sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total); char flag_buf[64]; - sprintf(flag_buf, "%s%s%s", - (test_suites[i]->flags & TEST_REENTRANT) ? "r" : "", + sprintf(flag_buf, "%s%s%s%s", (test_suites[i]->flags & TEST_INTERNAL) ? "i" : "", + (test_suites[i]->flags & TEST_REENTRANT) ? "r" : "", + (test_suites[i]->flags & TEST_FUZZ) ? "f" : "", (!test_suites[i]->flags) ? "-" : ""); printf("%-*s %7s %7zu %15s\n", name_width, @@ -971,11 +973,13 @@ static void list_cases(void) { char perm_buf[64]; sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total); char flag_buf[64]; - sprintf(flag_buf, "%s%s%s", - (test_suites[i]->cases[j].flags & TEST_REENTRANT) - ? "r" : "", + sprintf(flag_buf, "%s%s%s%s", (test_suites[i]->cases[j].flags & TEST_INTERNAL) ? "i" : "", + (test_suites[i]->cases[j].flags & TEST_REENTRANT) + ? "r" : "", + (test_suites[i]->cases[j].flags & TEST_FUZZ) + ? "f" : "", (!test_suites[i]->cases[j].flags) ? "-" : ""); printf("%-*s %7s %15s\n", diff --git a/runners/test_runner.h b/runners/test_runner.h index a2e3c3f0..cf271f23 100644 --- a/runners/test_runner.h +++ b/runners/test_runner.h @@ -35,6 +35,7 @@ struct lfs_config; enum test_flags { TEST_INTERNAL = 0x1, TEST_REENTRANT = 0x2, + TEST_FUZZ = 0x4, }; typedef uint8_t test_flags_t; diff --git a/scripts/test.py b/scripts/test.py index ab62c395..bbce9a17 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -59,10 +59,13 @@ class TestCase: self.code_lineno = config.pop('code_lineno', None) self.in_ = config.pop('in', config.pop('suite_in', None)) + self.fuzz_ = config.pop('fuzz', + config.pop('suite_fuzz', None)) self.internal = bool(self.in_) self.reentrant = config.pop('reentrant', config.pop('suite_reentrant', False)) + self.fuzz = bool(self.fuzz_) # figure out defines and build possible permutations self.defines = set() @@ -207,6 +210,7 @@ class TestSuite: if not case_linenos or l < case_linenos[0][0]), default=None) self.in_ = config.pop('in', None) + self.fuzz_ = config.pop('fuzz', None) self.after = config.pop('after', []) if not isinstance(self.after, list): @@ -226,6 +230,7 @@ class TestSuite: 'suite_defines': defines, 'suite_in': self.in_, 'suite_reentrant': reentrant, + 'suite_fuzz': self.fuzz_, **case}, args=args)) @@ -239,6 +244,7 @@ class TestSuite: # combine other per-case things self.internal = any(case.internal for case in self.cases) self.reentrant = any(case.reentrant for case in self.cases) + self.fuzz = any(case.fuzz for case in self.cases) for k in config.keys(): print('%swarning:%s in %s, found unused key %r' % ( @@ -464,7 +470,8 @@ def compile(test_paths, **args): f.writeln(4*' '+'.flags = %s,' % (' | '.join(filter(None, [ 'TEST_INTERNAL' if suite.internal else None, - 'TEST_REENTRANT' if suite.reentrant else None])) + 'TEST_REENTRANT' if suite.reentrant else None, + 'TEST_FUZZ' if suite.fuzz else None])) or 0)) # create suite defines if suite.defines: @@ -484,7 +491,8 @@ def compile(test_paths, **args): f.writeln(12*' '+'.flags = %s,' % (' | '.join(filter(None, [ 'TEST_INTERNAL' if case.internal else None, - 'TEST_REENTRANT' if case.reentrant else None])) + 'TEST_REENTRANT' if case.reentrant else None, + 'TEST_FUZZ' if case.fuzz else None])) or 0)) # create case defines if case.defines: diff --git a/tests/test_badblocks.toml b/tests/test_badblocks.toml index 1108358d..f739d8e1 100644 --- a/tests/test_badblocks.toml +++ b/tests/test_badblocks.toml @@ -16,9 +16,10 @@ defines.BADBLOCK_BEHAVIOR = [ # 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] -defines.SEED = 42 # maximize lookahead buffer to avoid alloc scans defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)' +defines.SEED = 42 +fuzz = 'SEED' in = 'lfs.c' code = ''' // test all possible bad blocks @@ -122,9 +123,10 @@ defines.BADBLOCK_BEHAVIOR = [ ] defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] -defines.SEED = 42 # maximize lookahead buffer to avoid alloc scans defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)' +defines.SEED = 42 +fuzz = 'SEED' in = 'lfs.c' code = ''' // test a large region of bad blocks @@ -225,9 +227,10 @@ defines.BADBLOCK_BEHAVIOR = [ ] defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] -defines.SEED = 42 # maximize lookahead buffer to avoid alloc scans defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)' +defines.SEED = 42 +fuzz = 'SEED' in = 'lfs.c' code = ''' // test a large region of bad blocks @@ -333,6 +336,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] # do more ops than dirs to encourage rename collisions defines.OPS = '2*N' defines.SEED = 42 +fuzz = 'SEED' code = ''' // test all possible bad blocks for (lfs_size_t i = 2; @@ -463,6 +467,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] # do more ops than dirs to encourage rename collisions defines.OPS = '2*N' defines.SEED = 42 +fuzz = 'SEED' code = ''' // test a large region of bad blocks for (lfs_size_t i = 0; i < BLOCK_COUNT/2; i++) { @@ -594,6 +599,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] # do more ops than dirs to encourage rename collisions defines.OPS = '2*N' defines.SEED = 42 +fuzz = 'SEED' code = ''' // test a large region of bad blocks for (lfs_size_t i = 0; i < BLOCK_COUNT/2; i++) { @@ -735,6 +741,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test all possible bad blocks @@ -894,6 +901,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test a large region of bad blocks @@ -1054,6 +1062,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test a large region of bad blocks @@ -1203,7 +1212,6 @@ defines.BADBLOCK_BEHAVIOR = [ # 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] defines.N = 20 -defines.SEED = 42 defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -1220,6 +1228,8 @@ defines.CHUNK = [32, 8, 1] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 42 +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1376,7 +1386,6 @@ defines.BADBLOCK_BEHAVIOR = [ ] defines.MIRROR = [false, true] defines.N = 20 -defines.SEED = 42 defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -1393,6 +1402,8 @@ defines.CHUNK = [32, 8, 1] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 42 +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1550,7 +1561,6 @@ defines.BADBLOCK_BEHAVIOR = [ ] defines.MIRROR = [false, true] defines.N = 20 -defines.SEED = 42 defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -1567,6 +1577,8 @@ defines.CHUNK = [32, 8, 1] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 42 +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1736,6 +1748,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test all possible bad blocks @@ -2177,6 +2190,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test a large region of bad blocks @@ -2617,6 +2631,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // test a large region of bad blocks diff --git a/tests/test_btree.toml b/tests/test_btree.toml index 68df1d59..74f049e9 100644 --- a/tests/test_btree.toml +++ b/tests/test_btree.toml @@ -398,6 +398,7 @@ code = ''' [cases.test_btree_push_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -547,6 +548,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.W = 5 defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -913,6 +915,7 @@ code = ''' [cases.test_btree_update_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -1071,6 +1074,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.W = 5 defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -1664,6 +1668,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.REMAINING = [64, 2, 1, 0] defines.SEED = 'range(20)' +fuzz = 'SEED' if = 'N > REMAINING' in = 'lfs.c' code = ''' @@ -1857,6 +1862,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.W = 5 defines.REMAINING = [64, 2, 1, 0] defines.SEED = 'range(20)' +fuzz = 'SEED' if = 'N > REMAINING' in = 'lfs.c' code = ''' @@ -2066,6 +2072,7 @@ code = ''' [cases.test_btree_split_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -2214,6 +2221,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.W = 5 defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -2669,6 +2677,7 @@ code = ''' [cases.test_btree_general_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -2774,6 +2783,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] defines.W = 5 defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -3324,6 +3334,7 @@ code = ''' [cases.test_btree_find_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -3511,6 +3522,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.W = 5 defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -3666,6 +3678,7 @@ code = ''' [cases.test_btree_find_general_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -3822,6 +3835,7 @@ code = ''' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] defines.W = 5 defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -4148,6 +4162,7 @@ code = ''' [cases.test_btree_traversal_fuzz] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] defines.SEED = 'range(20)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; diff --git a/tests/test_dirs.toml b/tests/test_dirs.toml index caafc797..44d2d256 100644 --- a/tests/test_dirs.toml +++ b/tests/test_dirs.toml @@ -1341,6 +1341,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.PARENT = [false, true] defines.SEED = 'range(20)' +fuzz = 'SEED' # limit powerloss testing due to time if = '!TEST_PLS || N <= 8' reentrant = true @@ -4128,6 +4129,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.PARENT = [false, true] defines.SEED = 'range(20)' +fuzz = 'SEED' # limit powerloss testing due to time if = '!TEST_PLS || N <= 8' reentrant = true @@ -6639,6 +6641,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.PARENT = [false, true] defines.SEED = 'range(20)' +fuzz = 'SEED' # limit powerloss testing due to time if = '!TEST_PLS || N <= 8' reentrant = true @@ -6790,6 +6793,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.PARENT = [false, true] defines.SEED = 'range(20)' +fuzz = 'SEED' # limit powerloss testing due to time if = '!TEST_PLS || N <= 8' reentrant = true diff --git a/tests/test_exhaustion.toml b/tests/test_exhaustion.toml index 4c78947b..23a34c15 100644 --- a/tests/test_exhaustion.toml +++ b/tests/test_exhaustion.toml @@ -25,6 +25,7 @@ defines.ERASE_CYCLES = 10 defines.BLOCK_RECYCLES = 4 defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.SEED = 42 +fuzz = 'SEED' code = ''' // run our test twice, once with 1/2 the storage, once with 2/2 the // storage, and compare how many operations we were able to perform @@ -223,6 +224,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // run our test twice, once with 1/2 the storage, once with 2/2 the @@ -484,6 +486,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // run our test twice, once with 1/2 the storage, once with 2/2 the @@ -887,6 +890,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 42 +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' // run our test twice, once with 1/2 the storage, once with 2/2 the diff --git a/tests/test_files.toml b/tests/test_files.toml index ee37aba8..55bf10bd 100644 --- a/tests/test_files.toml +++ b/tests/test_files.toml @@ -792,6 +792,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -1154,6 +1155,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -2270,6 +2272,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -2466,6 +2469,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -2686,6 +2690,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' reentrant = true code = ''' diff --git a/tests/test_forphans.toml b/tests/test_forphans.toml index d4548af2..8e888cc5 100644 --- a/tests/test_forphans.toml +++ b/tests/test_forphans.toml @@ -6662,6 +6662,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -7000,6 +7001,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(20)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; diff --git a/tests/test_fsync.toml b/tests/test_fsync.toml index 6d765e20..ba6abc5a 100644 --- a/tests/test_fsync.toml +++ b/tests/test_fsync.toml @@ -534,7 +534,6 @@ code = ''' [cases.test_fsync_rrrr_fuzz] defines.R = 4 -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -545,6 +544,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -687,7 +688,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -698,6 +698,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -873,7 +875,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -884,6 +885,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -1066,7 +1069,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1077,6 +1079,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -1279,7 +1283,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1290,6 +1293,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -1391,7 +1396,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 40 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1402,6 +1406,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -1525,7 +1531,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 40 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1536,6 +1541,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -2426,7 +2433,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -2437,6 +2443,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -2619,7 +2627,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -2630,6 +2637,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -2827,7 +2836,6 @@ defines.SYNC = [0, 1, 2] # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 20 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -2838,6 +2846,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -2944,7 +2954,6 @@ defines.RW = 4 # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 40 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -2955,6 +2964,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -3093,7 +3104,6 @@ defines.RW = 4 # FLUSH=1 => flush via lfsr_file_flush # FLUSH=2 => flush via LFS_O_FLUSH defines.FLUSH = [0, 1, 2] -defines.SEED = 'range(20)' defines.N = 40 defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -3104,6 +3114,8 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.CHUNK = '(SIZE+16-1) / 16' +defines.SEED = 'range(20)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; diff --git a/tests/test_fwrite.toml b/tests/test_fwrite.toml index c1400a01..673d5bf3 100644 --- a/tests/test_fwrite.toml +++ b/tests/test_fwrite.toml @@ -1524,7 +1524,6 @@ code = ''' # fuzz testing [cases.test_fwrite_fuzz_aligned] defines.N = 20 -defines.SEED = 'range(10)' defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -1540,6 +1539,8 @@ defines.CHUNK = [32, 8, 1] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1666,7 +1667,6 @@ code = ''' # fuzz testing [cases.test_fwrite_fuzz_unaligned] defines.N = 20 -defines.SEED = 'range(10)' defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -1683,6 +1683,8 @@ defines.CHUNK = [32, 8] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1816,7 +1818,6 @@ code = ''' # more seek testing [cases.test_fwrite_r_seek] defines.N = 20 -defines.SEED = 'range(10)' defines.WHENCE = ['LFS_SEEK_SET', 'LFS_SEEK_CUR', 'LFS_SEEK_END'] defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1828,6 +1829,8 @@ defines.SIZE = [ ] # chunk is more an upper limit here defines.CHUNK = [32, 8] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -1894,7 +1897,6 @@ code = ''' # different seek methods [cases.test_fwrite_w_seek] defines.N = 10 -defines.SEED = 'range(10)' defines.WHENCE = ['LFS_SEEK_SET', 'LFS_SEEK_CUR', 'LFS_SEEK_END'] defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -1911,6 +1913,8 @@ defines.CHUNK = [32, 8] # INIT=2 => truncate to size defines.INIT = [0, 1, 2] defines.SYNC = [false, true] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -2042,7 +2046,6 @@ code = ''' # the above was just warmup, here's the real seek test [cases.test_fwrite_rw_seek] defines.N = 10 -defines.SEED = 'range(10)' defines.WHENCE = ['LFS_SEEK_SET', 'LFS_SEEK_CUR', 'LFS_SEEK_END'] defines.SIZE = [ 'FBUFFER_SIZE/2', @@ -2059,6 +2062,8 @@ defines.CHUNK = [32, 8] # INIT=2 => truncate to size defines.INIT = [0, 1, 2] defines.SYNC = [false, true] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time @@ -2322,7 +2327,6 @@ code = ''' # heavy fuzz test with rw seeks, truncate, and fruncate [cases.test_fwrite_rwtf_fuzz] defines.N = 20 -defines.SEED = 'range(10)' defines.SIZE = [ 'FBUFFER_SIZE/2', '2*FBUFFER_SIZE', @@ -2339,6 +2343,8 @@ defines.CHUNK = [32, 8] defines.INIT = [0, 1, 2] defines.SYNC = [false, true] defines.REMOUNT = [false, true] +defines.SEED = 'range(10)' +fuzz = 'SEED' if = [ 'CHUNK <= SIZE', # this just saves testing time diff --git a/tests/test_mtree.toml b/tests/test_mtree.toml index bb338667..024147e1 100644 --- a/tests/test_mtree.toml +++ b/tests/test_mtree.toml @@ -472,6 +472,7 @@ code = ''' defines.N = [5, 10, 20, 40, 80, 160] defines.FORCE_COMPACTION = [false, true] defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -1003,6 +1004,7 @@ code = ''' defines.N = [5, 10, 20, 40, 80, 160] defines.FORCE_COMPACTION = [false, true] defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -2078,6 +2080,7 @@ defines.N = [5, 10, 20, 40] defines.FORCE_COMPACTION = [false, true] defines.BLOCK_RECYCLES = [4, 1, 0] defines.SEED = 'range(500)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; @@ -3770,6 +3773,7 @@ defines.N = [5, 10, 20, 40, 80, 160] defines.VALIDATE = [false, true] defines.FORCE_COMPACTION = [false, true] defines.SEED = 'range(100)' +fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; diff --git a/tests/test_rbyd.toml b/tests/test_rbyd.toml index 3af13ddc..f0f92a63 100644 --- a/tests/test_rbyd.toml +++ b/tests/test_rbyd.toml @@ -3998,6 +3998,7 @@ code = ''' [cases.test_rbyd_fuzz_append_removes] defines.N = 'range(1, 33)' defines.SEED = 'range(1000)' +fuzz = 'SEED' # large progs take too long for now if = 'PROG_SIZE < 512' in = 'lfs.c' @@ -11818,6 +11819,7 @@ code = ''' [cases.test_rbyd_fuzz_create_deletes] defines.N = 'range(1, 33)' defines.SEED = 'range(1000)' +fuzz = 'SEED' # large progs take too long for now if = 'PROG_SIZE < 512' in = 'lfs.c' @@ -14954,6 +14956,7 @@ code = ''' defines.N = 'range(1, 33)' defines.M = 3 defines.SEED = 'range(1000)' +fuzz = 'SEED' # large progs take too long for now if = 'PROG_SIZE < 512' in = 'lfs.c' @@ -15114,6 +15117,7 @@ code = ''' defines.N = 'range(1, 33)' defines.W = 5 defines.SEED = 'range(1000)' +fuzz = 'SEED' # large progs take too long for now if = 'PROG_SIZE < 512' in = 'lfs.c' diff --git a/tests/test_relocations.toml b/tests/test_relocations.toml index 07e6d21e..3b9a7806 100644 --- a/tests/test_relocations.toml +++ b/tests/test_relocations.toml @@ -16,6 +16,7 @@ defines.BLOCK_RECYCLES = [4, 1, 0] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = 1024 defines.SEED = 'range(10)' +fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -175,6 +176,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(10)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -387,6 +389,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(10)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -726,6 +729,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(10)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; @@ -1150,6 +1154,7 @@ defines.SIZE = [ '4*BLOCK_SIZE', ] defines.SEED = 'range(10)' +fuzz = 'SEED' if = '(SIZE*N)/BLOCK_SIZE <= 16' reentrant = true code = '''