diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-05 08:17:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-05 08:17:16 +0000 |
commit | 5264e9a2a737d6498be0f346bcbc3b583609abf5 (patch) | |
tree | e8c083f14d669229b929ae110e819a3a80f3e1d6 /source3/utils | |
parent | 091fd5a1746080b8a988f08557ba5f9df97653a4 (diff) | |
download | samba-5264e9a2a737d6498be0f346bcbc3b583609abf5.tar.gz samba-5264e9a2a737d6498be0f346bcbc3b583609abf5.tar.bz2 samba-5264e9a2a737d6498be0f346bcbc3b583609abf5.zip |
Set correct reply word in large writeX (greater than 64k) replies.
Also added smbtorture test for this.
Jeremy.
(This used to be commit 6d65556ae8bea45a203defaded8436cbb56965e1)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/torture.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 7298cd9b9a..982be77151 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -483,6 +483,54 @@ static void run_readwritemulti(int dummy) close_connection(&cli); } +static void run_readwritelarge(int dummy) +{ + static struct cli_state cli1; + int fnum1; + char *lockfname = "\\large.dat"; + size_t fsize; + char buf[0x10000]; + + if (!open_connection(&cli1)) { + return; + } + cli_sockopt(&cli1, sockops); + memset(buf,'\0',sizeof(buf)); + + cli1.max_xmit = 0x11000; + + printf("starting readwritelarge\n"); + + cli_unlink(&cli1, lockfname); + + fnum1 = cli_open(&cli1, lockfname, O_RDWR | O_CREAT | O_EXCL, DENY_NONE); + if (fnum1 == -1) { + printf("open read/write of %s failed (%s)\n", lockfname, cli_errstr(&cli1)); + return; + } + + cli_write(&cli1, fnum1, 0, buf, 0, sizeof(buf)); + + if (!cli_close(&cli1, fnum1)) { + printf("close failed (%s)\n", cli_errstr(&cli1)); + } + + if (!cli_qpathinfo(&cli1, lockfname, NULL, NULL, NULL, &fsize, NULL)) { + printf("qpathinfo failed (%s)\n", cli_errstr(&cli1)); + } + + if (fsize == sizeof(buf)) + printf("readwritelarge test succeeded (size = %x)\n", fsize); + else + printf("readwritelarge test failed (size = %x)\n", fsize); + + if (!cli_unlink(&cli1, lockfname)) { + printf("unlink failed (%s)\n", cli_errstr(&cli1)); + } + + close_connection(&cli1); +} + int line_count = 0; /* run a test that simulates an approximate netbench client load */ @@ -2722,6 +2770,7 @@ static struct { {"TCON", run_tcon_test, 0}, {"RW1", run_readwritetest, 0}, {"RW2", run_readwritemulti, FLAG_MULTIPROC}, + {"RW3", run_readwritelarge, 0}, {"OPEN", run_opentest, 0}, {"DELETE", run_deletetest, 0}, {NULL, NULL, 0}}; @@ -2811,6 +2860,8 @@ static void usage(void) codepage_initialise(lp_client_code_page()); + codepage_initialise(lp_client_code_page()); + lp_load(servicesf,True,False,False); load_interfaces(); |