diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-01-19 22:06:48 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-01-19 22:06:48 +0100 |
commit | 862de5636f545a071f29f60ae0a4ab1370f5cf8b (patch) | |
tree | 1111e1f1023d25da539cc904b17b6e1797c45958 /tests/gem_reset_stats.c | |
parent | 70082e3677711bc01330ba3483fbdce5779f915d (diff) |
lib: extract igt_drop_root
Useful in other tests.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_reset_stats.c')
-rw-r--r-- | tests/gem_reset_stats.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index a98e2ade..034a2987 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -874,17 +874,6 @@ static void test_close_pending_fork(const bool reverse) close(fd); } -static void drop_root(void) -{ - igt_assert(getuid() == 0); - - igt_assert(setgid(2) == 0); - igt_assert(setuid(2) == 0); - - igt_assert(getgid() == 2); - igt_assert(getuid() == 2); -} - static void test_reset_count(const bool create_ctx) { int fd, h, ctx; @@ -912,7 +901,7 @@ static void test_reset_count(const bool create_ctx) igt_assert(c2 == (c1 + 1)); igt_fork(child, 1) { - drop_root(); + igt_drop_root(); c2 = get_reset_count(fd, ctx); @@ -988,7 +977,7 @@ static void _test_param(const int fd, const int ctx) igt_fork(child, 1) { check_params(fd, ctx, root); - drop_root(); + igt_drop_root(); check_params(fd, ctx, user); } |