summaryrefslogtreecommitdiffstats
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-29 22:21:47 +0000
committerJeremy Allison <jra@samba.org>2004-03-29 22:21:47 +0000
commit099974aa1575bf580c69c3848bc73d5d3b4b2bf3 (patch)
tree14663c42a5e323f7202a5bdbf0d3cd324786a59a /source3/torture
parent4ee66eb4c3ffc575dde7aa7156a0dca1b23825e1 (diff)
downloadsamba-099974aa1575bf580c69c3848bc73d5d3b4b2bf3.tar.gz
samba-099974aa1575bf580c69c3848bc73d5d3b4b2bf3.tar.xz
samba-099974aa1575bf580c69c3848bc73d5d3b4b2bf3.zip
Fix get/set of EA's in client library. Added torture test for it.
Jeremy. (This used to be commit 0d239a9c070bdc1ce2d2806fc02549c4750597aa)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 3a250c1e146..97bca82d9bb 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4316,6 +4316,9 @@ static BOOL run_eatest(int dummy)
const char *fname = "\\eatest.txt";
BOOL correct = True;
int fnum, i;
+ size_t num_eas;
+ struct ea_struct *ea_list = NULL;
+ TALLOC_CTX *mem_ctx = talloc_init("eatest");
printf("starting eatest\n");
@@ -4339,7 +4342,7 @@ static BOOL run_eatest(int dummy)
slprintf(ea_name, sizeof(ea_name), "EA_%d", i);
memset(ea_val, (char)i+1, i+1);
- if (!cli_set_fnum_ea(cli, fnum, ea_name, ea_val, i+1)) {
+ if (!cli_set_ea_fnum(cli, fnum, ea_name, ea_val, i+1)) {
printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli));
return False;
}
@@ -4349,17 +4352,27 @@ static BOOL run_eatest(int dummy)
for (i = 0; i < 10; i++) {
fstring ea_name, ea_val;
- slprintf(ea_name, sizeof(ea_name), "EA_%d", i);
+ slprintf(ea_name, sizeof(ea_name), "EA_%d", i+10);
memset(ea_val, (char)i+1, i+1);
- if (!cli_set_path_ea(cli, fname, ea_name, ea_val, i+1)) {
+ if (!cli_set_ea_path(cli, fname, ea_name, ea_val, i+1)) {
printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli));
return False;
}
}
- cli_get_eas(cli, fname, NULL,NULL,NULL);
+ if (!cli_get_ea_list_path(cli, fname, mem_ctx, &num_eas, &ea_list)) {
+ printf("ea_get list failed - %s\n", cli_errstr(cli));
+ correct = False;
+ }
+
+ printf("num_eas = %d\n", num_eas);
+ for (i = 0; i < num_eas; i++) {
+ printf("%d: ea_name = %s. Val = ", i, ea_list[i].name);
+ dump_data(0, ea_list[i].value.data, ea_list[i].value.length);
+ }
+ talloc_destroy(mem_ctx);
if (!torture_close_connection(cli)) {
correct = False;
}