[igt-dev] [PATCH i-g-t 2/2] tests/xe_vm.c: Add Negative test to VM error capture

Dandamudi, Priyanka priyanka.dandamudi at intel.com
Fri Jun 9 05:44:22 UTC 2023



> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of
> janga.rahul.kumar at intel.com
> Sent: 07 June 2023 01:34 PM
> To: igt-dev at lists.freedesktop.org; Gandi, Ramadevi
> <ramadevi.gandi at intel.com>; Kumar, Janga Rahul
> <janga.rahul.kumar at intel.com>
> Subject: [igt-dev] [PATCH i-g-t 2/2] tests/xe_vm.c: Add Negative test to VM
> error capture
> 
> From: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> 
> Add negative test to check invalid arguments.
> 
> Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> ---
>  tests/xe/xe_vm.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/tests/xe/xe_vm.c b/tests/xe/xe_vm.c index 0da6c847..7f369fc4
> 100644
> --- a/tests/xe/xe_vm.c
> +++ b/tests/xe/xe_vm.c
> @@ -1638,6 +1638,31 @@ vm_error_capture_address(int fd)
>  	xe_vm_destroy(fd, vm);
>  }
> 
> +/**
> + * SUBTEST: vm-error-capture-address-invalid-val
> + * Description: Negative test to check vm error capture
> + * Functionality: error capture
> + * Run type: FULL
> + * TODO: change ``'Run type' == FULL`` to a better category
> + *
> + */
> +static void
> +vm_error_capture_address_invalid_val(int fd) {
> +	struct drm_xe_ext_vm_set_property ext = {
> +		.base.next_extension = 0,
> +		.base.name = XE_VM_EXTENSION_SET_PROPERTY,
> +		.property =
> XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS,
> +		.value = 0,
> +	};
> +
> +	struct drm_xe_vm_create create = {
> +		.extensions = to_user_pointer(&ext),
> +		.flags = DRM_XE_VM_CREATE_ASYNC_BIND_OPS,
> +	};
> +
> +	do_ioctl_err(fd, DRM_IOCTL_XE_VM_CREATE, &create, EINVAL); }
> 
>  igt_main
>  {
> @@ -1924,6 +1949,9 @@ igt_main
>  	igt_subtest("vm-error-capture-address")
>  		vm_error_capture_address(fd);
> 
> +	igt_subtest("vm-error-capture-address-invalid-val")
> +		vm_error_capture_address_invalid_val(fd);
> +
>  	igt_fixture {
>  		xe_device_put(fd);
>  		close(fd);
LGTM,
Reviewed-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> --
> 2.25.1



More information about the igt-dev mailing list