struct torture_context *tctx = state->tctx;
struct smbcli_state *cli = state->cli1;
struct smbcli_state *cli2 = state->cli2;
+ struct smbcli_state *tmpcli = NULL;
union smb_fileinfo t1finfo;
union smb_fileinfo t2finfo;
union smb_fileinfo t2pinfo;
t2pinfo.basic_info.level = RAW_FILEINFO_BASIC_INFORMATION;
t2pinfo.basic_info.in.file.path = state->fname;
- GET_INFO_FILE2(t2finfo);
- GET_INFO_PATH(t2pinfo);
+ if (state->fnum2 != -1) {
+ GET_INFO_FILE2(t2finfo);
+ }
+ tmpcli = cli2;
+ cli2 = cli;
+ if (0) GET_INFO_PATH(t2pinfo);
+ cli2 = tmpcli;
GET_INFO_FILE(t1finfo);
+if (0) {
if (t1finfo.basic_info.out.write_time != t2finfo.basic_info.out.write_time) {
/*
* There was a race, get it again on handle 2,
* but then they have to match.
*/
+ if (state->fnum2 != -1) {
GET_INFO_FILE2(t2finfo);
- GET_INFO_PATH(t2pinfo);
}
+ if (0) GET_INFO_PATH(t2pinfo);
+ }
+ if (state->fnum2 != -1) {
COMPARE_ALL_TIMES_EQUAL(t1finfo, t2finfo);
+ }
COMPARE_ALL_TIMES_EQUAL(t1finfo, t2pinfo);
-
+}
finfo->basic_info.out = t1finfo.basic_info.out;
done:
return ret;
t2pinfo.basic_info.level = RAW_FILEINFO_BASIC_INFO;
t2pinfo.basic_info.in.file.path = state->fname;
- GET_INFO_FILE2(t2finfo);
+ if (state->fnum2 != -1) {
+ GET_INFO_FILE2(t2finfo);
+ }
- smbcli_close(state->cli2->tree, state->fnum2);
- state->fnum2 = -1;
+ if (state->fnum2 != -1) {
+ smbcli_close(state->cli2->tree, state->fnum2);
+ state->fnum2 = -1;
+ }
GET_INFO_PATH(t2pinfo);
+ if (state->fnum2 != -1) {
COMPARE_ALL_TIMES_EQUAL(t2pinfo, t2finfo);
+ }
finfo->basic_info.out = t2finfo.basic_info.out;
+ finfo->basic_info.out = t2pinfo.basic_info.out;
done:
return ret;
torture_result(tctx, TORTURE_FAIL, __location__": unable to open %s", fname);
goto done;
}
- state.fnum2 = smbcli_open(cli2->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
- if (state.fnum2 == -1) {
- ret = false;
- torture_result(tctx, TORTURE_FAIL, __location__": unable to open %s", fname);
- goto done;
- }
+ //state.fnum2 = smbcli_open(cli2->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
+ //if (state.fnum2 == -1) {
+ // ret = false;
+ // torture_result(tctx, TORTURE_FAIL, __location__": unable to open %s", fname);
+ // goto done;
+ //}
state.fname = fname;
test_delaywrite_delaywrite1_write_data,
test_delaywrite_delaywrite1_close,
&state);
- torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime2(2)");
+ torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1()");
done:
if (state.fnum1 != -1) {
bool ret = true;
bool ok;
+ smb1 = false;
torture_comment(tctx, "START: %s\n", description);
/* get the initial times */
ok = get_basic_info_cb(private_data, &finfo0);
torture_assert(tctx, ok, "get_basic_info_cb: finfo0");
-
+if (1 || !smb1) {
/*
* Make sure the time doesn't change during the next 5 seconds
*/
ok = get_basic_info_cb(private_data, &finfoT);
torture_assert(tctx, ok, "get_basic_info_cb: finfoT");
COMPARE_WRITE_TIME_EQUAL(finfoT, finfo0);
-
+}
torture_comment(tctx, "Do a write on the file handle\n");
before_write = timeval_current();
ok = write_data_cb(private_data);
}
COMPARE_ALL_TIMES_EQUAL(finfoT, finfo0);
- smb_msleep(0.01 * msec);
+ //smb_msleep(0.01 * msec);
+ smb_msleep(1 * msec);
}
ok = get_basic_info_cb(private_data, &finfo1);
torture_assert(tctx, ok, "write_data_cb");
if (smb1) {
- finfo2 = finfo1;
- goto no_change;
+ //finfo2 = finfo1;
+ if (0) goto no_change;
}
ZERO_STRUCT(finfo2);
ok = close_cb(private_data, &finfoT);
torture_assert(tctx, ok, "close_cb: finfoT");
if (smb1) {
- COMPARE_TIMES_AFTER_CLOSE(finfoT, finfo1);
+ COMPARE_ALL_TIMES_EQUAL(finfoT, finfo3);
+ //COMPARE_TIMES_AFTER_CLOSE(finfoT, finfo1);
} else {
COMPARE_ALL_TIMES_EQUAL(finfoT, finfo3);
}