From: Joerg Vehlow <lkml@jv-coder.de>
To: Cristian Marussi <cristian.marussi@arm.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] Fix mountns01/02/03/04 final umounts using more peculiar dir names
Date: Tue, 21 Jun 2022 08:51:45 +0200 [thread overview]
Message-ID: <762be123-13ad-1fcf-e4f3-846c7e1b236a@jv-coder.de> (raw)
In-Reply-To: <20220620133746.99167-1-cristian.marussi@arm.com>
Hi,
Am 6/20/2022 um 3:37 PM schrieb Cristian Marussi:
> Running LTP20220527 release it appears that the recently re-written tests
> mountns02/03/04 can now throw a warning on their final umount attempt in
> some setup:
>
> <<<test_output>>>
> tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> mountns04.c:38: TPASS: unbindable mount passed
> tst_device.c:395: TWARN: umount('A') failed with EINVAL
> mountns.h:36: TWARN: umount(A) failed: EINVAL (22)
> tst_device.c:434: TINFO: No device is mounted at B
>
> Moreover, the underlying safe_umount() then upgrades the TWARN emitted
> from tst_umount to a TBROK, so causing the test to completely fail:
>
> Summary:
> passed 1
> failed 0
> broken 0
> skipped 0
> warnings 2
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=exited termination_id=4 corefile=no
>
> Even though the final SAFE_UMOUNTs in the test body properly unmount the
> test created mountpoints, the final cleanup functions, that finally check
> to see if those mountpoints are still mounted, can be fooled into falsely
> thinking that test-chosen mountpoints "A" or "B" are still there: this is
> due to the fact that the internal helper tst_is_mounted() uses a simple
> strstr() on /proc/mounts to check if a directory is still mounted and
> clearly the currently test-chosen names are far too much simple, being
> one-letter, and they can be easily matched by other unrelated mountpoints
> that happen to exist on a specific setup.
>
> Use a more peculiar naming for the test chosen mountpoints and generalize
> accordingly all the comments.
>
> Cc: Andrea Cervesato <andrea.cervesato@suse.de>
> Cc: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> ---
> v1 --> v2
> - using more peculiar naming for mountpoints
> - fix comments
> - dropped previous SAFE_UMONUT removal
>
> A better, more long term fix should be to fix/harden tst_is_mounted logic,
> but looking at mountpoint(1) implementation this is far from trivial to
> be done (especially for bind mounts) and it would require a bit of
> 're-inventing the wheel' to bring all the mountpoint/libmount helpers and
> logic inside LTP; on the other side a dirty and ugly solution based on
> something like tst_system("mountpoint -q <dir>") would be less portable
> since would add the new mountpoint application as an LTP pre-requisite.
> (and so just breaking a few CI probably without having a 'mountpoint-less'
> failover mechanism)...so I just generalized the chosen names for now...
> ---
> testcases/kernel/containers/mountns/mountns.h | 4 ++--
> .../kernel/containers/mountns/mountns01.c | 18 +++++++++---------
> .../kernel/containers/mountns/mountns02.c | 18 +++++++++---------
> .../kernel/containers/mountns/mountns03.c | 18 +++++++++---------
> .../kernel/containers/mountns/mountns04.c | 8 ++++----
> 5 files changed, 33 insertions(+), 33 deletions(-)
>
> diff --git a/testcases/kernel/containers/mountns/mountns.h b/testcases/kernel/containers/mountns/mountns.h
> index ad8befa71..347f0783a 100644
> --- a/testcases/kernel/containers/mountns/mountns.h
> +++ b/testcases/kernel/containers/mountns/mountns.h
> @@ -10,8 +10,8 @@
> #include "tst_test.h"
> #include "lapi/namespaces_constants.h"
>
> -#define DIRA "A"
> -#define DIRB "B"
> +#define DIRA "__DIR_A"
> +#define DIRB "__DIR_B"
This is the only non-comment change. How does renaming the directories
change anything? Am I missing something?
Joerg
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-06-21 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 13:37 [LTP] [PATCH v2] Fix mountns01/02/03/04 final umounts using more peculiar dir names Cristian Marussi
2022-06-21 1:43 ` xuyang2018.jy
2022-06-21 6:51 ` Joerg Vehlow [this message]
2022-06-21 6:55 ` Joerg Vehlow
2022-06-22 8:35 ` Cyril Hrubis
2022-06-22 8:49 ` Cristian Marussi
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=762be123-13ad-1fcf-e4f3-846c7e1b236a@jv-coder.de \
--to=lkml@jv-coder.de \
--cc=cristian.marussi@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.