Library Testing - niclabs/dtc GitHub Wiki

The dtc library tests require to have installed the following software:

The DTC project includes two test types:

dns-tools

This test is in /tests/dns-tools/, and includes a Docker Compose configuration with five DTC ZMQ nodes, used for signing a DNSSEC zone with dns-tools.

To run the integration test, run ./tests/dns-tools/test.sh. This test tries to sign the example.com zone shown in tests/dns-tools/dtc/example.com. The standard output of the command will show the output sent by the nodes (node1,node2,node3,node4,node5) and the client. The system is working correctly if after launching the nodes (5-10 minutes) the client achieves to sign example.com, showing a message reporting that on standard output.

When the previous situation happens, you can kill the execution of the script without problems, sending an interruption.

pkcs11-test

This test is located in tests/pkcs11-test and is used to check that the PKCS11-compatible library uses properly its API.

The tests are borrowed from the Go PKCS11 Library, modifying some paths to use the dtc.so library.

To execute this tests, first you need to compile the shared object and start the dockered nodes, executing ./tests/pkcs11-test/test.sh on the project root file.

Finally, you need to execute the tests. This can be accomplished executing go test github.com/niclabs/dtc/v3/tests/pkcs11-test. on a separate terminal.

If all the tests pass, the library is well compiled.

When the previous situation happens, you can kill the execution of the first script without problems, sending an interruption.