[PATCH 3/4] torture: add FSRVP message sequence timeout test
Michael Adam
obnox at samba.org
Wed Jun 18 06:00:35 MDT 2014
Hi David
On 2014-06-17 at 18:51 +0200, David Disseldorp wrote:
> Sleep at various points in the FSRVP snapshot creation state machine,
> and confirm that the state timeout is reflected in subsequent server
> responses.
>
> Signed-off-by: David Disseldorp <ddiss at samba.org>
> ---
> source4/torture/rpc/fsrvp.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/source4/torture/rpc/fsrvp.c b/source4/torture/rpc/fsrvp.c
> index 42247fd..0131d30 100644
> --- a/source4/torture/rpc/fsrvp.c
> +++ b/source4/torture/rpc/fsrvp.c
> @@ -723,6 +723,29 @@ static bool test_fsrvp_enum_created(struct torture_context *tctx,
> return true;
> }
>
> +static bool test_fsrvp_seq_timeout(struct torture_context *tctx,
> + struct dcerpc_pipe *p)
> +{
> + int i;
> + struct fssagent_share_mapping_1 *sc_map;
> + char *share_unc = talloc_asprintf(tctx, "\\\\%s\\%s",
> + dcerpc_server_name(p), FSHARE);
> +
> + for (i = TEST_FSRVP_TOUT_NONE; i <= TEST_FSRVP_TOUT_COMMIT; i++) {
> + torture_assert(tctx, test_fsrvp_sc_create(tctx, p, share_unc,
> + i, &sc_map),
> + "sc create");
> +
> + /* only need to delete if create process didn't timeout */
> + if (TEST_FSRVP_TOUT_NONE) {
This looks strange.
Shouldn't it read "if (i == TEST_FSRVP_TOUT_NONE)" or similar?
Cheers - Michael
> + torture_assert(tctx, test_fsrvp_sc_delete(tctx, p, sc_map),
> + "sc del");
> + }
> + }
> +
> + return true;
> +}
> +
> static bool fsrvp_rpc_setup(struct torture_context *tctx, void **data)
> {
> NTSTATUS status;
> @@ -759,6 +782,8 @@ struct torture_suite *torture_rpc_fsrvp(TALLOC_CTX *mem_ctx)
> /* override torture_rpc_setup() to set DCERPC_NDR_REF_ALLOC */
> tcase->tcase.setup = fsrvp_rpc_setup;
>
> + torture_rpc_tcase_add_test(tcase, "seq_timeout",
> + test_fsrvp_seq_timeout);
> torture_rpc_tcase_add_test(tcase, "enum_created",
> test_fsrvp_enum_created);
> torture_rpc_tcase_add_test(tcase, "sc_share_io",
> --
> 1.8.4.5
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140618/4397a574/attachment.pgp>
More information about the samba-technical
mailing list