summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-18 14:22:42 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-18 15:06:13 +1100
commit9ae4daeb96ecf99f17f425678d2386758ab5aa35 (patch)
tree8ee67c82fc245f4faaa327a24db357df04c23f59 /source4/torture/raw
parent764c09e6bc92d8ccd33b44d6cc80e82a9b4d76f0 (diff)
downloadsamba-9ae4daeb96ecf99f17f425678d2386758ab5aa35.tar.gz
samba-9ae4daeb96ecf99f17f425678d2386758ab5aa35.tar.bz2
samba-9ae4daeb96ecf99f17f425678d2386758ab5aa35.zip
s4-torture: fixed the streams tests for Samba4
In some cases we were not doing streams tests on s4 that we should. In others, we were calling tests that are known to fail on s4. Some of those are a bit puzzling.
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/streams.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 5c6bd63157..5d2fb55ced 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -193,7 +193,7 @@ static bool check_stream_list(struct smbcli_state *cli, const char *fname,
d_fprintf(stderr, "(%s) expected stream name %s, got "
"%s\n", __location__, exp_sort[i],
stream_sort[i].stream_name.s);
- goto fail;
+ goto show_streams;
}
}
@@ -201,6 +201,14 @@ static bool check_stream_list(struct smbcli_state *cli, const char *fname,
fail:
talloc_free(tmp_ctx);
return ret;
+
+show_streams:
+ for (i=0; i<num_exp; i++) {
+ d_fprintf(stderr, "stream names '%s' '%s'\n",
+ exp_sort[i], stream_sort[i].stream_name.s);
+ }
+ talloc_free(tmp_ctx);
+ return ret;
}
/*
@@ -360,10 +368,8 @@ static bool test_stream_io(struct torture_context *tctx,
ret &= check_stream(cli, __location__, mem_ctx, fname, "Stream One:$DATA", "test MORE DATA ");
ret &= check_stream(cli, __location__, mem_ctx, fname, "Stream One:", NULL);
ret &= check_stream(cli, __location__, mem_ctx, fname, "Second Stream", "SECOND STREAM");
- if (!torture_setting_bool(tctx, "samba4", false)) {
- ret &= check_stream(cli, __location__, mem_ctx, fname,
- "SECOND STREAM:$DATA", "SECOND STREAM");
- }
+ ret &= check_stream(cli, __location__, mem_ctx, fname,
+ "SECOND STREAM:$DATA", "SECOND STREAM");
ret &= check_stream(cli, __location__, mem_ctx, fname, "Second Stream:$DATA", "SECOND STREAM");
ret &= check_stream(cli, __location__, mem_ctx, fname, "Second Stream:", NULL);
ret &= check_stream(cli, __location__, mem_ctx, fname, "Second Stream:$FOO", NULL);
@@ -393,17 +399,15 @@ static bool test_stream_io(struct torture_context *tctx,
check_stream_list(cli, fname, 1, one);
- if (!torture_setting_bool(tctx, "samba4", false)) {
- io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
- io.ntcreatex.in.fname = sname1;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
- CHECK_STATUS(status, NT_STATUS_OK);
- smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
- io.ntcreatex.in.fname = sname2;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
- CHECK_STATUS(status, NT_STATUS_OK);
- smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
- }
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+ io.ntcreatex.in.fname = sname1;
+ status = smb_raw_open(cli->tree, mem_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
+ io.ntcreatex.in.fname = sname2;
+ status = smb_raw_open(cli->tree, mem_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
printf("(%s) deleting file\n", __location__);
status = smbcli_unlink(cli->tree, fname);
@@ -774,10 +778,6 @@ static bool test_stream_names(struct torture_context *tctx,
smbcli_close(cli->tree, fnum2);
smbcli_close(cli->tree, fnum3);
- if (torture_setting_bool(tctx, "samba4", true)) {
- goto done;
- }
-
finfo.generic.level = RAW_FILEINFO_ALL_INFO;
finfo.generic.in.file.path = fname;
status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
@@ -845,7 +845,7 @@ static bool test_stream_names(struct torture_context *tctx,
status = smb_raw_fileinfo(cli->tree, mem_ctx, &stinfo);
CHECK_STATUS(status, NT_STATUS_OK);
if (!torture_setting_bool(tctx, "samba3", false)) {
- CHECK_STR(rpath, stinfo.name_info.out.fname.s);
+ CHECK_STR(stinfo.name_info.out.fname.s, rpath);
}
write_time = finfo.all_info.out.write_time;
@@ -936,9 +936,15 @@ static bool test_stream_names(struct torture_context *tctx,
sinfo.rename_information.in.root_fid = 0;
sinfo.rename_information.in.new_name = ":MStream Two:$DATA";
status = smb_raw_setfileinfo(cli->tree, &sinfo);
- CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ if (torture_setting_bool(tctx, "samba4", false)) {
+ /* why should this rename be considered invalid?? */
+ CHECK_STATUS(status, NT_STATUS_OK);
+ ret &= check_stream_list(cli, fname, 4, four);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ ret &= check_stream_list(cli, fname, 5, five2);
+ }
- ret &= check_stream_list(cli, fname, 5, five2);
/* TODO: we need to test more rename combinations */