From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 2/2] testcaes/lib: Add shell loader
Date: Thu, 25 Jul 2024 23:44:19 +0200 [thread overview]
Message-ID: <20240725214419.GA1002956@pevik> (raw)
In-Reply-To: <9066c23e-444e-4975-a3c8-505fbd4b6042@suse.cz>
> On 25. 07. 24 13:02, Petr Vorel wrote:
> > Hi Martin, Cyril,
> > > > +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).
> The test could still get confused by leftover mounts from other tests or
> failed runs of itself. That'll be annoying to deal with when you try to
> modify something in the shell loader.
Fair point.
> I've checked what happens if you mount a filesystem on a mountpoint path
> that contains symlinks and in that case, /proc/mounts will report the real
> path. So $(realpath $TST_MNTPOINT) is what you need to search for. Grep
> might get confused by special characters in the path, though. Another
> problem is that /proc/mounts converts spaces to octal codes to prevent
> column parsing issues.
OK, I would hope users would not use symlinks, but OTOH I'm ok with using
realpath for tests, thus no reason to block using symlinks (which we would do
with my suggestion to use $PWD instead of realpath).
But I would not waste our time with effort to fix special characters:
1) Build system does not work with some of them anyway (Cyril reported at least
" due out-of-tree complexity of our build system).
2) Old doc somewhere warned that project would ignore broken compilation due
special characters.
3) I don't expect many people will be forced to have LTP on directory with
strange characters.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2024-07-25 21:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 15:36 [LTP] [RFC PATCH 0/2] Shell test library v3 Cyril Hrubis
2024-07-16 15:36 ` [LTP] [RFC PATCH 1/2] Add support for mixing C and shell code Cyril Hrubis
2024-07-17 8:33 ` Li Wang
2024-07-17 8:41 ` Cyril Hrubis
2024-07-17 10:07 ` Li Wang
2024-07-17 8:52 ` Cyril Hrubis
2024-07-17 10:21 ` Li Wang
2024-07-17 17:51 ` Petr Vorel
2024-07-17 17:55 ` Petr Vorel
2024-07-17 18:13 ` Cyril Hrubis
2024-07-18 12:43 ` Petr Vorel
2024-07-18 13:03 ` Cyril Hrubis
2024-07-18 12:57 ` Petr Vorel
2024-07-18 13:07 ` Cyril Hrubis
2024-07-18 13:15 ` Petr Vorel
2024-07-24 9:37 ` Martin Doucha
2024-07-24 9:47 ` Cyril Hrubis
2024-07-24 9:53 ` Martin Doucha
2024-07-24 10:05 ` Cyril Hrubis
2024-07-30 9:49 ` Cyril Hrubis
2024-07-16 15:36 ` [LTP] [RFC PATCH 2/2] testcaes/lib: Add shell loader Cyril Hrubis
2024-07-24 12:54 ` Martin Doucha
2024-07-25 11:02 ` Petr Vorel
2024-07-25 16:01 ` Martin Doucha
2024-07-25 21:44 ` Petr Vorel [this message]
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=20240725214419.GA1002956@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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