app/test: fix reentrancy autotest
The previous code in func_reentrancy autotest was doing in parallel
something close to:
name = "common_name";
do several times {
obj = allocate_an_object(name) // obj = ring, mempool, hash, lpm, ...
if (obj == NULL && lookup(name) == NULL)
return TEST_FAIL;
}
This code is not safe. For instance:
mempool_create() is called on core 0, it creates a ring. At the same
time on core 1, mempool_create() is called too and the creation of the
ring fails (EEXIST). But the mempool lookup can fail on core 1 if
the mempool is not added in the list by core 0.
This commit fixes the func_reentrancy autotest that now works with all
tested class of objects.
Fixes:
104a92bd02 ("app: add reentrancy tests")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>