summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-03-02 10:57:26 +0100
committerGünther Deschner <gd@samba.org>2011-03-02 12:12:32 +0100
commitbd675e0b1502564b16a23d544f23762990849f5f (patch)
tree0367824228c8a4639b1b89d8d4201b888b7f6351
parentc884e622fae971a0ea35a1d59e4d5a14bcdf9dd3 (diff)
downloadsamba-bd675e0b1502564b16a23d544f23762990849f5f.tar.gz
samba-bd675e0b1502564b16a23d544f23762990849f5f.tar.bz2
samba-bd675e0b1502564b16a23d544f23762990849f5f.zip
s4-smbtorture: add netsessionenum rap torture test.
Guenther
-rw-r--r--source4/selftest/knownfail1
-rw-r--r--source4/torture/rap/rap.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
index aff03a58e2..a9cc4446c4 100644
--- a/source4/selftest/knownfail
+++ b/source4/selftest/knownfail
@@ -39,6 +39,7 @@ samba4.rpc.samr.passwords.lockout
samba4.base.charset.*.Testing partial surrogate
.*net.api.delshare.* # DelShare isn't implemented yet
samba4.rap.*netservergetinfo
+samba4.rap.*netsessionenum
samba4.smb2.persistent.handles1
samba4.winbind.struct.*.show_sequence # Not yet working in winbind
samba4.winbind.struct.*.getpwent # Not yet working in winbind
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 8d70b2cf70..ae505b9e31 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -1609,6 +1609,29 @@ static NTSTATUS smbcli_rap_netsessionenum(struct smbcli_tree *tree,
return result;
}
+static bool test_netsessionenum(struct torture_context *tctx,
+ struct smbcli_state *cli)
+{
+ struct rap_NetSessionEnum r;
+ int i;
+ uint16_t levels[] = { 2 };
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ r.in.level = levels[i];
+ r.in.bufsize = 8192;
+
+ torture_comment(tctx,
+ "Testing rap_NetSessionEnum level %d\n", r.in.level);
+
+ torture_assert_ntstatus_ok(tctx,
+ smbcli_rap_netsessionenum(cli->tree, tctx, &r),
+ "smbcli_rap_netsessionenum failed");
+ }
+
+ return true;
+}
+
bool torture_rap_scan(struct torture_context *torture, struct smbcli_state *cli)
{
int callno;
@@ -1644,6 +1667,8 @@ NTSTATUS torture_rap_init(void)
test_netshareenum);
torture_suite_add_1smb_test(suite_basic, "netservergetinfo",
test_netservergetinfo);
+ torture_suite_add_1smb_test(suite_basic, "netsessionenum",
+ test_netsessionenum);
torture_suite_add_1smb_test(suite, "scan", torture_rap_scan);