summaryrefslogtreecommitdiff
path: root/source3/torture/torture.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-03-29 12:44:42 +0000
committerAndrew Tridgell <tridge@samba.org>2003-03-29 12:44:42 +0000
commitdfcf1634bc84ff00f8241c326084a705989fb099 (patch)
treead6e47855b406d7ea7d019b5f436e459b9c9117f /source3/torture/torture.c
parenta6fad1ca7220160774148c1caeece45629d87ca6 (diff)
downloadsamba-dfcf1634bc84ff00f8241c326084a705989fb099.tar.gz
samba-dfcf1634bc84ff00f8241c326084a705989fb099.tar.bz2
samba-dfcf1634bc84ff00f8241c326084a705989fb099.zip
added a simple test for the old SMBtcon interface
(This used to be commit c95ae394c5dfe5e0fcc658119213b17bcb95fab5)
Diffstat (limited to 'source3/torture/torture.c')
-rw-r--r--source3/torture/torture.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 327212c6be..6ab5bf6dbb 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -977,6 +977,43 @@ static BOOL run_tcon_test(int dummy)
/*
+ checks for old style tcon support
+ */
+static BOOL run_tcon2_test(int dummy)
+{
+ static struct cli_state *cli;
+ uint16 cnum, max_xmit;
+ char *service;
+ NTSTATUS status;
+
+ if (!torture_open_connection(&cli)) {
+ return False;
+ }
+ cli_sockopt(cli, sockops);
+
+ printf("starting tcon2 test\n");
+
+ asprintf(&service, "\\\\%s\\%s", host, share);
+
+ status = cli_raw_tcon(cli, service, password, "?????", &max_xmit, &cnum);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("tcon2 failed : %s\n", cli_errstr(cli));
+ } else {
+ printf("tcon OK : max_xmit=%d cnum=%d tid=%d\n",
+ (int)max_xmit, (int)cnum, SVAL(cli->inbuf, smb_tid));
+ }
+
+ if (!torture_close_connection(cli)) {
+ return False;
+ }
+
+ printf("Passed tcon2 test\n");
+ return True;
+}
+
+
+/*
This test checks that
1) the server supports multiple locking contexts on the one SMB
@@ -4137,6 +4174,7 @@ static struct {
{"CASETABLE", torture_casetable, 0},
{"ERRMAPEXTRACT", run_error_map_extract, 0},
{"PIPE_NUMBER", run_pipe_number, 0},
+ {"TCON2", run_tcon2_test, 0},
{NULL, NULL, 0}};