state.fname = fname;
ok = test_delay_writetime1(tctx, used_delay, normal_delay,
- "run", true, /* smb1 */
+ "run1",
+ test_delaywrite_delaywrite1_get_info,
+ test_delaywrite_delaywrite1_write_data,
+ NULL, /* close_cb */
+ &state);
+ torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1(1)");
+ ok = test_delay_writetime1(tctx, used_delay, normal_delay,
+ "run2",
test_delaywrite_delaywrite1_get_info,
test_delaywrite_delaywrite1_write_data,
test_delaywrite_delaywrite1_close,
&state);
- torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1()");
+ torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1(2)");
done:
if (state.fnum1 != -1) {
COMPARE_ALL_TIMES_EQUAL(c1finfo0, c1finfoCR);
ok = test_delay_writetime1(tctx, used_delay, normal_delay,
- "run1", false, /* smb1 */
+ "run1",
test_durable_open_delaywrite1_get_info,
test_durable_open_delaywrite1_write_data,
NULL, /* close_cb */
&state);
torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1(1)");
ok = test_delay_writetime1(tctx, used_delay, normal_delay,
- "run2", false, /* smb1 */
+ "run2",
test_durable_open_delaywrite1_get_info,
test_durable_open_delaywrite1_write_data,
test_durable_open_delaywrite1_close,
&state);
- torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime2(2)");
+ torture_assert_goto(tctx, ok, ret, done, "test_delay_writetime1(2)");
done:
if (state.h1 != NULL) {
double used_delay,
double normal_delay,
const char *description,
- bool smb1,
bool (*get_basic_info_cb)(void *private_data,
union smb_fileinfo *finfo),
bool (*write_data_cb)(void *private_data),
double used_delay,
double normal_delay,
const char *description,
- bool smb1,
bool (*get_basic_info_cb)(void *private_data,
union smb_fileinfo *finfo),
bool (*write_data_cb)(void *private_data),
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);
after_write = timeval_current();
torture_assert(tctx, ok, "write_data_cb");
- if (smb1) {
- //finfo2 = finfo1;
- if (0) goto no_change;
- }
-
ZERO_STRUCT(finfo2);
before_last_write = before_write;
after_last_write = after_write;
}
// We may get one additional change...
-no_change:
+
ok = get_basic_info_cb(private_data, &finfo3);
torture_assert(tctx, ok, "get_basic_info_cb: finfo3");
COMPARE_ALL_TIMES_EQUAL(finfo3, finfo2);
ok = close_cb(private_data, &finfoT);
torture_assert(tctx, ok, "close_cb: finfoT");
- if (smb1) {
- COMPARE_ALL_TIMES_EQUAL(finfoT, finfo3);
- //COMPARE_TIMES_AFTER_CLOSE(finfoT, finfo1);
- } else {
- COMPARE_ALL_TIMES_EQUAL(finfoT, finfo3);
- }
+ COMPARE_ALL_TIMES_EQUAL(finfoT, finfo3);
done:
return ret;