All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Muckle <smuckle.linux@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent
Date: Tue, 24 Apr 2018 18:28:57 -0700	[thread overview]
Message-ID: <20180425012857.15100-1-smuckle.linux@gmail.com> (raw)

If the /proc/swaps file is absent the test should be skipped due
to incompatible configuration.

Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
---
 testcases/kernel/syscalls/swapon/swapon03.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index d3f73b044fe1..955ac247b6a2 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -328,6 +328,9 @@ static void setup(void)
 
 	tst_require_root();
 
+	if (access("/proc/swaps", F_OK))
+		tst_brkm(TCONF, NULL, "swap not supported by kernel");
+
 	tst_tmpdir();
 
 	switch ((fs_type = tst_fs_type(cleanup, "."))) {
-- 
2.16.1


             reply	other threads:[~2018-04-25  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25  1:28 Steve Muckle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-02-20 23:55 [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
2018-02-21  9:33 ` Richard Palethorpe
2018-02-13  5:27 Steve Muckle

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=20180425012857.15100-1-smuckle.linux@gmail.com \
    --to=smuckle.linux@gmail.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.