public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_fd_exhaustion.c: Expect ENFILE when fds run out
Date: Mon,  8 Apr 2019 15:52:00 -0700	[thread overview]
Message-ID: <20190408225200.33606-2-antonio.argenziano@intel.com> (raw)
In-Reply-To: <20190408225200.33606-1-antonio.argenziano@intel.com>

Change the test to expect gem_create to return ENFILE when we run out of
fds.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 tests/i915/gem_fd_exhaustion.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/i915/gem_fd_exhaustion.c b/tests/i915/gem_fd_exhaustion.c
index 23602b98..83d0e926 100644
--- a/tests/i915/gem_fd_exhaustion.c
+++ b/tests/i915/gem_fd_exhaustion.c
@@ -48,15 +48,16 @@ igt_simple_main
 			int leak = open("/dev/null", O_RDONLY);
 			uint32_t handle;
 
-			if (__gem_create(fd, 4096, &handle) == 0)
-				gem_close(fd, handle);
-
 			if (leak < 0) {
 				igt_info("fd exhaustion after %i rounds.\n", i);
-				igt_assert(__gem_create(fd, 4096,
-							&handle) < 0);
+				igt_assert_eq(__gem_create(fd, 4096,
+							&handle), -ENFILE);
 				break;
 			}
+
+			if (__gem_create(fd, 4096, &handle) == 0)
+				gem_close(fd, handle);
+
 		}
 
 		/* The child will free all the fds when exiting, so no need to
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-04-08 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 22:51 [igt-dev] [PATCH i-g-t 1/2] tests/i915/gem_fd_exhaustion.c: Remove unused sysfs functions Antonio Argenziano
2019-04-08 22:52 ` Antonio Argenziano [this message]
2019-04-08 23:00   ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_fd_exhaustion.c: Expect ENFILE when fds run out Chris Wilson
2019-04-08 23:06     ` Antonio Argenziano
2019-04-08 23:42       ` Chris Wilson
2019-04-08 23:53 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/i915/gem_fd_exhaustion.c: Remove unused sysfs functions Patchwork
2019-04-09  6:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20190408225200.33606-2-antonio.argenziano@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /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