generic/420: truncate testfile before executing the test
authorIlya Dryomov <idryomov@gmail.com>
Fri, 25 Aug 2017 12:04:41 +0000 (14:04 +0200)
committerEryu Guan <eguan@redhat.com>
Sun, 27 Aug 2017 14:52:26 +0000 (22:52 +0800)
commitaf04d7247fa3ca2a63f8523890ef9fff97522cf4
treee0cf8d84b4f7e48e93fc7012bb5c04eb9611a0f7
parenta0c87b8074c9323a2c73494810336e3ddc528085
generic/420: truncate testfile before executing the test

If generic/437 is run before generic/420, the latter fails with:

  4c4
  < stat.size = 2048
  ---
  > stat.size = 2097152

because both use $TEST_DIR/testfile.  generic/437 leaves it at 2M,
while generic/420 assumes that it is empty (or at least smaller than
2048 bytes).

Use a private test file (testfile.$seq) and truncate it on open just in
case.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/420