diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-05-27 17:24:10 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-05-28 22:30:07 +0300 |
commit | cf794355456b82927cecfd183e49b47be6568385 (patch) | |
tree | bed84804dd181bb00e04f0aa3ecd3a51118090b7 /source4 | |
parent | 2053403045cb8786abe778279a68b431b9c5977c (diff) | |
download | samba-cf794355456b82927cecfd183e49b47be6568385.tar.gz samba-cf794355456b82927cecfd183e49b47be6568385.tar.bz2 samba-cf794355456b82927cecfd183e49b47be6568385.zip |
s4/test: refactor NET-USERINFO test to be more 'torture' friendly
Test may be further refactored to be converted as a test case
(what it is actually)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/libnet/userinfo.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c index d28534f53e..d6ea609a43 100644 --- a/source4/torture/libnet/userinfo.c +++ b/source4/torture/libnet/userinfo.c @@ -48,10 +48,7 @@ static bool test_userinfo(struct torture_context *tctx, torture_comment(tctx, "Testing sync libnet_rpc_userinfo (SID argument)\n"); status = libnet_rpc_userinfo(p, mem_ctx, &user); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return false; - } + torture_assert_ntstatus_ok(tctx, status, "Calling sync libnet_rpc_userinfo() failed"); ZERO_STRUCT(user); @@ -62,10 +59,7 @@ static bool test_userinfo(struct torture_context *tctx, torture_comment(tctx, "Testing sync libnet_rpc_userinfo (username argument)\n"); status = libnet_rpc_userinfo(p, mem_ctx, &user); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return false; - } + torture_assert_ntstatus_ok(tctx, status, "Calling sync libnet_rpc_userinfo failed"); return true; } @@ -92,16 +86,10 @@ static bool test_userinfo_async(struct torture_context *tctx, torture_comment(tctx, "Testing async libnet_rpc_userinfo (SID argument)\n"); c = libnet_rpc_userinfo_send(p, &user, msg_handler); - if (!c) { - torture_comment(tctx, "Failed to call sync libnet_rpc_userinfo_send\n"); - return false; - } + torture_assert(tctx, c != NULL, "Failed to call async libnet_rpc_userinfo_send"); status = libnet_rpc_userinfo_recv(c, mem_ctx, &user); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "Calling async libnet_rpc_userinfo failed - %s\n", nt_errstr(status)); - return false; - } + torture_assert_ntstatus_ok(tctx, status, "Calling async libnet_rpc_userinfo_recv failed"); ZERO_STRUCT(user); @@ -113,16 +101,10 @@ static bool test_userinfo_async(struct torture_context *tctx, torture_comment(tctx, "Testing async libnet_rpc_userinfo (username argument)\n"); c = libnet_rpc_userinfo_send(p, &user, msg_handler); - if (!c) { - torture_comment(tctx, "Failed to call sync libnet_rpc_userinfo_send\n"); - return false; - } + torture_assert(tctx, c != NULL, "Failed to call async libnet_rpc_userinfo_send"); status = libnet_rpc_userinfo_recv(c, mem_ctx, &user); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "Calling async libnet_rpc_userinfo failed - %s\n", nt_errstr(status)); - return false; - } + torture_assert_ntstatus_ok(tctx, status, "Calling async libnet_rpc_userinfo_recv failed"); return true; } |