public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 0/2] libltp: add support for .needs_rofs for EROFS check
@ 2017-09-18 16:56 Sandeep Patil
  2017-09-18 16:56 ` [LTP] [RESEND][PATCH v3 1/2] libltp: add support to mount tmpfs for EROFS testing Sandeep Patil
  2017-09-18 16:56 ` [LTP] [RESEND][PATCH v3 2/2] syscalls/access04: use .needs_rofs flag " Sandeep Patil
  0 siblings, 2 replies; 7+ messages in thread
From: Sandeep Patil @ 2017-09-18 16:56 UTC (permalink / raw)
  To: ltp


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-19 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18 16:56 [LTP] [PATCH v3 0/2] libltp: add support for .needs_rofs for EROFS check Sandeep Patil
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox