[LTP] [PATCH v5 11/16] Add statmount05 test

Cyril Hrubis chrubis@suse.cz
Tue Oct 8 14:03:07 CEST 2024


Hi!
> +static void test_mount_root(void)
> +{
> +	tst_res(TINFO, "Testing STATMOUNT_MNT_ROOT");
> +
> +	char *last_root;
> +
> +	memset(st_mount, 0, SM_SIZE);
> +
> +	TST_EXP_PASS(statmount(root_id, STATMOUNT_MNT_ROOT, st_mount,
> +		SM_SIZE, 0));
> +
> +	if (!TST_PASS)
> +		return;
> +
> +	last_root = strrchr(mnt_root, '/');

Wouldn't last_root = strrchr(DIRA, '/') produce the same result?

I'm just wondering why MNT_ROOT is relative and MNT_POINT is absolute
here.

> +	TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_MNT_ROOT);
> +	TST_EXP_EQ_STR(st_mount->str + st_mount->mnt_root, last_root);
> +}

Otherwise:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list