Commit c5f72256 authored by Daniel Vetter's avatar Daniel Vetter

tests/kms_release: invalid checks for revoke-lease ioctl

Found a few corner cases to validate. Put them into the existing

Cc: Keith Packard <>
Reviewed-by: Lyude Paul's avatarLyude Paul <>
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <>
parent 9f0e3a5d
......@@ -511,6 +511,14 @@ static void lease_revoke(data_t *data)
igt_display_require(&lease.display, lease.fd);
/* try to revoke an invalid lease */
mrl.lessee_id = 0;
igt_assert_eq(revoke_lease(data->master.fd, &mrl), -ENOENT);
/* try to revoke with the wrong fd */
mrl.lessee_id = lease.lessee_id;
igt_assert_eq(revoke_lease(lease.fd, &mrl), -EACCES);
/* Revoke the lease using the master fd */
mrl.lessee_id = lease.lessee_id;
igt_assert_eq(revoke_lease(data->master.fd, &mrl), 0);
......@@ -522,6 +530,10 @@ static void lease_revoke(data_t *data)
igt_assert_eq(ret, -ENOENT);
/* make sure the lease is gone */
mrl.lessee_id = lease.lessee_id;
igt_assert_eq(revoke_lease(data->master.fd, &mrl), -ENOENT);
/* Test leasing objects more than once */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment