[PATCH bpf-next 3/5] selftests/bpf: Use /tmp for temporary file in d_path

From: Pu Lehui

Date: Tue Sep 29 2026 - 04:39:18 EST


From: Pu Lehui <pulehui@xxxxxxxxxx>

When running selftests via vmtest.sh on riscv64, the d_path test fails.

The failure occurs because the rootfs created by libbpf/ci [0] does not
mount /dev/shm, causing temporary file creation under /dev/shm to fail.

Let's switch to using /tmp instead to fix this issue.

Note that older rootfs images did not mount tmpfs on /tmp, writing
temporary files directly into the image. This has been fixed in [1] for
newly built images.

Link: https://github.com/libbpf/ci/tree/main/rootfs [0]
Link: https://github.com/libbpf/ci/commit/92caeba5960c [1]
Signed-off-by: Pu Lehui <pulehui@xxxxxxxxxx>
---
tools/testing/selftests/bpf/prog_tests/d_path.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/d_path.c b/tools/testing/selftests/bpf/prog_tests/d_path.c
index 1a2a2f1abf03..b72825d1edee 100644
--- a/tools/testing/selftests/bpf/prog_tests/d_path.c
+++ b/tools/testing/selftests/bpf/prog_tests/d_path.c
@@ -220,7 +220,7 @@ static void test_d_path_check_types(void)
static void test_d_path_mem_access(void)
{
int localfd = -1;
- char path_template[] = "/dev/shm/d_path_loadgen.XXXXXX";
+ char path_template[] = "/tmp/d_path_loadgen.XXXXXX";
struct test_d_path__bss *bss;
struct test_d_path *skel;

--
2.34.1