return true;
}
+static bool test_bytepipeout(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ struct dcerpc_binding_handle *b = p->binding_handle;
+ struct echo_TestBytePipeOut r;
+ struct echo_BytePipe_chunk *chunk;
+ struct echo_BytePipe *out_pipe;
+ struct tevent_req *subreq1;
+ struct tevent_req *subreq2;
+ size_t i;
+ uint8_t bytes[0x8];
+ NTSTATUS status;
+
+ out_pipe = dcerpc_echo_BytePipe_create(tctx);
+
+ ZERO_STRUCT(r);
+ r.in.num_chunks = 1;
+ r.in.chunk_size = sizeof(bytes);
+ r.out.out_pipe = out_pipe;
+
+ ZERO_STRUCT(chunk);
+
+ subreq1 = dcerpc_echo_TestBytePipeOut_r_send(tctx, tctx->ev, b, &r);
+ for (i=0; ; i++) {
+ struct timeval tv = timeval_current_ofs(0, 100);
+
+ //subreq2 = tevent_wakeup_send(tctx, tctx->ev, tv);
+ //tevent_req_poll(subreq2, tctx->ev);
+ //tevent_wakeup_recv(subreq2);
+ //TALLOC_FREE(subreq2);
+
+ subreq2 = dcerpc_echo_BytePipe_chunk_pull_send(tctx, tctx->ev, out_pipe);
+ tevent_req_poll(subreq2, tctx->ev);
+ status = dcerpc_echo_BytePipe_chunk_pull_recv(subreq2, tctx, &chunk);
+ TALLOC_FREE(subreq2);
+ torture_assert_ntstatus_ok(tctx, status, __location__);
+ torture_comment(tctx, "chunk[%u] count[%u]\n", (unsigned)i, (unsigned)chunk->count);
+ if (chunk->count == 0) {
+ TALLOC_FREE(chunk);
+ break;
+ }
+ TALLOC_FREE(chunk);
+ }
+
+ tevent_req_poll(subreq1, tctx->ev);
+ status = dcerpc_echo_TestBytePipeOut_r_recv(subreq1, tctx);
+ TALLOC_FREE(subreq1);
+ torture_assert_ntstatus_ok(tctx, status, __location__);
+
+ return true;
+}
/*
test request timeouts
*/
//torture_rpc_tcase_add_test(tcase, "doublepointer", test_doublepointer);
//torture_rpc_tcase_add_test(tcase, "sleep", test_sleep);
torture_rpc_tcase_add_test(tcase, "bytepipein", test_bytepipein);
+ torture_rpc_tcase_add_test(tcase, "bytepipeout", test_bytepipeout);
#if 0 /* this test needs fixing to work over ncacn_np */
torture_rpc_tcase_add_test(tcase, "timeout", test_timeout);
#endif