public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v7, 0/4] cgroup/cgroup_regression_test: Fix umount failure
Date: Tue, 24 Aug 2021 20:12:31 +0800	[thread overview]
Message-ID: <YSTiLyXItnm6UdyR@ubuntu02> (raw)

The test sequence
	mount -t cgroup -o <controllers> <path>
	mkdir <path>/<dir>
	rmdir <path>/<dir>
	umount <path>
	mount -t cgroup -o <controllers> <path>
would easily fail at the last mount with -EBUSY on certain platform.

Adding a little delay between "rmdir" and "umount" could fix the problem,
so use tst_umount API instead of umount in "rmdir, umount" sequence.

tst_umount API is ambiguous when checking for whether a device is mounted.
Modify it to check an actual mount point instead of device
and reject anything that does not start with '/' as an argument.

Changes since v1
- Use "tst_umount" instead of "sync" as suggested
- Make "tst_umount" work with argument that has terminating slash

Changes since v2
- Filter out the trailing slash instead of using mountpoint command

Changes since v3
- Filter out the trailing slash only in grep command
- Add comment in the test script

Changes since v4
- Remove unnecessary stderr redirection

Changes since v5
- Make tst_umount to only accept absolute mount point as an argument
- Modify tests that use tst_umount to pass mount point in instead of device

Changes since v6
- Use grep instead of "bashism [[]]" to determine if the argument starts with '/'
- Change the default TST_MNTPOINT to $PWD/mntpoint

Leo Yu-Chi Liang (4):
  lib: tst_umount: umount a mount point instead of a device
  doc: change the default behavior of tst_umount
  cgroup/cgroup_regression_test: Fix umount failure
  Make argument to tst_umount an absolute path

 doc/shell-test-api.txt                        |  8 ++++----
 .../cgroup/cgroup_regression_test.sh          | 10 +++++-----
 .../fs/quota_remount/quota_remount_test01.sh  |  2 +-
 .../integrity/ima/tests/evm_overlay.sh        |  2 +-
 .../tracing/dynamic_debug/dynamic_debug01.sh  |  2 +-
 testcases/lib/tst_test.sh                     | 20 +++++++++++--------
 6 files changed, 24 insertions(+), 20 deletions(-)

-- 
2.17.0

                 reply	other threads:[~2021-08-24 12:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YSTiLyXItnm6UdyR@ubuntu02 \
    --to=ycliang@andestech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox