aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2015-01-22 20:11:09 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-26 20:20:40 -0500
commitba1a68bf1308a71a07d2462f4c38c242e08f92ba (patch)
tree05f6de4541734b82240629d9a21cb3df1b83d7ef /samples/bpf
parent8ebe667c41e054384df19f2f382bc415badfaee1 (diff)
samples: bpf: relax test_maps check
hash map is unordered, so get_next_key() iterator shouldn't rely on particular order of elements. So relax this test. Fixes: ffb65f27a155 ("bpf: add a testsuite for eBPF maps") Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/test_maps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/test_maps.c b/samples/bpf/test_maps.c
index e286b42307f3..6299ee95cd11 100644
--- a/samples/bpf/test_maps.c
+++ b/samples/bpf/test_maps.c
@@ -69,9 +69,9 @@ static void test_hashmap_sanity(int i, void *data)
69 69
70 /* iterate over two elements */ 70 /* iterate over two elements */
71 assert(bpf_get_next_key(map_fd, &key, &next_key) == 0 && 71 assert(bpf_get_next_key(map_fd, &key, &next_key) == 0 &&
72 next_key == 2); 72 (next_key == 1 || next_key == 2));
73 assert(bpf_get_next_key(map_fd, &next_key, &next_key) == 0 && 73 assert(bpf_get_next_key(map_fd, &next_key, &next_key) == 0 &&
74 next_key == 1); 74 (next_key == 1 || next_key == 2));
75 assert(bpf_get_next_key(map_fd, &next_key, &next_key) == -1 && 75 assert(bpf_get_next_key(map_fd, &next_key, &next_key) == -1 &&
76 errno == ENOENT); 76 errno == ENOENT);
77 77