[PATCH 08/12] torture: skip FSCTL_SRV_ENUM_SNAPS test when not supported

Jelmer Vernooij jelmer at samba.org
Wed Nov 7 17:39:01 MST 2012


On Thu, 2012-11-08 at 01:19 +0100, David Disseldorp wrote:
> From: David Disseldorp <ddiss at suse.de>
> 
> If FSCTL_SRV_ENUM_SNAPS fails with NT_STATUS_NOT_SUPPORTED then skip the
> test, this means we can run the full ioctl test suite as part of
> autobuild.

> diff --git a/source4/torture/smb2/ioctl.c b/source4/torture/smb2/ioctl.c
> index c170cb8..ae727f0 100644
> --- a/source4/torture/smb2/ioctl.c
> +++ b/source4/torture/smb2/ioctl.c
> @@ -59,6 +59,12 @@ static bool test_ioctl_get_shadow_copy(struct torture_context *torture,
>  	ioctl.smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL;
>  
>  	status = smb2_ioctl(tree, tmp_ctx, &ioctl.smb2);
> +	if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)
> +	 || NT_STATUS_EQUAL(status, NT_STATUS_INVALID_DEVICE_REQUEST)) {
> +		torture_comment(torture,
> +			"FSCTL_SRV_ENUM_SNAPS not supported, skipping\n");
> +		return true;
> +	}
>  	torture_assert_ntstatus_ok(torture, status, "FSCTL_SRV_ENUM_SNAPS");
>  
>  	return true;
Rather than torture_comment() and 'return true', it's better to use
torture_skip() here. That will properly mark the test as skipped in the
test output.

Cheers,

Jelmer





More information about the samba-technical mailing list