Olivier Matz a7e88f1782 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>
2016-04-06 17:30:51 +02:00
..
2015-06-12 11:10:10 +02:00
2015-03-10 11:47:46 +01:00
2016-03-22 20:46:53 +01:00
2015-06-12 11:10:10 +02:00
2015-09-03 19:22:48 +02:00
2015-09-03 19:22:48 +02:00
2014-06-11 00:29:34 +02:00
2014-06-11 00:29:34 +02:00
2016-03-10 23:05:36 +01:00
2015-05-11 15:51:14 +02:00
2016-04-06 12:02:09 +02:00
2014-11-25 13:16:24 +01:00
2015-03-10 12:17:31 +01:00
2014-11-27 16:21:11 +01:00
2015-03-10 11:47:46 +01:00
2014-06-11 00:29:34 +02:00
2014-06-11 00:29:34 +02:00
2014-11-26 17:27:04 +01:00
2015-04-20 14:37:36 +02:00
2014-09-29 15:04:55 +02:00
2015-07-01 23:26:10 +02:00
2016-03-11 15:56:07 +01:00
2016-03-31 17:09:23 +02:00