diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-25 07:24:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:40 -0500 |
commit | d200f9385f1088240eb588deb94550291796ca10 (patch) | |
tree | 8522f5ce59fdd324fa9082464df3fccfe04797b7 /source4/torture/basic/denytest.c | |
parent | 611e9e601c4bcfa7e871bfd6b53bc8b5bb1c6ad4 (diff) | |
download | samba-d200f9385f1088240eb588deb94550291796ca10.tar.gz samba-d200f9385f1088240eb588deb94550291796ca10.tar.bz2 samba-d200f9385f1088240eb588deb94550291796ca10.zip |
r3203: moved more test functions into torture/basic/*.c
the idea is that torture/torture.c should eventually be just the
harness code, which will make it easier to read
(This used to be commit eca85d26ed744563d1bbb8dd10a819d39fdc495b)
Diffstat (limited to 'source4/torture/basic/denytest.c')
-rw-r--r-- | source4/torture/basic/denytest.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 8c0339dfed..b8ee5890e5 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1601,3 +1601,53 @@ failed: return correct; } + + +/* + simple test harness for playing with deny modes + */ +BOOL torture_denytest3(int dummy) +{ + struct smbcli_state *cli1, *cli2; + int fnum1, fnum2; + const char *fname; + + printf("starting deny3 test\n"); + + printf("Testing simple deny modes\n"); + + if (!torture_open_connection(&cli1)) { + return False; + } + if (!torture_open_connection(&cli2)) { + return False; + } + + fname = "\\deny_dos1.dat"; + + smbcli_unlink(cli1->tree, fname); + fnum1 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS); + fnum2 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS); + if (fnum1 != -1) smbcli_close(cli1->tree, fnum1); + if (fnum2 != -1) smbcli_close(cli1->tree, fnum2); + smbcli_unlink(cli1->tree, fname); + printf("fnum1=%d fnum2=%d\n", fnum1, fnum2); + + + fname = "\\deny_dos2.dat"; + + smbcli_unlink(cli1->tree, fname); + fnum1 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS); + fnum2 = smbcli_open(cli2->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS); + if (fnum1 != -1) smbcli_close(cli1->tree, fnum1); + if (fnum2 != -1) smbcli_close(cli2->tree, fnum2); + smbcli_unlink(cli1->tree, fname); + printf("fnum1=%d fnum2=%d\n", fnum1, fnum2); + + + torture_close_connection(cli1); + torture_close_connection(cli2); + + return True; +} + |