Lines Matching refs:test_ctx
184 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(ptr,
190 f = fopen(test_ctx->filename, "w");
192 test_ctx->tctx->error = errno;
193 test_ctx->tctx->done = true;
197 fprintf(f, "%s\n", test_ctx->filename);
202 static void check_and_set_threshold(struct inotify_test_ctx *test_ctx,
205 if (test_ctx->exp_flags != 0 && !(test_ctx->exp_flags & flags)) {
209 test_ctx->ncb++;
216 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(pvt,
219 check_and_set_threshold(test_ctx, flags);
227 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(pvt,
230 check_and_set_threshold(test_ctx, flags);
231 if (test_ctx->ncb == test_ctx->threshold) {
232 test_ctx->tctx->done = true;
242 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(*state,
249 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
250 test_ctx->filename, NULL, IN_MODIFY,
251 inotify_threshold_cb, test_ctx);
254 test_ctx->threshold = 2;
255 test_ctx->exp_flags = IN_MODIFY;
259 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
260 tv, file_mod_op, test_ctx);
268 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
269 tv, file_mod_op, test_ctx);
275 ret = test_ev_loop(test_ctx->tctx);
286 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(ptr,
297 test_ctx->tctx->error = errno;
298 test_ctx->tctx->done = true;
306 test_ctx->tctx->error = errno;
307 test_ctx->tctx->done = true;
311 fprintf(f, "%s\n", test_ctx->filename);
315 ret = rename(src_tmp_file, test_ctx->filename);
318 test_ctx->tctx->error = errno;
319 test_ctx->tctx->done = true;
326 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(*state,
333 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
334 test_ctx->filename, NULL, IN_MOVED_TO,
335 inotify_threshold_cb, test_ctx);
338 test_ctx->threshold = 1;
339 test_ctx->exp_flags = IN_MOVED_TO;
343 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
344 tv, file_mv_op, test_ctx);
350 ret = test_ev_loop(test_ctx->tctx);
359 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(ptr,
366 ret = unlink(test_ctx->filename);
368 test_ctx->tctx->error = errno;
369 test_ctx->tctx->done = true;
373 f = fopen(test_ctx->filename, "w");
375 test_ctx->tctx->error = errno;
376 test_ctx->tctx->done = true;
380 fprintf(f, "%s\n", test_ctx->filename);
387 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(*state,
394 test_ctx->threshold = 1;
395 test_ctx->exp_flags = IN_CREATE;
397 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
398 test_ctx->filename, NULL,
400 inotify_threshold_cb, test_ctx);
405 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
406 tv, file_del_add_op, test_ctx);
412 ret = test_ev_loop(test_ctx->tctx);
418 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(*state,
425 test_ctx->threshold = 1;
426 test_ctx->exp_flags = IN_CREATE;
428 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
429 test_ctx->filename, NULL,
431 inotify_threshold_cb, test_ctx);
437 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
438 tv, file_mod_op, test_ctx);
444 ret = test_ev_loop(test_ctx->tctx);
453 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(ptr,
459 ret = unlink(test_ctx->filename);
461 test_ctx->tctx->error = errno;
462 test_ctx->tctx->done = true;
472 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(ptr,
478 if (test_ctx->ncb == test_ctx->threshold) {
479 test_ctx->tctx->done = true;
488 struct inotify_test_ctx *test_ctx = talloc_get_type_abort(*state,
496 test_ctx->threshold = 1;
497 test_ctx->exp_flags = IN_CREATE | IN_DELETE;
499 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
500 test_ctx->filename, &delay,
502 inotify_set_threshold_cb, test_ctx);
507 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
508 tv, file_mod_op, test_ctx);
516 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
517 tv, file_del_op, test_ctx);
525 te = tevent_add_timer(test_ctx->tctx->ev, test_ctx,
526 tv, check_threshold_cb, test_ctx);
532 ret = test_ev_loop(test_ctx->tctx);