selftest/bpf: Add tests for sockmap with unix stream type.
authorJiang Wang <jiang.wang@bytedance.com>
Mon, 16 Aug 2021 19:03:22 +0000 (19:03 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 17 Aug 2021 01:43:46 +0000 (18:43 -0700)
Add two tests for unix stream to unix stream redirection
in sockmap tests.

Signed-off-by: Jiang Wang <jiang.wang@bytedance.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210816190327.2739291-4-jiang.wang@bytedance.com
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c

index a9f1bf9d5dff81d6e37969832e8b0584489e3843..7a976d43281a632730472413269437a0fee66d14 100644 (file)
@@ -2020,11 +2020,13 @@ void test_sockmap_listen(void)
        run_tests(skel, skel->maps.sock_map, AF_INET);
        run_tests(skel, skel->maps.sock_map, AF_INET6);
        test_unix_redir(skel, skel->maps.sock_map, SOCK_DGRAM);
+       test_unix_redir(skel, skel->maps.sock_map, SOCK_STREAM);
 
        skel->bss->test_sockmap = false;
        run_tests(skel, skel->maps.sock_hash, AF_INET);
        run_tests(skel, skel->maps.sock_hash, AF_INET6);
        test_unix_redir(skel, skel->maps.sock_hash, SOCK_DGRAM);
+       test_unix_redir(skel, skel->maps.sock_hash, SOCK_STREAM);
 
        test_sockmap_listen__destroy(skel);
 }