summaryrefslogtreecommitdiff
path: root/tests/vgem_basic.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-08-25 19:26:39 +0100
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-08-30 12:53:47 +0300
commit1b6585eeb22a2787fa52b2a192d4e9539acbd9c6 (patch)
treec380cd5ff5019f5ab8f2ff03c23bef3c31015fab /tests/vgem_basic.c
parent1f0f2aa0143e54a8db2dad088c03a99e78674f97 (diff)
igt/vgem_basic: Load and unload the module first
To ensure the module exists, first load it. Then when we try to unload the module (to check that our modprobe interface works), we will not get spurious failures due to -ENOENT (in this case meaning the module did not exist): (vgem_basic:18361) igt-core-DEBUG: Starting subtest: unload (vgem_basic:18361) igt-kmod-DEBUG: Could not remove module vgem (No such file or directory) Test requirement not met in function test_unload, file vgem_basic.c:331: Test requirement: module_unload() == 0 Last errno: 2, No such file or directory Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/vgem_basic.c')
-rw-r--r--tests/vgem_basic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c
index 982da73a..1a952c54 100644
--- a/tests/vgem_basic.c
+++ b/tests/vgem_basic.c
@@ -328,6 +328,10 @@ static void test_unload(void)
int vgem, dmabuf;
uint32_t *ptr;
+ /* Load and unload vgem just to make sure it exists */
+ vgem = __drm_open_driver(DRIVER_VGEM);
+ igt_require(vgem != -1);
+ close(vgem);
igt_require(module_unload() == 0);
vgem = __drm_open_driver(DRIVER_VGEM);