From 9bdb6e2b2266eee4b02cf5217db33bd47ef882f4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Mar 2002 01:57:39 +0000 Subject: expanded the lock6 test a bit to try lsarpc as well this allows us to check that we refuse locking on pipes (This used to be commit 3e69ea6846e455d6ebb15e4481d4f98fd038c8a2) --- source3/torture/torture.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index a79f22c1a0..015ed5b8eb 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -1499,7 +1499,8 @@ static BOOL run_locktest5(int dummy) static BOOL run_locktest6(int dummy) { static struct cli_state cli; - char *fname = "\\lockt6.lck"; + char *fname[2] = { "\\lock6.txt", "\\pipe\\lsarpc"}; + int i; int fnum; NTSTATUS status; @@ -1511,19 +1512,24 @@ static BOOL run_locktest6(int dummy) printf("starting locktest6\n"); - cli_unlink(&cli, fname); + for (i=0;i<2;i++) { + printf("Testing %s\n", fname[i]); - fnum = cli_open(&cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE); - status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE); - cli_close(&cli, fnum); - printf("CHANGE_LOCKTYPE gave %s\n", get_nt_error_msg(status)); + cli_unlink(&cli, fname[i]); - fnum = cli_open(&cli, fname, O_RDWR, DENY_NONE); - status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CANCEL_LOCK); - cli_close(&cli, fnum); - printf("CANCEL_LOCK gave %s\n", get_nt_error_msg(status)); + fnum = cli_open(&cli, fname[i], O_RDWR|O_CREAT|O_EXCL, DENY_NONE); + status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE); + cli_close(&cli, fnum); + printf("CHANGE_LOCKTYPE gave %s\n", get_nt_error_msg(status)); + + fnum = cli_open(&cli, fname[i], O_RDWR, DENY_NONE); + status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CANCEL_LOCK); + cli_close(&cli, fnum); + printf("CANCEL_LOCK gave %s\n", get_nt_error_msg(status)); + + cli_unlink(&cli, fname[i]); + } - cli_unlink(&cli, fname); torture_close_connection(&cli); printf("finished locktest6\n"); -- cgit