diff options
author | Li Zhijian <zhijianx.li@intel.com> | 2018-02-21 21:34:02 -0500 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-22 09:21:26 -0500 |
commit | 80475c48c6a8a65171e035e0915dc7996b5a0a65 (patch) | |
tree | 53da30883f50ee5acbde1a0717d5a67b6f5e5e78 /tools | |
parent | 31a8260d3e34aaddf821388b8e0d589f44401f75 (diff) |
selftests/bpf/test_maps: exit child process without error in ENOMEM case
test_maps contains a series of stress tests, and previously it will break the
rest tests when it failed to alloc memory.
-----------------------
Failed to create hashmap key=8 value=262144 'Cannot allocate memory'
Failed to create hashmap key=16 value=262144 'Cannot allocate memory'
Failed to create hashmap key=8 value=262144 'Cannot allocate memory'
Failed to create hashmap key=8 value=262144 'Cannot allocate memory'
test_maps: test_maps.c:955: run_parallel: Assertion `status == 0' failed.
Aborted
not ok 1..3 selftests: test_maps [FAIL]
-----------------------
after this patch, the rest tests will be continue when it occurs an ENOMEM failure
CC: Alexei Starovoitov <alexei.starovoitov@gmail.com>
CC: Philip Li <philip.li@intel.com>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/test_maps.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c index 436c4c72414f..9e03a4c356a4 100644 --- a/tools/testing/selftests/bpf/test_maps.c +++ b/tools/testing/selftests/bpf/test_maps.c | |||
@@ -126,6 +126,8 @@ static void test_hashmap_sizes(int task, void *data) | |||
126 | fd = bpf_create_map(BPF_MAP_TYPE_HASH, i, j, | 126 | fd = bpf_create_map(BPF_MAP_TYPE_HASH, i, j, |
127 | 2, map_flags); | 127 | 2, map_flags); |
128 | if (fd < 0) { | 128 | if (fd < 0) { |
129 | if (errno == ENOMEM) | ||
130 | return; | ||
129 | printf("Failed to create hashmap key=%d value=%d '%s'\n", | 131 | printf("Failed to create hashmap key=%d value=%d '%s'\n", |
130 | i, j, strerror(errno)); | 132 | i, j, strerror(errno)); |
131 | exit(1); | 133 | exit(1); |