diff options
author | Christopher Haster <chaster@utexas.edu> | 2020-01-30 02:50:38 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2020-02-09 21:00:22 +0300 |
commit | 77e3078b9f28ff689e5a623250eae5c85ae8b3aa (patch) | |
tree | 6df4d5638a012fbe0da96dc974d3013b61e78102 /scripts | |
parent | 517d3414c5e04eedb07be2e58107c1f96b8b8684 (diff) |
Added/fixed tests for noop writes (where bd error can't be trusted)
It's interesting how many ways block devices can show failed writes:
1. prog can error
2. erase can error
3. read can error after writing (ECC failure)
4. prog doesn't error but doesn't write the data correctly
5. erase doesn't error but doesn't erase correctly
Can read fail without an error? Yes, though this appears the same as
prog and erase failing.
These weren't all simulated by testbd since I unintentionally assumed
the block device could always error. Fixed by added additional bad-black
behaviors to testbd.
Note: This also includes a small fix where we can miss bad writes if the
underlying block device contains a valid commit with the exact same
size in the exact same offset.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/test.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/scripts/test.py b/scripts/test.py index 3c3d692..cbc8838 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -52,7 +52,7 @@ DEFINES = { 'LFS_LOOKAHEAD_SIZE': 16, 'LFS_ERASE_VALUE': 0xff, 'LFS_ERASE_CYCLES': 0, - 'LFS_BADBLOCK_BEHAVIOR': 'LFS_TESTBD_BADBLOCK_NOPROG', + 'LFS_BADBLOCK_BEHAVIOR': 'LFS_TESTBD_BADBLOCK_PROGERROR', } PROLOGUE = """ // prologue @@ -183,12 +183,10 @@ class TestCase: return False elif self.if_ is not None: if_ = self.if_ - print(if_) while True: for k, v in self.defines.items(): if k in if_: if_ = if_.replace(k, '(%s)' % v) - print(if_) break else: break @@ -196,8 +194,6 @@ class TestCase: re.sub('(\&\&|\?)', ' and ', re.sub('(\|\||:)', ' or ', re.sub('!(?!=)', ' not ', if_)))) - print(if_) - print('---', eval(if_), '---') return eval(if_) else: return True |