[Devel] [PATCH hci-8.2 v2 2/3] selftests/ve: move ve_devcg_bpf into ve/ and reuse ve_selftest.h

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Thu Nov 19 11:20:39 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/ve: ve_devcg_bpf fixture fails instead of skipping
  without cgroup2
--

commit e03e60874f39ad9941b752aa021d66a24b8a4706
Author: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>

selftests/ve: move ve_devcg_bpf into ve/ and reuse ve_selftest.h

This commit moves the ve_devcg_bpf test into tools/testing/selftests/ve/. It drops the test's private helpers (mount_cg2_fd, write_file_at, enter_cgroup, ctid search, VE cgroup creation) in favour of those in ve_selftest.h.

> diff --git a/tools/testing/selftests/ve_devcg_bpf/ve_devcg_bpf_test.c b/tools/testing/selftests/ve/ve_devcg_bpf_test.c
> similarity index 90%
> rename from tools/testing/selftests/ve_devcg_bpf/ve_devcg_bpf_test.c
> rename to tools/testing/selftests/ve/ve_devcg_bpf_test.c

[ ... ]

> @@ -592,11 +529,11 @@ FIXTURE_SETUP(ve_devcg_bpf)
>  	char ctid_str[16];
>  	char path[64];
>
> -	self->cgv2_fd = mount_cg2_fd();
> +	self->cgv2_fd = open_cg2_fd();
>  	ASSERT_GE(self->cgv2_fd, 0);

[Severity: Low]
Should a missing cgroup2 mount be a skip here rather than a failure?

If /sys/fs/cgroup is not a cgroup2 mount (a cgroup v1 or hybrid host, for example), open_cg2_fd() returns -1 with ENODEV. ASSERT_GE() then fails the fixture, and every TEST_F is reported as failed with no reason. The old private mount_cg2_fd() used fsopen/fsconfig/fsmount, so it did not depend on the host mount layout.

Skipping with a reason string when open_cg2_fd() fails would keep a missing prerequisite distinct from a real failure.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119081654.484107-2-mirian.shilakadze@virtuozzo.com?part=2



More information about the Devel mailing list