ell: unit tests: sharing memory
Matthieu Baerts <[email protected]> Mon, 10 Feb 2025 15:29:59 +0100
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Organization | NGI0 Core |
| Message-ID | <[email protected]> |
Hi Marcel,
Thank you for maintaining and developing ELL!
After some recent changes on ELL side in the Git repository, it is no
longer possible to get mptcpd unit tests passing.
It looks like it is due to commit e0628c4 ("test: Run all test cases in
a forked process to catch exit signals") [1].
On mptcpd side, one series of tests [2] needs to have some shared data
between subtests, e.g. one subtest get an ID from the kernel, and other
subtests will use it later on. Such shared data are currently written in
the "user_data" passed to l_test_add(). There are also some counters in
global variables. Now that each test is executed in a dedicated forked
process, all of this no longer works. Is there a recommended way
specific to ELL to fix this? Or a way to avoid the fork?
I was thinking about using a shared memory with mmap(), but I don't know
well the unit test interface, maybe there is something dedicated to
that, or maybe the breakage was not supposed to happen?
[1] https://git.kernel.org/pub/scm/libs/ell/ell.git/commit/?id=e0628c4
[2] https://github.com/multipath-tcp/mptcpd/blob/main/tests/test-commands.c
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.