Skip to content

Commit efbc3b8

Browse files
aspskAlexei Starovoitov
authored andcommitted
selftests/bpf: Cleanup comments in test_maps
Make comments inside the test_map_rdonly and test_map_wronly tests consistent with logic. Signed-off-by: Anton Protopopov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 36ef9a2 commit efbc3b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/bpf/test_maps.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,11 +1394,11 @@ static void test_map_rdonly(void)
13941394

13951395
key = 1;
13961396
value = 1234;
1397-
/* Insert key=1 element. */
1397+
/* Try to insert key=1 element. */
13981398
assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == -1 &&
13991399
errno == EPERM);
14001400

1401-
/* Check that key=2 is not found. */
1401+
/* Check that key=1 is not found. */
14021402
assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT);
14031403
assert(bpf_map_get_next_key(fd, &key, &value) == -1 && errno == ENOENT);
14041404

@@ -1422,7 +1422,7 @@ static void test_map_wronly(void)
14221422
/* Insert key=1 element. */
14231423
assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0);
14241424

1425-
/* Check that key=2 is not found. */
1425+
/* Check that reading elements and keys from the map is not allowed. */
14261426
assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == EPERM);
14271427
assert(bpf_map_get_next_key(fd, &key, &value) == -1 && errno == EPERM);
14281428

0 commit comments

Comments
 (0)