[RFC PATCH 0/4] [PIDNS] Trie and pidns-cache tests
Ákos Uzonyi
uzonyi.akos at gmail.com
Thu Aug 13 15:32:38 UTC 2020
From: Uzonyi Ákos <uzonyi.akos at gmail.com>
In the last series, while refactoring trie I introduced a bug (tries with 64
bits key were returning 0 always), which caused pidns cache not working. The
first patch in this series fixes it. Also ns_id_size was wrong, which is fixed
by the second patch.
The last two patches add tests, so these bugs are caught by the test suite. The
first one checks whether pidns tranlsation is fast enough (executes 200 getpid
calls, and expects it to complete under 1s). The second one (which is not yet
complete) check whether trie_get is returning the expected value.
The reason I'm sending it is to have some feedback whether you like the
approach to these (little bit odd) tests. In the first one, I'm not sure if
it's OK to use 200 for SYSCALL_COUNT, which is based on my system's
performance. In the second one is it's OK to add ../trie.c ../trie.h to
libtests_a_SOURCES?
Ákos Uzonyi (4):
Fix trie
Fix ns_id_size
Test pidns translation cache
Add test for trie
pidns.c | 2 +-
tests/.gitignore | 2 ++
tests/Makefile.am | 5 ++++
tests/pidns-cache.c | 29 +++++++++++++++++++++
tests/pidns-cache.test | 23 +++++++++++++++++
tests/trie.c | 57 ++++++++++++++++++++++++++++++++++++++++++
tests/trie.test | 12 +++++++++
trie.c | 10 +++++---
8 files changed, 136 insertions(+), 4 deletions(-)
create mode 100644 tests/pidns-cache.c
create mode 100755 tests/pidns-cache.test
create mode 100644 tests/trie.c
create mode 100755 tests/trie.test
--
2.28.0
More information about the Strace-devel
mailing list