summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-05 13:41:51 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-05 13:41:51 +0100
commit33ef5284903d2b64c4744c208d9eccc54cba65a3 (patch)
tree97524e00c3cd6c96fb42db16f302882512e35c4c
parent365f4812b12323336e5b54befdbb2628b78713f0 (diff)
tests/core_get_client_auth: new subtests for always authenticated
This exercise the bug fixed in commit 1020dc6990168a5081ffad620c440e220f05b460 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Oct 29 08:55:57 2013 +0000 drm: Do not drop root privileges for a fancier younger process Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/Makefile.sources2
-rw-r--r--tests/core_get_client_auth.c28
2 files changed, 21 insertions, 9 deletions
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 0fa7afcd..9e0aefe5 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -14,6 +14,7 @@ NOUVEAU_TESTS_M = \
$(NULL)
TESTS_progs_M = \
+ core_get_client_auth \
drv_suspend \
gem_basic \
gem_caching \
@@ -63,7 +64,6 @@ TESTS_progs = \
core_getclient \
core_getstats \
core_getversion \
- core_get_client_auth \
drm_vma_limiter \
drm_vma_limiter_cached \
drm_vma_limiter_cpu \
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index 2f493f94..566a6580 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -73,16 +73,28 @@ static bool check_auth(int fd)
return is_authenticated;
}
-int main(int argc, char **argv)
+
+igt_main
{
- int fd;
- bool auth;
+ /* root (which we run igt as) should always be authenticated */
+ igt_subtest("simple") {
+ int fd = drm_open_any();
- fd = drm_open_any();
+ igt_assert(check_auth(fd) == true);
- /* root (which we run igt as) should always be authenticated */
- auth = check_auth(fd);
- igt_assert(auth);
+ close(fd);
+ }
+
+ igt_subtest("master-drop") {
+ int fd = drm_open_any();
+ int fd2 = drm_open_any();
- return 0;
+ igt_assert(check_auth(fd2) == true);
+
+ close(fd);
+
+ igt_assert(check_auth(fd2) == true);
+
+ close(fd2);
+ }
}