git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
275df9a
)
r4183: expanded the RAW-MKDIR torture test to test creation of EA lists
author
Andrew Tridgell
<tridge@samba.org>
Mon, 13 Dec 2004 23:58:39 +0000
(23:58 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 18:07:24 +0000
(13:07 -0500)
(This used to be commit
0134d8e9cc5634441b1aa6841bcd332c5afcc0f3
)
source4/torture/raw/mkdir.c
patch
|
blob
|
history
diff --git
a/source4/torture/raw/mkdir.c
b/source4/torture/raw/mkdir.c
index 539258946a4a44e073633508aadc666a506efa8d..eea5b20ffa55b59390930ccd3c668d1e9dae3d4e 100644
(file)
--- a/
source4/torture/raw/mkdir.c
+++ b/
source4/torture/raw/mkdir.c
@@
-20,6
+20,8
@@
#include "includes.h"
#include "includes.h"
+#define BASEDIR "\\mkdirtest"
+
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
@@
-35,13
+37,13
@@
static BOOL test_mkdir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_mkdir md;
struct smb_rmdir rd;
{
union smb_mkdir md;
struct smb_rmdir rd;
- const char *path =
"\\test_
mkdir.dir";
+ const char *path =
BASEDIR "\\
mkdir.dir";
NTSTATUS status;
BOOL ret = True;
NTSTATUS status;
BOOL ret = True;
- /* cleanup */
-
smbcli_rmdir(cli->tree, path)
;
- smbcli_unlink(cli->tree, path);
+ if (!torture_setup_dir(cli, BASEDIR)) {
+
return False
;
+ }
/*
basic mkdir
/*
basic mkdir
@@
-95,23
+97,43
@@
static BOOL test_mkdir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
md.t2mkdir.in.path = path;
md.t2mkdir.in.num_eas = 0;
status = smb_raw_mkdir(cli->tree, &md);
md.t2mkdir.in.path = path;
md.t2mkdir.in.num_eas = 0;
status = smb_raw_mkdir(cli->tree, &md);
- CHECK_STATUS(status, NT_STATUS_UNSUCCESSFUL);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ status = smb_raw_rmdir(cli->tree, &rd);
+ CHECK_STATUS(status, NT_STATUS_OK);
printf("testing t2mkdir with EAs\n");
/* with EAs */
printf("testing t2mkdir with EAs\n");
/* with EAs */
- md.t2mkdir.in.num_eas = 1;
- md.t2mkdir.in.eas = talloc_p(mem_ctx, struct ea_struct);
+ md.t2mkdir.level = RAW_MKDIR_T2MKDIR;
+ md.t2mkdir.in.path = path;
+ md.t2mkdir.in.num_eas = 3;
+ md.t2mkdir.in.eas = talloc_array_p(mem_ctx, struct ea_struct, md.t2mkdir.in.num_eas);
md.t2mkdir.in.eas[0].flags = 0;
md.t2mkdir.in.eas[0].name.s = "EAONE";
md.t2mkdir.in.eas[0].flags = 0;
md.t2mkdir.in.eas[0].name.s = "EAONE";
- md.t2mkdir.in.eas[0].value = data_blob_talloc(mem_ctx, "1", 1);
+ md.t2mkdir.in.eas[0].value = data_blob_talloc(mem_ctx, "blah", 4);
+ md.t2mkdir.in.eas[1].flags = 0;
+ md.t2mkdir.in.eas[1].name.s = "EA TWO";
+ md.t2mkdir.in.eas[1].value = data_blob_talloc(mem_ctx, "foo bar", 7);
+ md.t2mkdir.in.eas[2].flags = 0;
+ md.t2mkdir.in.eas[2].name.s = "EATHREE";
+ md.t2mkdir.in.eas[2].value = data_blob_talloc(mem_ctx, "xx1", 3);
status = smb_raw_mkdir(cli->tree, &md);
status = smb_raw_mkdir(cli->tree, &md);
- CHECK_STATUS(status, NT_STATUS_
UNSUCCESSFUL
);
+ CHECK_STATUS(status, NT_STATUS_
OK
);
+ status = torture_check_ea(cli, path, "EAONE", "blah");
+ CHECK_STATUS(status, NT_STATUS_OK);
+ status = torture_check_ea(cli, path, "EA TWO", "foo bar");
+ CHECK_STATUS(status, NT_STATUS_OK);
+ status = torture_check_ea(cli, path, "EATHREE", "xx1");
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ status = smb_raw_rmdir(cli->tree, &rd);
+ CHECK_STATUS(status, NT_STATUS_OK);
done:
done:
- smb
cli_rmdir(cli->tree, path
);
- smbcli_
unlink(cli->tree, path
);
+ smb
_raw_exit(cli->session
);
+ smbcli_
deltree(cli->tree, BASEDIR
);
return ret;
}
return ret;
}