From dfcf1634bc84ff00f8241c326084a705989fb099 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Mar 2003 12:44:42 +0000 Subject: added a simple test for the old SMBtcon interface (This used to be commit c95ae394c5dfe5e0fcc658119213b17bcb95fab5) --- source3/torture/torture.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'source3/torture') 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 @@ -976,6 +976,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 @@ -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}}; -- cgit