]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/vsock: add namespace helpers to vmtest.sh
authorBobby Eshleman <bobbyeshleman@meta.com>
Wed, 21 Jan 2026 22:11:45 +0000 (14:11 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 Jan 2026 09:45:38 +0000 (10:45 +0100)
commit423ec6383edba92e78abbb99a776147b3fe7b2ca
tree10f849dcd05ded9dd9578e8c4b5b86fc7f483f24
parent873e7de9f9a3b67b08b380057b2c7828b0d78cae
selftests/vsock: add namespace helpers to vmtest.sh

Add functions for initializing namespaces with the different vsock NS
modes. Callers can use add_namespaces() and del_namespaces() to create
namespaces global0, global1, local0, and local1.

The add_namespaces() function initializes global0, local0, etc... with
their respective vsock NS mode by toggling child_ns_mode before creating
the namespace.

Remove namespaces upon exiting the program in cleanup(). This is
unlikely to be needed for a healthy run, but it is useful for tests that
are manually killed mid-test.

This patch is in preparation for later namespace tests.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260121-vsock-vmtest-v16-5-2859a7512097@meta.com
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/vsock/vmtest.sh