Lines Matching refs:tst_test
37 struct tst_test *tst_test; variable
105 if (tst_test->needs_checkpoints || tst_test->child_needs_reinit) { in setup_ipc()
114 if (tst_test->needs_checkpoints) { in setup_ipc()
291 if (tst_test->cleanup) in do_test_cleanup()
292 tst_test->cleanup(); in do_test_cleanup()
392 if (!tst_test->forks_child) in safe_fork()
427 if (!tst_test->options) in print_help()
430 for (i = 0; tst_test->options[i].optstr; i++) in print_help()
431 fprintf(stderr, "%s\n", tst_test->options[i].help); in print_help()
437 const struct tst_tag *tags = tst_test->tags; in print_test_tags()
459 struct tst_option *toptions = tst_test->options; in check_option_collision()
478 if (!tst_test->options) in count_options()
481 for (i = 0; tst_test->options[i].optstr; i++); in count_options()
489 struct tst_option *toptions = tst_test->options; in parse_topt()
524 strcat(optstr, tst_test->options[i].optstr); in parse_opts()
631 const struct tst_tag *tags = tst_test->tags; in print_failure_hints()
699 if (tst_parse_kver(tst_test->min_kver, &v1, &v2, &v3)) { in check_kver()
702 tst_test->min_kver); in check_kver()
707 tst_test->min_kver); in check_kver()
727 return tst_test->needs_tmpdir || in needs_tmpdir()
728 tst_test->needs_device || in needs_tmpdir()
729 tst_test->mntpoint || in needs_tmpdir()
730 tst_test->resource_files || in needs_tmpdir()
731 tst_test->needs_checkpoints; in needs_tmpdir()
738 for (i = 0; tst_test->resource_files[i]; i++) in copy_resources()
739 TST_RESOURCE_COPY(NULL, tst_test->resource_files[i], NULL); in copy_resources()
765 if (tst_test->test) in assert_test_fn()
768 if (tst_test->test_all) in assert_test_fn()
771 if (tst_test->sample) in assert_test_fn()
780 if (tst_test->test && !tst_test->tcnt) in assert_test_fn()
783 if (!tst_test->test && tst_test->tcnt) in assert_test_fn()
829 if (tst_test->format_device) { in prepare_device()
830 SAFE_MKFS(tdev.dev, tdev.fs_type, tst_test->dev_fs_opts, in prepare_device()
831 tst_test->dev_extra_opts); in prepare_device()
834 if (tst_test->needs_rofs) { in prepare_device()
835 prepare_and_mount_ro_fs(tdev.dev, tst_test->mntpoint, in prepare_device()
840 if (tst_test->mount_device) { in prepare_device()
841 SAFE_MOUNT(tdev.dev, tst_test->mntpoint, tdev.fs_type, in prepare_device()
842 tst_test->mnt_flags, tst_test->mnt_data); in prepare_device()
849 if (!tst_test) in do_setup()
852 if (tst_test->tconf_msg) in do_setup()
853 tst_brk(TCONF, "%s", tst_test->tconf_msg); in do_setup()
855 if (tst_test->needs_kconfigs) in do_setup()
856 tst_kconfig_check(tst_test->needs_kconfigs); in do_setup()
862 if (tst_test->sample) in do_setup()
863 tst_test = tst_timer_test_setup(tst_test); in do_setup()
867 if (tst_test->needs_root && geteuid() != 0) in do_setup()
870 if (tst_test->min_kver) in do_setup()
873 if (tst_test->needs_drivers) { in do_setup()
877 for (i = 0; (name = tst_test->needs_drivers[i]); ++i) in do_setup()
882 if (tst_test->format_device) in do_setup()
883 tst_test->needs_device = 1; in do_setup()
885 if (tst_test->mount_device) { in do_setup()
886 tst_test->needs_device = 1; in do_setup()
887 tst_test->format_device = 1; in do_setup()
890 if (tst_test->all_filesystems) in do_setup()
891 tst_test->needs_device = 1; in do_setup()
895 if (tst_test->bufs) in do_setup()
896 tst_buffers_alloc(tst_test->bufs); in do_setup()
901 if (tst_test->save_restore) { in do_setup()
902 const char * const *name = tst_test->save_restore; in do_setup()
910 if (tst_test->mntpoint) in do_setup()
911 SAFE_MKDIR(tst_test->mntpoint, 0777); in do_setup()
913 if ((tst_test->needs_devfs || tst_test->needs_rofs || in do_setup()
914 tst_test->mount_device || tst_test->all_filesystems) && in do_setup()
915 !tst_test->mntpoint) { in do_setup()
919 if (!!tst_test->needs_rofs + !!tst_test->needs_devfs + in do_setup()
920 !!tst_test->needs_device > 1) { in do_setup()
925 if (tst_test->needs_devfs) in do_setup()
926 prepare_and_mount_dev_fs(tst_test->mntpoint); in do_setup()
928 if (tst_test->needs_rofs) { in do_setup()
932 if (prepare_and_mount_ro_fs(NULL, tst_test->mntpoint, "tmpfs")) { in do_setup()
935 tst_test->needs_device = 1; in do_setup()
936 tst_test->format_device = 1; in do_setup()
940 if (tst_test->needs_device && !mntpoint_mounted) { in do_setup()
941 tdev.dev = tst_acquire_device_(NULL, tst_test->dev_min_size); in do_setup()
948 if (tst_test->dev_fs_type) in do_setup()
949 tdev.fs_type = tst_test->dev_fs_type; in do_setup()
953 if (!tst_test->all_filesystems) in do_setup()
957 if (tst_test->needs_overlay && !tst_test->mount_device) { in do_setup()
960 if (tst_test->needs_overlay && !mntpoint_mounted) { in do_setup()
963 if (tst_test->needs_overlay && !ovl_mounted) { in do_setup()
968 if (tst_test->resource_files) in do_setup()
971 if (tst_test->restore_wallclock) in do_setup()
979 if (tst_test->caps) in do_test_setup()
980 tst_cap_setup(tst_test->caps, TST_CAP_REQ); in do_test_setup()
982 if (tst_test->setup) in do_test_setup()
983 tst_test->setup(); in do_test_setup()
988 if (tst_test->caps) in do_test_setup()
989 tst_cap_setup(tst_test->caps, TST_CAP_DROP); in do_test_setup()
998 tst_umount(tst_test->mntpoint); in do_cleanup()
1000 if (tst_test->needs_device && tdev.dev) in do_cleanup()
1009 if (tst_test->save_restore) in do_cleanup()
1012 if (tst_test->restore_wallclock) in do_cleanup()
1023 if (!tst_test->test) { in run_tests()
1025 tst_test->test_all(); in run_tests()
1038 for (i = 0; i < tst_test->tcnt; i++) { in run_tests()
1040 tst_test->test(i); in run_tests()
1229 if (tst_test->timeout) in fork_testrun()
1230 tst_set_timeout(tst_test->timeout); in fork_testrun()
1271 const char *const *filesystems = tst_get_supported_fs_types(tst_test->dev_fs_flags); in run_tcases_per_fs()
1286 tst_umount(tst_test->mntpoint); in run_tcases_per_fs()
1306 void tst_run_tcases(int argc, char *argv[], struct tst_test *self) in tst_run_tcases()
1312 tst_test = self; in tst_run_tcases()
1321 if (tst_test->test_variants) in tst_run_tcases()
1322 test_variants = tst_test->test_variants; in tst_run_tcases()
1325 if (tst_test->all_filesystems) in tst_run_tcases()