From ebe0aa0e9cf8440c85c168e6ce7e8bc755d458a4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 15 Mar 2011 16:35:58 +0100 Subject: s4-smbtorture: check for username and computername presence in rap_netsessionenum test. Guenther --- source4/torture/rap/rap.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source4/torture/rap') diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c index 923a95de78..7622bddd5a 100644 --- a/source4/torture/rap/rap.c +++ b/source4/torture/rap/rap.c @@ -1612,7 +1612,7 @@ static bool test_netsessionenum(struct torture_context *tctx, struct smbcli_state *cli) { struct rap_NetSessionEnum r; - int i; + int i,n; uint16_t levels[] = { 2 }; for (i=0; i < ARRAY_SIZE(levels); i++) { @@ -1626,6 +1626,25 @@ static bool test_netsessionenum(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, smbcli_rap_netsessionenum(cli->tree, tctx, &r), "smbcli_rap_netsessionenum failed"); + + for (n=0; n < r.out.count; n++) { + switch (r.in.level) { + case 2: + torture_comment(tctx, "ComputerName: %s\n", + r.out.info[n].info2.ComputerName); + + torture_comment(tctx, "UserName: %s\n", + r.out.info[n].info2.UserName); + + torture_assert(tctx, r.out.info[n].info2.ComputerName, + "ComputerName empty"); + torture_assert(tctx, r.out.info[n].info2.UserName, + "UserName empty"); + break; + default: + break; + } + } } return true; -- cgit