[LTP] [RFC PATCH 3/5] shell: Move shell code into functions
Petr Vorel
pvorel@suse.cz
Fri Feb 28 18:45:54 CET 2025
Hi all,
...
> diff --git a/testcases/lib/tests/shell_loader_all_filesystems.sh b/testcases/lib/tests/shell_loader_all_filesystems.sh
> index 91fac89fd6..33c73dfb41 100755
> --- a/testcases/lib/tests/shell_loader_all_filesystems.sh
> +++ b/testcases/lib/tests/shell_loader_all_filesystems.sh
> @@ -14,16 +14,22 @@
> . tst_loader.sh
> -tst_res TINFO "In shell"
> +tst_test()
> +{
> + local mntpath=$(realpath ltp_mntpoint)
And this is failing on old dash on Ubuntu Bionic:
https://github.com/pevik/ltp/actions/runs/13593238811/job/38004161850
I need to separate local declaration from adding value.
Kind regards,
Petr
*** Running 'shell_loader_all_filesystems.sh' (exp: TPASS) ***
tst_tmpdir.c:317: TINFO: Using /tmp/LTP_tstr4SvTK as tmpdir (overlayfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1905: TINFO: LTP version: 20250130
tst_test.c:1909: TINFO: Tested kernel: 6.8.0-1021-azure #25-Ubuntu SMP Wed Jan 15 20:45:09 UTC 2025 x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/boot/config-6.8.0-1021-azure'
tst_test.c:1729: TINFO: Overall timeout per run is 0h 00m 30s
tst_supported_fs_types.c:97: TINFO: Kernel supports ext2
tst_supported_fs_types.c:62: TINFO: mkfs.ext2 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext3
tst_supported_fs_types.c:62: TINFO: mkfs.ext3 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports xfs
tst_supported_fs_types.c:58: TINFO: mkfs.xfs does not exist
tst_supported_fs_types.c:97: TINFO: Kernel supports btrfs
tst_supported_fs_types.c:58: TINFO: mkfs.btrfs does not exist
tst_supported_fs_types.c:105: TINFO: Skipping bcachefs because of FUSE blacklist
tst_supported_fs_types.c:97: TINFO: Kernel supports vfat
tst_supported_fs_types.c:58: TINFO: mkfs.vfat does not exist
tst_supported_fs_types.c:128: TINFO: Filesystem exfat is not supported
tst_supported_fs_types.c:128: TINFO: Filesystem ntfs is not supported
tst_supported_fs_types.c:97: TINFO: Kernel supports tmpfs
tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
tst_test.c:1838: TINFO: === Testing on ext2 ===
tst_test.c:1175: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.44.1 (24-Mar-2018)
tst_test.c:1188: TINFO: Mounting /dev/loop0 to /tmp/LTP_tstr4SvTK/ltp_mntpoint fstyp=ext2 flags=0
/__w/ltp/ltp/testcases/lib/tst_exec.sh: 18: local: /tmp/LTP_tstr4SvTK/ltp_mntpoint: bad variable name
tst_test.c:1564: TBROK: Test haven't reported results!
> + local mounted=$(grep $mntpath /proc/mounts)
> + local device path
> -mntpath=$(realpath ltp_mntpoint)
> -mounted=$(grep $mntpath /proc/mounts)
> + tst_res TINFO "In shell"
> -if [ -n "$mounted" ]; then
> - device=$(echo $mounted |cut -d' ' -f 1)
> - path=$(echo $mounted |cut -d' ' -f 2)
> + if [ -n "$mounted" ]; then
> + device=$(echo $mounted |cut -d' ' -f 1)
> + path=$(echo $mounted |cut -d' ' -f 2)
> - tst_res TPASS "$device mounted at $path"
> -else
> - tst_res TFAIL "Device not mounted!"
> -fi
> + tst_res TPASS "$device mounted at $path"
> + else
> + tst_res TFAIL "Device not mounted!"
> + fi
> +}
> +
> +tst_test
More information about the ltp
mailing list