This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ncs, zephyr ztest + zigbee subsystem

I want to implement integration tests of the ZigBee subsystem on nrf52 and looking for a way to launch them by CI script.
We need such a feature for automatic testing after hardware assembly.
My first problem is that when adding CONFIG_ZTEST to prj.conf in my working project, I get 'ncs/nrf/subsys/zigbee/osif/zb_nrf_platform.c:139:15: error: too many arguments to function 'zb_schedule_app_callback'' error.
Can tell me what am I doing wrong?
Second thing is that the tests will be split into client / server side and I want to run them on dedicated client / server hardware.
Is there any way to run them on bulk?

I was thinking about running them with sanity check one by one running pairs of client + server test cases. Is there a better way to do this?

  • Hi,

    Sorry for the late reply.

    Which version of NCS are you using? Did you make any other changes besides adding CONFIG_ZTEST=y to prj.conf? Ztest has been used successfully with Zigbee before, and I'm not sure what might cause the problem. I'll ask the Zigbee team internally about this and come back to you. Please be aware that we are short staffed due to holiday season, so it might take some time before I get a response from them.

    Best regards,

    Marte

  • Hi,

    I got a reply from the Zigbee team now. They were unable to reproduce the issue, and the API for the zb_schedule_app_callback has not changed in NCS. 

    There is one functionality that one may not be aware of: the ZB_SCHEDULE_APP_CALLBACK macro is overridden by the zb_osif_platform.h file to resolve to the NCS-specific variant: zigbee_schedule_callback, which allow us to call the ZBOSS scheduler API from interrupt as well as other thread contexts.

    It would be good to know what it is you want to achieve:

    1. Is it about mocking ZBOSS API?
    2. Testing pieces of ZBOSS API using the fully functional library?
    3. Running full samples on HW?

    There are a few tests, written for testing ZBOSS OSIF implementation, that use ZTEST. You can take a look at them to get a good, working starting point. They are located under "nrf/tests/subsys/zigbee". The "zboss_api" subdirectory implements tests described in the 2nd case and the "osif" implements the 1st case.

    Best regards,

    Marte

Related