Skip to main content

Testing and CI

Overview​

SST is tested with GitHub Actions in two repositories:

  • iotauth/iotauth builds Auth and runs end-to-end tests of the C, C++, Node.js, and Python entities, with a single Auth and with two Auths.
  • iotauth/sst-c-api, checked out as the entity/c submodule of iotauth, runs the C and C++ API unit tests and runs the C and C++ examples against Auth.

The two repositories call each other's workflows, so a change on either side is tested against the other. See Cross-repository testing.

Unless noted otherwise, each workflow runs on every push to main and on every pull request targeting main. The workflow files and their descriptions are in .github/workflows/ of iotauth (with a README) and .github/workflows/ of sst-c-api.

iotauth workflows​

WorkflowFileWhat it runs
Auth Server Buildmaven.ymlBuilds Auth with Maven on JDK 17 (mvn -B package --file auth/pom.xml).
Example Testsexample.ymlRuns examples/generateAll.sh to generate the credentials, configuration files, and databases of the example Auths and entities.
Entity Integration Testsintegration-test.ymlPython unit tests, the C/Node.js/Python matrix, six mixed C++ pairings against Auth101, and a Python permanent distribution-key case. See Entity integration tests.
Multi-Auth Integration Testsmulti-auth-test.ymlA Node.js, C, C++, or Python client registered with Auth101 talks to a server of the same implementation registered with Auth102. Can also be started manually. See Multi-Auth integration tests.
sst-c-api Testssst-c-api-tests.ymlCalls the ci.yml workflow of sst-c-api with this iotauth commit. See sst-c-api workflows.
sst-c-api C++ Testssst-c-api-cpp-tests.ymlCalls the ci-cpp.yml workflow of sst-c-api with this iotauth commit.
Python Formattingpython-formatting.ymlRuff lint and format checks for entity/python, on pull requests that change files under entity/python/.
CodeQLcodeql-analysis.ymlCodeQL static analysis for Java, JavaScript, and Python. Also runs weekly.

Entity integration tests​

integration-test.yml defines three jobs:

  • python-unit-tests installs the Python package in entity/python and runs its unit tests with Python 3.12.
  • integration-test runs examples/scripts/run_integration_test.sh ten times: the nine --client/--server combinations of c, node, and python, and the Python client with --permanent-distribution-key.
  • cpp-interop runs the six ordered pairs between C++ and the other three implementations. Each pair gets a fresh runner and its own Auth101. One failed pair leaves the others running. The C++-client/C++-server case runs in the separate C++ workflow. Together the workflows exercise all 16 ordered language pairs with one Auth.

Each run builds (or reuses) Auth and the entities, generates (or reuses) the example credentials, starts Auth101, starts the server, runs the client, and checks the logs for the expected messages.

In the integration-test job, the first run (C client, C server) does the full build and credential setup. If it succeeds, the later runs reuse those artifacts with --no-build --no-setup; if it fails, each later run does its own build and setup so the runs stay independent. Every run has continue-on-error, so all ten execute, and a final step fails the job if any run failed.

Multi-Auth integration tests​

multi-auth-test.yml runs examples/scripts/run_multi_auth_test.sh once for each of --entity node, c, cpp, and python. Each run:

  1. Starts Auth101 and Auth102 with the two-Auth topology of examples/configs/default.graph, in which the two Auths trust each other.
  2. Starts a net2.server entity registered with Auth102 and connects a net1.client entity registered with Auth101 to it.
  3. Checks the entity logs for the expected message exchange.
  4. Checks the Auth logs. The client's session key was issued by Auth101, so Auth102 must fetch it over the trusted-Auth channel: Auth102 logs Sending auth session key req to Auth 101, and Auth101 logs Received AuthSessionKeyReqMessage.
--entityClient and server
nodeclient.js and server.js in entity/node/example_entities, driven through their command prompts, with messages in both directions.
centity_client and entity_server in entity/c/examples/server_client_example. The client connects twice, with two session keys. The C example server always listens on port 21100.
cppentity_client and entity_server in entity/c/cpp/examples/server_client_example. The client connects twice, with two session keys. The server listens on 22100, the port of net2.server.
pythonpy_client.py and py_server.py in entity/python/examples. The client sends three messages and receives a reply to each.

For c, cpp, and python, the runner writes configs derived from the C example configs, with Auth102 and net2.server credentials for the server. As in the entity integration tests, the first run does the full setup, later runs reuse it when it succeeded, and a final step fails the job if any run failed.

sst-c-api workflows​

WorkflowFileJobs
Unit & Integration testsci.ymlC API unit tests, C examples against Auth, and the iotauth entity integration tests.
C++ Unit & Integration testsci-cpp.ymlC++ API unit tests and C++ examples against Auth.
clang-format-reviewclang-format.ymlmake format-check (clang-format --dry-run --Werror) on pull requests.

ci.yml​

  • Unit Test configures the C API with CMake, builds it, and runs ctest.
  • Integration-test checks out iotauth, builds Auth with Maven on JDK 17, generates the example credentials, and starts Auth101. It then runs, from entity/c/:
    • examples/file_block_encrypt_example: block_writer, block_reader, and block_reader_load_s_key_list.
    • examples/server_client_example: entity_server and entity_client, then threaded_get_target_id_client and threaded_get_target_id_server.
    • tests: save_load_session_key_list_with_password_test and multi_thread_get_session_key_test.
    • IPFS file sharing: installs IPFS (Kubo), regenerates credentials with configs/file_sharing.graph, and runs the C uploader and downloader and the C++ uploader and downloader in examples/ipfs_examples/ with the File System Manager, then the C secure uploader and downloader with the Secure File System Manager.
  • iotauth-integration-test calls integration-test.yml of iotauth with this sst-c-api commit. It is skipped when iotauth itself calls ci.yml.

ci-cpp.yml​

  • C++ Unit Test configures cpp/ with CMake, builds the library and its tests, and runs the six CTest executables, including the offline IPFS helper test. See Build and test the library for what each covers.
  • C++ Integration-test builds Auth, generates credentials, and starts Auth101. It then runs, from entity/c/cpp/examples/:
    • file_block_encrypt_example: block_writer and block_reader on a generated input file; block_reader compares the decrypted output with the original.
    • server_client_example: entity_server and entity_client, then threaded_get_target_id_client and threaded_get_target_id_server, from the example directory with the C example configs.
    • ipfs_examples: entity_uploader and entity_downloader with the File System Manager, then secure_entity_uploader and secure_entity_downloader with the Secure File System Manager.

Cross-repository testing​

The C and C++ APIs live in sst-c-api, but their integration tests need Auth and the example configuration from iotauth. Each repository therefore runs its tests against the other:

Triggered inCallsWithEffect
iotauthci.yml and ci-cpp.yml of sst-c-apiiotauth-ref set to the iotauth commit under testThe unit tests run on the main branch of sst-c-api. The integration jobs check out this iotauth commit with its submodule, so the C and C++ examples of the pinned sst-c-api commit run against this version of Auth and of the example configuration.
sst-c-apiintegration-test.yml of iotauthsst-c-api-ref set to the sst-c-api commit under testThe entity integration tests run on the main branch of iotauth, with this commit of the C API checked out into entity/c instead of the submodule pin.

When sst-c-api runs its own integration jobs, without an iotauth-ref input, it checks out the iotauth branch named in its iotauth-ref.txt (main by default) and replaces that checkout's entity/c with the sst-c-api commit under test. To test an sst-c-api change that depends on an unmerged iotauth change, set iotauth-ref.txt to that iotauth branch.

The multi-Auth tests always use the sst-c-api commit pinned by the iotauth submodule.

Recorded integration runs​

SST v2.1.0​

The three GitHub Actions runs below passed on November 19, 2026, on the commit tagged for the SST v2.1.0 release. A C++ client connecting to a Python server and a Python client connecting to a C++ server count as two combinations because they exercise different roles in each API.

RunCoverage on the release commit
Entity integrationWith both programs registered with Auth101, all nine client/server combinations of C, JavaScript (Node.js), and Python passed. Six more tests passed with C++ as the client or server and each of the other three programming languages in the opposite role. A further Python-to-Python test passed using a permanent distribution key.
C++ integrationThe C++ client and C++ server exchanged messages using Auth101. Together with the entity integration run, this covers all 16 combinations of client and server programming languages.
Integration across two Auth instancesFour tests passed, one per programming language. In each case the client registered with Auth101, the server registered with Auth102, and the runner verified that Auth102 retrieved the session key from Auth101.

Earlier evaluation​

On November 13, 2026, the push of iotauth revision 715e620f pinned C/C++ API revision cf95b850. The following run records show exactly which checks succeeded at that revision.

RunObserved result
Single-Auth entity integrationAll nine ordered pairs of C, Node.js, and Python passed, along with a Python-to-Python run using a permanent distribution key for the client.
Two-Auth integrationThe Node.js, C, C++, and Python same-language pairs all passed. Each run checked peer messages, Auth102's lookup and response, and Auth101's receipt of the request.
C/C++ API repository’s C++ workflowThe C++ workflow passed its C++ unit tests and its examples, including the C++ client connecting to the C++ server through Auth101.

The later six mixed C++ cases were also exercised locally against Auth101 with the extended integration runner. The November 13 records above identify the coverage of that historical revision.

The two-Auth runner keeps the client language and server language the same. A mixed-language pair across two Auths needs its own test.

Running the tests locally​

The end-to-end runners live in examples/scripts/ of iotauth and are documented in its README. From the iotauth repository root:

cd examples/scripts
./run_integration_test.sh --client cpp --server python
./run_integration_test.sh --client python --server cpp
./run_multi_auth_test.sh --entity cpp

Both runners build Auth and generate the example credentials by default; pass --no-build --no-setup to reuse existing artifacts. The setup regenerates the example credentials with the runner's password (1234 unless --password is given). Other useful options include --keep-logs, --stop-existing to stop processes still holding the test ports, and, for run_integration_test.sh, --tmux to watch Auth, the server, and the client in tmux panes.

For the C++ unit tests, see Build and test the library. The C++ example commands that CI runs are listed in the C++ Guide and the server/client example.

Adding a CI test​

  1. Put end-to-end test logic in a script under examples/scripts/ that sources common.sh for the shared helpers (building, credential setup, starting and waiting for services, and log assertions), so the test runs the same way locally and in CI.
  2. Add a workflow under .github/workflows/ that runs the script, following integration-test.yml and multi-auth-test.yml: the first run does the build and setup, later runs reuse them, every run uses continue-on-error, and a final step fails the job if any run failed.
  3. Add the workflow to the table in .github/workflows/README.md and on this page.