Skip to content

Commit 0663c6a

Browse files
committed
selftests/bpf: Add more test cases for LPM trie
JIRA: https://issues.redhat.com/browse/RHEL-85485 commit 04d4ce9 Author: Hou Tao <[email protected]> Date: Fri Dec 6 19:06:22 2024 +0800 selftests/bpf: Add more test cases for LPM trie Add more test cases for LPM trie in test_maps: 1) test_lpm_trie_update_flags It constructs various use cases for BPF_EXIST and BPF_NOEXIST and check whether the return value of update operation is expected. 2) test_lpm_trie_update_full_maps It tests the update operations on a full LPM trie map. Adding new node will fail and overwriting the value of existed node will succeed. 3) test_lpm_trie_iterate_strs and test_lpm_trie_iterate_ints There two test cases test whether the iteration through get_next_key is sorted and expected. These two test cases delete the minimal key after each iteration and check whether next iteration returns the second minimal key. The only difference between these two test cases is the former one saves strings in the LPM trie and the latter saves integers. Without the fix of get_next_key, these two cases will fail as shown below: test_lpm_trie_iterate_strs(1091):FAIL:iterate #2 got abc exp abS test_lpm_trie_iterate_ints(1142):FAIL:iterate #1 got 0x2 exp 0x1 Signed-off-by: Hou Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Viktor Malik <[email protected]>
1 parent 0ffa1c5 commit 0663c6a

File tree

1 file changed

+395
-0
lines changed

1 file changed

+395
-0
lines changed

0 commit comments

Comments
 (0)