common/rc: generalize _get_filesize()
authorChao Yu <yuchao0@huawei.com>
Fri, 1 Nov 2019 10:28:21 +0000 (18:28 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sat, 2 Nov 2019 06:30:14 +0000 (14:30 +0800)
commit11d3da6a7fe19b5220e21bb3abf7838fdc13534a
tree24844aa2ce5535386af3ecb5ed2d60a411697901
parenteff343fb5d5fa893e4ab53f93f07766c58d83e90
common/rc: generalize _get_filesize()

There are some testcases use below two kind of commands to get file
size, generalize the second way as global function _get_filesize()
to simply codes.

1. ls -l $1 | $AWK_PROG '{print $5}'
2. stat -c %s $1

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
18 files changed:
common/populate
common/rc
common/verity
tests/btrfs/086
tests/generic/013
tests/generic/275
tests/generic/286
tests/generic/297
tests/generic/298
tests/generic/315
tests/generic/399
tests/generic/497
tests/generic/514
tests/generic/572
tests/overlay/060
tests/xfs/014
tests/xfs/076
tests/xfs/306