Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 3/5] shell: Move shell code into functions
Date: Fri, 28 Feb 2025 18:45:54 +0100	[thread overview]
Message-ID: <20250228174554.GB3278043@pevik> (raw)
In-Reply-To: <20250228172439.3276777-4-pvorel@suse.cz>

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-02-28 17:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 17:24 [LTP] [RFC PATCH 0/5] shell loader rewrite to support TST_SETUP Petr Vorel
2025-02-28 17:24 ` [LTP] [RFC PATCH 1/5] shell lib: Add support for test cleanup Petr Vorel
2025-03-04 12:57   ` Li Wang
2025-03-04 13:08     ` Petr Vorel
2025-03-04 13:15       ` Li Wang
2025-02-28 17:24 ` [LTP] [RFC PATCH 2/5] lib: Allow test to have positional args Petr Vorel
2025-02-28 17:43   ` Petr Vorel
2025-03-07 16:17   ` Cyril Hrubis
2025-03-10 10:23     ` Petr Vorel
2025-03-07 16:27   ` Cyril Hrubis
2025-03-10 10:16     ` Petr Vorel
2025-02-28 17:24 ` [LTP] [RFC PATCH 3/5] shell: Move shell code into functions Petr Vorel
2025-02-28 17:45   ` Petr Vorel [this message]
2025-02-28 17:24 ` [LTP] [RFC PATCH 4/5] shell lib: Add basic support for test cleanup Petr Vorel
2025-03-07 16:40   ` Cyril Hrubis
2025-03-10 10:27     ` Petr Vorel
2025-04-25 18:33     ` Petr Vorel
2025-04-30  8:52       ` Cyril Hrubis
2025-04-30  8:57         ` Cyril Hrubis
2025-04-30 11:47           ` Petr Vorel
2025-04-30 13:39             ` Cyril Hrubis
2025-02-28 17:24 ` [LTP] [RFC PATCH 5/5] shell: Add shell_loader_setup_cleanup.sh test Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250228174554.GB3278043@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox