[LTP] [PATCH v2 3/3] cgroups: Add first IO controller test
Petr Vorel
pvorel@suse.cz
Tue Apr 12 10:58:28 CEST 2022
Hi Richie,
LGTM, just please remove needs_device as not needed.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> +static void setup(void)
> +{
> + char buf[PATH_MAX] = { 0 };
> + char *path = SAFE_GETCWD(buf, PATH_MAX - sizeof("mnt") - 1);
> + struct stat st;
> +
> + strcpy(path + strlen(path), "/mnt");
> +
> + tst_stat_mount_dev(path, &st);
> + dev_major = major(st.st_rdev);
> + dev_minor = minor(st.st_rdev);
If we ever support test setup run inside do_setup() (i.e. setup function which
would be run just once - before for_each_variant(), for_each_filesystem() and
fork_testrun()), this test would have use case for it (I suppose more tests
which use .all_filesystems). Because tst_stat_mount_dev() could be run just for
first filesystem. But that's not related to the testcase.
Kind regards,
Petr
> +}
> +
> +static struct tst_test test = {
> + .test_all = run,
> + .setup = setup,
> + .needs_device = 1,
> + .mntpoint = "mnt",
> + .mount_device = 1,
> + .all_filesystems = 1,
> + .skip_filesystems = (const char *const[]){ "ntfs", "tmpfs", NULL },
> + .needs_cgroup_ver = TST_CG_V2,
> + .needs_cgroup_ctrls = (const char *const[]){ "io", NULL },
> +};
More information about the ltp
mailing list