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>
This commit is contained in:
Chao Yu
2019-11-01 18:28:21 +08:00
committed by Eryu Guan
parent eff343fb5d
commit 11d3da6a7f
18 changed files with 29 additions and 29 deletions
+5
View File
@@ -165,6 +165,11 @@ if [ ! -z "$REPORT_LIST" ]; then
_assert_report_list
fi
_get_filesize()
{
stat -c %s "$1"
}
_mount()
{
$MOUNT_PROG `_mount_ops_filter $*`