fstests: Add path $here before src/<file>
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 21 Oct 2019 13:35:46 +0000 (21:35 +0800)
committerEryu Guan <guaneryu@gmail.com>
Wed, 23 Oct 2019 15:12:42 +0000 (23:12 +0800)
commitb7cecbea22ba6d5c42e59df8911d1c5278bcadc6
tree492125225d6ea892ed177a15a5151d0de798fd4f
parent74dfaaaacd91fc8a28b751b491b001ad9a9a0416
fstests: Add path $here before src/<file>

Calling src/<file> without path '$here' may cause the problem that
the file cannot be found.

For example, Running generic/192 with overlayfs(Let ubifs as base
fs) yields the following output:

  generic/192 - output mismatch
     QA output created by 192
     sleep for 5 seconds
     test
    +./common/rc: line 316: src/t_dir_type: No such file or directory
     delta1 is in range
     delta2 is in range
    ...

When the use case fails, the call stack in generic/192 is:

  local unknowns=$(src/t_dir_type $dir u | wc -l) common/rc
  _supports_filetype common/rc
  _overlay_mount common/overlay
  _overlay_test_mount common/overlay
  _test_mount common/rc
  _test_cycle_mount generic/192

Before _test_cycle_mount() being invoked, generic/192 executed 'cd
/' to change work dir from 'xfstests-dev' to '/', so src/t_dir_type
was not found.

[Eryu: some tests run src/<file> as regular user, don't add $here
prefix in such case, as a regular user may have no search permission
on $here]

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
94 files changed:
common/encrypt
common/locktest
common/populate
common/quota
common/rc
common/renameat2
common/repair
tests/generic/002
tests/generic/014
tests/generic/035
tests/generic/042
tests/generic/068
tests/generic/084
tests/generic/088
tests/generic/093
tests/generic/120
tests/generic/124
tests/generic/125
tests/generic/129
tests/generic/223
tests/generic/252
tests/generic/257
tests/generic/310
tests/generic/317
tests/generic/331
tests/generic/332
tests/generic/340
tests/generic/344
tests/generic/345
tests/generic/346
tests/generic/354
tests/generic/379
tests/generic/385
tests/generic/398
tests/generic/401
tests/generic/413
tests/generic/417
tests/generic/418
tests/generic/419
tests/generic/426
tests/generic/428
tests/generic/437
tests/generic/438
tests/generic/462
tests/generic/486
tests/generic/524
tests/shared/032
tests/xfs/009
tests/xfs/024
tests/xfs/030
tests/xfs/032
tests/xfs/033
tests/xfs/034
tests/xfs/041
tests/xfs/042
tests/xfs/048
tests/xfs/052
tests/xfs/061
tests/xfs/062
tests/xfs/066
tests/xfs/071
tests/xfs/081
tests/xfs/111
tests/xfs/114
tests/xfs/121
tests/xfs/136
tests/xfs/181
tests/xfs/197
tests/xfs/206
tests/xfs/238
tests/xfs/240
tests/xfs/241
tests/xfs/260
tests/xfs/269
tests/xfs/272
tests/xfs/274
tests/xfs/276
tests/xfs/282
tests/xfs/283
tests/xfs/285
tests/xfs/286
tests/xfs/294
tests/xfs/331
tests/xfs/335
tests/xfs/336
tests/xfs/337
tests/xfs/341
tests/xfs/342
tests/xfs/422
tests/xfs/423
tests/xfs/443
tests/xfs/444
tests/xfs/509
tests/xfs/510