public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2, 1/2] lib/tst_test.sh: Make tst_umount work with argument that
Date: Fri, 16 Jul 2021 10:12:32 +0200	[thread overview]
Message-ID: <YPE/cJ0551pTYlSZ@pevik> (raw)
In-Reply-To: <60F0DF88.9020603@fujitsu.com>

Hi all,

> Hi Leo
> > /proc/mounts shows the mount point without terminating slashes, e.g.
> > ~ $ cat /proc/mounts
> > xxx /root/cgroup cgroup rw,relatime,cpu 0 0

> > So current tst_umount would not work with argument that has terminating slash, e.g.
> > tst_umount cgroup/ would give "The device is not mounted".

> > Fix this by using mountpoint command instead of grepping /proc/mounts.

> > Signed-off-by: Leo Yu-Chi Liang<ycliang@andestech.com>
> > ---
> >   testcases/lib/tst_test.sh | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)

> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index c6aa2c487..7e77711f1 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -282,7 +282,7 @@ tst_umount()

> >   	[ -z "$device" ]&&  return

> > -	if ! grep -q "$device" /proc/mounts; then
> > +	if ! mountpoint -q "$device"; then
> Honestly speaking, I don't want to introduce mountpoint command.
> we can just filter the last "/" string for $device.
+1, please no any unnecessary dependency.

Kind regards,
Petr

> Best Regards
> Yang Xu

      parent reply	other threads:[~2021-07-16  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 14:24 [LTP] [PATCH v2, 1/2] lib/tst_test.sh: Make tst_umount work with argument that Leo Liang
2021-07-16  1:23 ` xuyang2018.jy
2021-07-16  6:43   ` Leo Liang
2021-07-16  8:12   ` 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=YPE/cJ0551pTYlSZ@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