Whamcloud - gitweb
LU-17310 tests: make m_assume_storage_prezeroed more robust
Don't assume that mke2fs is going to zero out an exact number
of blocks when run with/without "-E assume_storage_prezeroed",
since this depends on a number of different options that are
not specified in the test script.
Instead, check that the number of blocks zeroed in the image is
a small fraction (1/40th) of the number of blocks zeroed when
"-E assume_sotrage_prezeroed" is not given, which makes it more
robust when running in different environments. This varies from
1/47 in the original test to 1/91 in my local test environment.
Avoid "losetup --sector-size 4096", use "mke2fs -b 4096" instead.
Clean up the loop device before checking "stat" so that all
blocks are flushed to the backing storage before calling sync.
Only one loop device and test file is needed for the test.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Change-Id: I98fc3f5334cb8e2dd754c5d4994f2ca582300c13
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/53217
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>