On 21 November 2014 16:25, Taras Kondratiuk <taras.kondrat...@linaro.org>
wrote:

> On 11/21/2014 03:44 PM, Ciprian Barbu wrote:
>
>> On Fri, Nov 21, 2014 at 1:31 PM, Taras Kondratiuk
>> <taras.kondrat...@linaro.org> wrote:
>>
>>> On 11/20/2014 09:02 PM, Ciprian Barbu wrote:
>>>
>>>>
>>>> Signed-off-by: Ciprian Barbu <ciprian.ba...@linaro.org>
>>>> ---
>>>> The testcases are based almost entirely on the odp_example.
>>>> There are no alloc tests and I added a test case for
>>>> odp_schedule_wait_time.
>>>> The major differencs between the odp_example and this cunit is the
>>>> partition
>>>> into testcases, the odp_example calls every test case from one big
>>>> function.
>>>>
>>>> I had to work some magic in order to be able to pass arguments to test
>>>> cases,
>>>> I hope is not too hard to follow.
>>>>
>>>>    configure.ac                                  |   1 +
>>>>    test/cunit/Makefile.am                        |   2 +
>>>>    test/cunit/schedule/Makefile.am               |  10 +
>>>>    test/cunit/schedule/odp_schedule_test.c       | 844
>>>> ++++++++++++++++++++++++++
>>>>    test/cunit/schedule/odp_schedule_testsuites.c |  35 ++
>>>>    test/cunit/schedule/odp_schedule_testsuites.h |  21 +
>>>>    6 files changed, 913 insertions(+)
>>>>    create mode 100644 test/cunit/schedule/Makefile.am
>>>>    create mode 100644 test/cunit/schedule/odp_schedule_test.c
>>>>    create mode 100644 test/cunit/schedule/odp_schedule_testsuites.c
>>>>    create mode 100644 test/cunit/schedule/odp_schedule_testsuites.h
>>>>
>>>> diff --git a/configure.ac b/configure.ac
>>>> index fcd7279..a47db72 100644
>>>> --- a/configure.ac
>>>> +++ b/configure.ac
>>>> @@ -173,6 +173,7 @@ AC_CONFIG_FILES([Makefile
>>>>                   test/Makefile
>>>>                   test/api_test/Makefile
>>>>                     test/cunit/Makefile
>>>> +                 test/cunit/schedule/Makefile
>>>>                   pkgconfig/libodp.pc])
>>>>
>>>>    AC_SEARCH_LIBS([timer_create],[rt posix4])
>>>> diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
>>>> index 439e134..b6033ee 100644
>>>> --- a/test/cunit/Makefile.am
>>>> +++ b/test/cunit/Makefile.am
>>>> @@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
>>>>    AM_CFLAGS += -I$(CUNIT_PATH)/include
>>>>    AM_LDFLAGS += -L$(CUNIT_PATH)/lib -static -lcunit
>>>>
>>>> +SUBDIRS = schedule
>>>> +
>>>>
>>>
>>>
>>> Don't create a separate makefile, so all test binaries will be the same
>>> directory.
>>>
>>
>> Did you get that feedback on private? I don't see it in the comments.
>> Anyway, I can drop the extra Makefile no problem.
>>
>
> Anders complained that 'make check' has some issues with this. And I've
> noticed that Alex have changed Crypto tests in this way.
>
>
>>
>>>     if ODP_CUNIT_ENABLED
>>>>    TESTS = ${bin_PROGRAMS}
>>>>    check_PROGRAMS = ${bin_PROGRAMS}
>>>>
>>>
>>>
>>>  +
>>>> +struct CU_TestInfo schedule_tests[] = {
>>>> +       _CU_TEST_INFO(schedule_wait_time),
>>>> +       _CU_TEST_INFO(schedule_one_single_lo),
>>>> +       _CU_TEST_INFO(schedule_single_lo),
>>>> +       _CU_TEST_INFO(schedule_one_many_lo),
>>>> +       _CU_TEST_INFO(schedule_many_lo),
>>>> +       _CU_TEST_INFO(schedule_multi_lo),
>>>> +       _CU_TEST_INFO(schedule_one_single_hi),
>>>> +       _CU_TEST_INFO(schedule_single_hi),
>>>> +       _CU_TEST_INFO(schedule_one_many_hi),
>>>> +       _CU_TEST_INFO(schedule_many_hi),
>>>> +       _CU_TEST_INFO(schedule_multi_hi),
>>>> +       CU_TEST_INFO_NULL,
>>>> +};
>>>>
>>>
>>>
>>> schedule_one() will be dropped, so these tests also can be dropped.
>>>
>>
>> Yes I know I had to drop them. I kept them in for this RFC for easy
>> comparison against odp_example
>>
>>
>>> I think odp_example is not a good base for scheduler tests. It was
>>> written as benchmark, but not as a verification test.
>>>
>>
>> That's actually not the feedback I got from Mike, correct me if I'm wrong.
>>
>
> My main concerns about odp_example:
> - it does millions of iterations which is not necessary for functional
> verification (at least for basic).
> - it makes wrong assumption about scheduler fairness.
> - it doesn't check main functional features mentioned in a quote below.
>
> It would be better to start from scratch, that try to modify
> odp_example.
>
> I imagine basic scheduler testing in following steps:
> 1. One queue, single thread. odp_schedule() return all enqueued buffers.
>    Test each queue type (PARALLEL, ATOMIC, ORDERED).
> 2. Many queues, single thread. odp_schedule() return all enqueued
>    buffers. Verify buffer source queue. Test each queue type.
> 3. Queues with different priorities, single thread. odp_schedule()
>    return all buffers according to queue priorities. Test each queue
>    type.
> 4. Same as 3 but multi-threaded.
> 5. One ATOMIC queue, several threads. Verify that only one thread at a
>    time can get a buffer from that queue.
> 6. Same as 5, but use odp_schedule_release_atomic() and check that one
>    more thread could get an event. That is an optional test, because
>    odp_schedule_release_atomic() is a hint and may be ignored by
>    platform.
> 7. Two queues one of them ORDERED, several threads. Verify that buffers
>    scheduled from ORDERED queue are enqueue into the second queue in
>    correct order.
>
I think you meant "Verify that buffers scheduled from ORDERED queue are
_dequeued_ from the second queue in the correct order".

> 8. Test scheduler timeout APIs.
>
>
>
>
>>
>>> Basic scheduler tests are missing:
>>> - verify that priority works correctly.
>>> - verify that atomicity works correctly for ATOMIC queues.
>>> - verify order for ORDERED queues.
>>>
>>
>> That's good input, thank you.
>>
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to