Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Don't hard-code root cgroup id

Commit 40430452fd5d ("kernfs: use 64bit inos if ino_t is 64bit") changed
the way cgroup ids are exposed to the userspace. Instead of assuming
fixed root id, let's query it.

Fixes: 40430452fd5d ("kernfs: use 64bit inos if ino_t is 64bit")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191202200143.250793-1-sdf@google.com

authored by

Stanislav Fomichev and committed by
Alexei Starovoitov
01d434ce edbca120

+1 -1
+1 -1
tools/testing/selftests/bpf/test_skb_cgroup_id_user.c
··· 120 120 int err = 0; 121 121 int map_fd; 122 122 123 - expected_ids[0] = 0x100000001; /* root cgroup */ 123 + expected_ids[0] = get_cgroup_id("/.."); /* root cgroup */ 124 124 expected_ids[1] = get_cgroup_id(""); 125 125 expected_ids[2] = get_cgroup_id(CGROUP_PATH); 126 126 expected_ids[3] = 0; /* non-existent cgroup */