As for many C++ projects, ChirpStack Client can be built using the CMake build system. The minimum required version of CMake is 3.15. To build ChirpStack Client, use the following commands:
$ mkdir bin
$ cd bin
$ cmake ..
$ cmake --build . -- -j 8The shared libraries will be located at bin/libchirpstack_client.so and bin/libchirpstack_grpc_proto.so.
- gRPC should be installed in advance. See also: grpc-cpp.
- You might also need to copy the
grpc/third_party/googleapis/google/andgrpc/third_party/protobuf/src/google/directories to the/usr/local/include/directory beforehand.
To build ChirpStack Client with tests, use the following commands:
$ mkdir bin
$ cd bin
$ cmake -DChirpStackClient_TESTING=ON ..
$ cmake --build . -- -j 8The test binary files will be located at bin/tests/.
Before testing, you have to modify the TOML configuration file located at bin/tests/test_config.toml. Since most of the fields already have a default value, you only need to fill in 3 fields:
test.jwt_token- Using in the
application,device,device_profile,gateway,internalandmulticast_grouptests. - Can be acquired in the
Tokenfield after creating a new API key using ChirpStack Application Server web-interface.
- Using in the
test.service_profile_id- Using in the
application,device,device_profile,gateway,internalandmulticast_grouptests. - Can be acquired in the URL after creating a new service-profile using ChirpStack Application Server web-interface.
- Using in the
test.global_jwt_token- Using in the
gateway_profile,network_server,organization,service_profileandusertests. - Can be acquired in the
Tokenfield after creating a new API key using ChirpStack Application Server web-interface.
- Using in the
| Test | Tested functions | Configuration parameters |
|---|---|---|
application_test |
- create_application- get_application- update_application- delete_application- list_application |
- general.application_server- test.jwt_token- test.service_profile_id- test.application.name |
device_test |
- create_device- get_device- update_device- delete_device- list_device- create_device_keys- get_device_keys- update_device_keys- delete_device_keys- activate_device- deactivate_device- get_device_activation- get_random_dev_addr- enqueue_device_queue_item- flush_device_queue- list_device_queue_items |
- general.application_server- test.jwt_token- test.service_profile_id- test.application.name- test.device_profile.name- test.device.eui- test.device.nwk_key- test.device.app_key- test.device.address- test.device.app_s_key- test.device.nwk_s_enc_key- test.device.s_nwk_int_key- test.device.f_nwk_int_key- test.device.f_port- test.device.payload |
device_profile_test |
- create_device_profile- get_device_profile- update_device_profile- delete_device_profile- list_device_profile |
- general.application_server- test.jwt_token- test.service_profile_id- test.device_profile.name |
gateway_test |
- create_gateway- get_gateway- update_gateway- delete_gateway- list_gateway- get_gateway_stats- get_last_ping- generate_gateway_client_certificate |
- general.application_server- test.jwt_token- test.service_profile_id- test.gateway.id |
gateway_profile_test |
- create_gateway_profile- get_gateway_profile- update_gateway_profile- delete_gateway_profile- list_gateway_profile |
- general.application_server- test.global_jwt_token- test.service_profile_id- test.gateway_profile.name- test.gateway_profile.bandwidth- test.gateway_profile.frequency- test.gateway_profile.spreading_factors |
internal_test |
- login- profile- global_search- create_api_key- delete_api_key- list_api_keys- settings- open_id_connect_login- get_devices_summary- get_gateways_summary |
- general.application_server- test.jwt_token- test.service_profile_id- test.internal.admin_username- test.internal.admin_password- test.internal.api_key_name |
multicast_group_test |
- create_multicast_group- get_multicast_group- update_multicast_group- delete_multicast_group- list_multicast_group- add_device_to_multicast_group- remove_device_from_multicast_group- enqueue_multicast_queue_item- flush_multicast_group_queue_items- list_multicast_group_queue_items |
- general.application_server- test.jwt_token- test.service_profile_id- test.application.name- test.device_profile.name- test.device.eui- test.device.address- test.device.app_s_key- test.device.nwk_s_enc_key- test.device.s_nwk_int_key- test.device.f_nwk_int_key- test.device.f_port- test.device.payload- test.multicast_group.name- test.multicast_group.address- test.multicast_group.app_s_key- test.multicast_group.nwk_s_key |
network_server_test |
- create_network_server- get_network_server- update_network_server- delete_network_server- list_network_server- get_adr_algorithms |
- general.application_server- test.global_jwt_token- test.network_server.name- test.network_server.server |
organization_test |
- create_organization- get_organization- update_organization- delete_organization- list_organization- add_organization_user- get_organization_user- update_organization_user- delete_organization_user- list_organization_users |
- general.application_server- test.global_jwt_token- test.organization.name- test.organization.display_name- test.user.username- test.user.password |
service_profile_test |
- create_server_profile- get_server_profile- update_server_profile- delete_server_profile- list_server_profile |
- general.application_server- test.global_jwt_token- test.network_server.name- test.network_server.server- test.organization.name- test.organization.display_name- test.service_profile.name |
user_test |
- create_user- get_user- update_user- delete_user- list_user- update_user_password |
- general.application_server- test.global_jwt_token- test.user.username- test.user.password |
- The
network-serverandservice-profiletests require manually running a new instance of ChirpStack Network Server to reduce the effects on other existing instances. To do that, they will generate 2 bash filesstart-sample-network-server.shandstop-sample-network-server.shto thebin/tests/directory. You should follow the instruction of the tests to be able to run them correctly.
This project is licensed under the terms of the MIT license.