public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 0/2] libltp: add support for .needs_rofs for EROFS check
Date: Mon, 18 Sep 2017 09:56:28 -0700	[thread overview]
Message-ID: <20170918165630.134076-1-sspatil@google.com> (raw)


Some tests go through losetup, create, format and mount
filesystems only to run tests for 'EROFS' return value from
system calls. The tests end up being flaky depending on the tools
available on the platform. e.g. mkfs.<filesystem> tool is required for 
mounting a device with filesystem.

If the test is only to check for EROFS, this can be achieved by simply doing a
'tmpfs' read-only mount in $tmpdir. So, this series adds a ".needs_rofs" flag
to 'struct tst_test' that can be used to indicate that the test only needs a
read-only filesystem mount ot test for 'EROFS' return value. If the flag is
set, the library will first attempt to mount 'tmpfs' filesystem at
tst_test->mntpoint and fallback to the original create, format and mount a
loopback device if that fails.

Example of tests that can benefit from this are:
  access04, mkdirat02, mknodat02, acct01, fchown04, mknod07 etc.

This also allows for these tests to successfully run on Android.

Sandeep Patil (2):
  libltp: add support to mount tmpfs for EROFS testing
  syscalls/access04: use .needs_rofs flag for EROFS testing

 include/tst_test.h                          |  1 +
 lib/tst_test.c                              | 36 ++++++++++++++++++++++++-----
 testcases/kernel/syscalls/access/access04.c |  3 +--
 3 files changed, 32 insertions(+), 8 deletions(-)

-- 
2.14.1.690.gbb1197296e-goog


             reply	other threads:[~2017-09-18 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 16:56 Sandeep Patil [this message]
2017-09-18 16:56 ` [LTP] [RESEND][PATCH v3 1/2] libltp: add support to mount tmpfs for EROFS testing Sandeep Patil
2017-09-19  8:43   ` Cyril Hrubis
2017-09-19 18:30     ` Sandeep Patil
2017-09-18 16:56 ` [LTP] [RESEND][PATCH v3 2/2] syscalls/access04: use .needs_rofs flag " Sandeep Patil
2017-09-19  8:47   ` Cyril Hrubis
2017-09-19 18:28     ` Sandeep Patil

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=20170918165630.134076-1-sspatil@google.com \
    --to=sspatil@google.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