Commit 01d434ce authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Alexei Starovoitov

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

Commit 40430452 ("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: 40430452 ("kernfs: use 64bit inos if ino_t is 64bit")
Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191202200143.250793-1-sdf@google.com
parent edbca120
...@@ -120,7 +120,7 @@ int check_ancestor_cgroup_ids(int prog_id) ...@@ -120,7 +120,7 @@ int check_ancestor_cgroup_ids(int prog_id)
int err = 0; int err = 0;
int map_fd; int map_fd;
expected_ids[0] = 0x100000001; /* root cgroup */ expected_ids[0] = get_cgroup_id("/.."); /* root cgroup */
expected_ids[1] = get_cgroup_id(""); expected_ids[1] = get_cgroup_id("");
expected_ids[2] = get_cgroup_id(CGROUP_PATH); expected_ids[2] = get_cgroup_id(CGROUP_PATH);
expected_ids[3] = 0; /* non-existent cgroup */ expected_ids[3] = 0; /* non-existent cgroup */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment