summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-27 02:13:58 +0000
committerJeremy Allison <jra@samba.org>2004-03-27 02:13:58 +0000
commit651d5b4683f4c97608a5f19c9996f85ae6b21fc6 (patch)
treeabb862887254b7fec47ed0530fff869170f2b862 /source3/torture
parent8d6aee954a62575e71f8c0d97429e09eaec4c132 (diff)
downloadsamba-651d5b4683f4c97608a5f19c9996f85ae6b21fc6.tar.gz
samba-651d5b4683f4c97608a5f19c9996f85ae6b21fc6.tar.bz2
samba-651d5b4683f4c97608a5f19c9996f85ae6b21fc6.zip
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)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c55
1 files changed, 55 insertions, 0 deletions
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}};