diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2021-05-27 16:07:32 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2021-08-12 21:39:29 +0200 |
commit | c91f99c74b966f635d7e2eb898bf0f78383d281b (patch) | |
tree | f4d0ff87854c65ece90612169e3c35b56b5963c3 /tests/vgem_basic.c | |
parent | 0de07aea208ea848066f4f6af04c13e25d23d9a7 (diff) |
tests/vgem_basic: Fix unload testcase
An mmap _should_ keep the module alive.
This reverts
commit 8abe91985b30f8a26cdcb6816d2393956f171ea5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Oct 5 14:40:16 2016 +0100
igt/vgem_basic: Allow mmap() to persist without the vgem module loaded
With real drivers there is usually more than just shmem around, so
encoding this as some kind of expectation just doesn't make sense at
all.
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'tests/vgem_basic.c')
-rw-r--r-- | tests/vgem_basic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c index 526636dd..57c575e2 100644 --- a/tests/vgem_basic.c +++ b/tests/vgem_basic.c @@ -382,14 +382,18 @@ static void test_unload(void) close(dmabuf); /* Although closed, the mmap should keep the dmabuf/module alive */ - igt_assert_f(module_unload() == 0, - "A mmap should not keep the module alive\n"); + igt_assert_f(module_unload() != 0, + "A mmap should keep the module alive\n"); for (int page = 0; page < bo.size >> 12; page++) ptr[1024*page + page%1024] = page; /* And finally we should have no more uses on the module. */ munmap(ptr, bo.size); + + igt_assert_f(module_unload() == 0, + "No mmap anymore, should be able to unload\n"); + } static bool has_prime_export(int fd) |