Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:
- [Low] vsock/test: missing opening brace in test_cases[] breaks compilation
- [Low] vsock/test: outdated datagram test IDs documented in README
--

commit f2fbe86b3992eecc82537eceffe22f137e4055d3
Author: Sergio Lopez <[email protected]>

vsock: add datagram tests to vsock_test

This commit adds datagram test cases to vsock_test covering local semantics,
host/guest transfers, routing, and queue accounting, along with capability
checks and documentation updates.

> diff --git a/tools/testing/vsock/README b/tools/testing/vsock/README
> index 680ce666ceb56..be34b032ef135 100644
> --- a/tools/testing/vsock/README
> +++ b/tools/testing/vsock/README

[ ... ]

> @@ -51,6 +51,25 @@ suite run, e.g.
>  
>  For more information see Documentation/dev-tools/kmemleak.rst.
>  
> +Datagram tests
> +--------------
> +vsock_test includes datagram cases in the client/server runs above. 
> Unsupported
> +cases print a skip reason.
> +
> +Virtio/vhost datagrams require kernel support on both sides and a VMM that
> +negotiates VIRTIO_VSOCK_F_DGRAM. Load vsock_loopback on both host and guest 
> for
> +the local cases, and make /dev/vsock available. VMCI's dedicated datagram
> +transport takes priority when loaded, causing virtio/vhost cases to skip.
> +
> +Run only the local datagram cases without a peer or TCP control connection:
> +
> +  ./vsock_test --local
> +
> +Use --list and --pick <test_id> to select individual cases. The BPF admission
> +test (48, requiring BPF privileges) and nested routing test (49, requiring 
> both
> +virtio and vhost transports) need explicit selection. The VMCI queue-length
> +test (53) runs only with VMCI.

[Severity: Low]
Are these test IDs off by 3?

In tools/testing/vsock/vsock_test.c, there are 44 existing entries in
test_cases[] before the new datagram tests (indices 0 through 43, ending with
the three SO_INQ test cases). That places test_dgram_sockmap() at index 51,
test_dgram_nested_source() at index 52, and test_dgram_vmci_inq() at index 56,
while indices 48, 49, and 53 correspond to test_dgram_connect(),
test_dgram_source_cid(), and test_dgram_sizes().

> diff --git a/tools/testing/vsock/vsock_test.c 
> b/tools/testing/vsock/vsock_test.c
> index 10b9074fb87f7..f4ff6a42a9cb1 100644
> --- a/tools/testing/vsock/vsock_test.c
> +++ b/tools/testing/vsock/vsock_test.c

[ ... ]

> @@ -2911,6 +2912,95 @@ static struct test_case test_cases[] = {
>       {
>               .name = "SO_INQ option validation",
>               .run_client = test_so_inq_validation_client,
> +     },
> +             .name = "SOCK_DGRAM autobind, duplicate bind and wildcard 
> destination",
> +             .run_client = test_dgram_bind,
> +             .run_server = test_dgram_bind,
> +             .check = vsock_dgram_check_local,
> +             .local = true,
>       },

[Severity: Low]
Is there a missing opening brace before the first SOCK_DGRAM entry in
test_cases[]? Without it, compiling tools/testing/vsock/vsock_test.c fails
with a syntax error because .name is parsed at the top level of the array
initializer and the following closing brace terminates test_cases[] early.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=8

Reply via email to