提交 36ef9a2d 编写于 作者: A Anton Protopopov 提交者: Alexei Starovoitov

selftests/bpf: Cleanup some file descriptors in test_maps

The test_map_rdonly and test_map_wronly tests should close file descriptors
which they open.
Signed-off-by: NAnton Protopopov <a.s.protopopov@gmail.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200527185700.14658-3-a.s.protopopov@gmail.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
上级 204fb041
......@@ -1401,6 +1401,8 @@ static void test_map_rdonly(void)
/* Check that key=2 is not found. */
assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT);
assert(bpf_map_get_next_key(fd, &key, &value) == -1 && errno == ENOENT);
close(fd);
}
static void test_map_wronly(void)
......@@ -1423,6 +1425,8 @@ static void test_map_wronly(void)
/* Check that key=2 is not found. */
assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == EPERM);
assert(bpf_map_get_next_key(fd, &key, &value) == -1 && errno == EPERM);
close(fd);
}
static void prepare_reuseport_grp(int type, int map_fd, size_t map_elem_size,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册