From 651d5b4683f4c97608a5f19c9996f85ae6b21fc6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 27 Mar 2004 02:13:58 +0000 Subject: Working (tested) client code for setting EA's by filename and fnum. Now for parsing out the retrieved EA's. Jeremy. (This used to be commit 5eeeee302cec2cc1f6c130ed44be9df028f73cde) --- source3/torture/torture.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'source3/torture/torture.c') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 07d568e879..3a250c1e14 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4310,8 +4310,62 @@ BOOL torture_chkpath_test(int dummy) return ret; } +static BOOL run_eatest(int dummy) +{ + static struct cli_state *cli; + const char *fname = "\\eatest.txt"; + BOOL correct = True; + int fnum, i; + + printf("starting eatest\n"); + + if (!torture_open_connection(&cli)) { + return False; + } + + cli_unlink(cli, fname); + fnum = cli_nt_create_full(cli, fname, 0, + FIRST_DESIRED_ACCESS, FILE_ATTRIBUTE_ARCHIVE, + FILE_SHARE_NONE, FILE_OVERWRITE_IF, + 0x4044, 0); + + if (fnum == -1) { + printf("open failed - %s\n", cli_errstr(cli)); + return False; + } + for (i = 0; i < 10; i++) { + fstring ea_name, ea_val; + 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)) { + printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli)); + return False; + } + } + + cli_close(cli, fnum); + for (i = 0; i < 10; i++) { + fstring ea_name, ea_val; + + slprintf(ea_name, sizeof(ea_name), "EA_%d", i); + memset(ea_val, (char)i+1, i+1); + if (!cli_set_path_ea(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 (!torture_close_connection(cli)) { + correct = False; + } + + return correct; +} static BOOL run_dirtest1(int dummy) { @@ -4650,6 +4704,7 @@ static struct { {"IOCTL", torture_ioctl_test, 0}, {"CHKPATH", torture_chkpath_test, 0}, {"FDSESS", run_fdsesstest, 0}, + { "EATEST", run_eatest, 0}, {NULL, NULL, 0}}; -- cgit