golioth / golioth-zephyr-sdk

Golioth SDK For Zephyr
https://www.golioth.io
Apache License 2.0
67 stars 19 forks source link

tests: lightdb: add basic LightDB GET tests #301

Closed mniestroj closed 1 year ago

mniestroj commented 1 year ago

Add tests that verify successful retrievement of LightDB values. For simplicity just string values were used, so that there is no reordering issue of keys within a structure (server can decide to return structures with keys being ordered differently than what was set using goliothctl).

When application runs, it expects specific values at specific LightDB paths. Those values are compared with values embedded as C arrays and generated from resources/ directory. In order to make this test work properly, those values can be automatically set using scripts/golioth-setup.sh script, which uses goliothctl underneath.

The general idea is to run this test application from within Zephyr's twister tool. In order to make it work, credentials and server information (if self-hosted server is used) need to be provided to build process. This is achieved by Kconfig project-specific default values, which are fetched from environment variables if they exist.

At this point only qemu_x86 platform was tested when building and running standalone, as well as from within twister. However, other platforms might be supported as well, if network_setup() function (in main.c) would be expanded to setup network.

This is a reopen of #273 (closed automatically by GitHub).

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit 4cab41e):

https://golioth-zephyr-sdk-doxygen-dev--pr301-tests-lightdb-vdy4vmtn.web.app

(expires Fri, 14 Oct 2022 23:58:58 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit f3ef38f):

https://golioth-zephyr-sdk-doxygen-dev--pr301-tests-lightdb-2zrcer83.web.app

(expires Mon, 24 Oct 2022 21:12:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a389eefadf4b4b68a539327b3459dd66c142cf49