[LTP] [RFC PATCH 2/2] testcaes/lib: Add shell loader
Petr Vorel
pvorel@suse.cz
Thu Jul 25 13:02:06 CEST 2024
Hi Martin, Cyril,
> Hi,
> one note below.
...
> > --- /dev/null
> > +++ b/testcases/lib/tests/shell_loader_all_filesystems.sh
> > @@ -0,0 +1,22 @@
> > +#!/bin/sh
> > +#
> > +# needs_root=1
> > +# mount_device=1
> > +# all_filesystems=1
> > +
> > +TST_MNTPOINT=ltp_mntpoint
> > +
> > +. tst_env.sh
> > +
> > +tst_res TINFO "IN shell"
> > +
> > +mounted=$(grep $TST_MNTPOINT /proc/mounts)
> This check might produce false positive for example when another LTP shell
> script runs in parallel in another temp directory. I'd recommend using
> $(realpath ...) to disambiguate the mountpoints.
FYI this is just a test, not a library script.
Also maybe just prepend it with $PWD/ would be enough:
mounted=$(grep $PWD/$TST_MNTPOINT /proc/mounts)
(Not to require yet another binary. It's ok to have it here, because developers
have coreutils, but in case it's in the tst_test.sh or its dependencies some
minimal systems might have problem - busybox based embedded systems realpath is
configurable via CONFIG_REALPATH=y. It would help if we specify shell library
dependencies).
Kind regards,
Petr
More information about the ltp
mailing list