summaryrefslogtreecommitdiffstats
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-29 23:39:13 +0000
committerJeremy Allison <jra@samba.org>2004-03-29 23:39:13 +0000
commit578d7157558e4303bfed583cded4c4f35b4e2911 (patch)
treeeb24db87deb17828a0d5f58f460708f24c587ac6 /source3/torture
parent099974aa1575bf580c69c3848bc73d5d3b4b2bf3 (diff)
downloadsamba-578d7157558e4303bfed583cded4c4f35b4e2911.tar.gz
samba-578d7157558e4303bfed583cded4c4f35b4e2911.tar.xz
samba-578d7157558e4303bfed583cded4c4f35b4e2911.zip
Setting EA's to zero length deletes them.
Jeremy. (This used to be commit 01fb8717628d1daad19725a97f6ae2d729afcac2)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 97bca82d9bb..ead9d69cf15 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4360,7 +4360,6 @@ static BOOL run_eatest(int dummy)
}
}
-
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;
@@ -4372,6 +4371,34 @@ static BOOL run_eatest(int dummy)
dump_data(0, ea_list[i].value.data, ea_list[i].value.length);
}
+ /* Setting EA's to zero length deletes them. Test this */
+ printf("Now deleting all EA's....\n");
+
+ for (i = 0; i < 20; i++) {
+ fstring ea_name;
+ slprintf(ea_name, sizeof(ea_name), "EA_%d", i);
+ if (!cli_set_ea_path(cli, fname, ea_name, "", 0)) {
+ printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli));
+ return False;
+ }
+ }
+
+ 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);
+ }
+
+ if (num_eas != 0) {
+ printf("deleting EA's failed.\n");
+ correct = False;
+ }
+
talloc_destroy(mem_ctx);
if (!torture_close_connection(cli)) {
correct = False;