aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant FindServers step from cert_bootstrap testThomas Vanbesien33 hours1-24/+10
|
* Rename client executable to bobink_opcua_clientThomas Vanbesien34 hours3-9/+9
|
* Refactor: reduce duplication and tighten helpersThomas Vanbesien34 hours4-107/+65
| | | | | | | | | - Remove redundant applicationUri log in print_application_description - Use UA_SECURITY_POLICY_NONE_URI macro instead of hardcoded string - Extract _s_register_with_lds / _s_deregister_from_lds helpers - Rename signal handler param 'sign' to 'sig' for consistency - Add INT_MIN/INT_MAX bounds check to config_require_int - Extract shared test helpers into tests/test_helpers.sh
* Rename CMake project and executable targetsThomas Vanbesien34 hours3-19/+19
| | | | | | | Project: OpcUaC → BobinkOpcUaC Targets: ServerLDS → bobink_opcua_discovery_server, ServerRegister → bobink_opcua_server, Client → client
* Add TOFU certificate bootstrap integration testThomas Vanbesien35 hours18-0/+218
| | | | | | | | | Make download-cert always use an unsecure client so it can connect to a server's None discovery endpoint without the server certificate in the trust store. Add a cert_bootstrap test that verifies the full Trust On First Use workflow: find-servers succeeds, get-endpoints fails (untrusted cert), download-cert retrieves the certificate via None, then get-endpoints and read-time both succeed.
* Move certificates into per-test directoriesThomas Vanbesien35 hours50-75/+38
| | | | | | | | Each secure test now has its own certs/ subfolder with per-identity subdirectories and a single shared trust store. Configs reference paths relative to the project root (e.g. tests/secure_anonymous/ certs/ServerLDS/cert.der). Cert generation logic removed from test scripts since certs are now pre-generated and committed.
* Add download-cert client operation with integration testThomas Vanbesien36 hours1-0/+114
| | | | | | Retrieves the server's DER certificate via GetEndpoints and writes it to a local file. The test starts a secure ServerLDS, downloads its certificate, and verifies it matches the original.
* Remove redundant config/ dir, use Aes256_Sha256_RsaPss everywhereThomas Vanbesien36 hours6-6/+6
| | | | | | | The config/ example files duplicated the test configs. Remove them and point the Running docs at tests/secure_user/ instead. Switch the security policy from Basic256Sha256 to Aes256_Sha256_RsaPss in all test configs, CMakeLists.txt, and readme.md.
* Add X509 certificate identity token authenticationThomas Vanbesien36 hours4-0/+52
| | | | | | | | Support authMode=cert alongside anonymous and user. The client reuses its application certificate as the X509 identity token (open62541 requires both to match). Server-side access control advertises the certificate token policy automatically when sessionPKI is configured.
* Extract createUnsecureClientConfig, fix None endpoint negotiationThomas Vanbesien37 hours3-13/+2
| | | | | | | | | | | | UA_ClientConfig_setDefault leaves securityMode at SignAndEncrypt, so unsecure clients failed endpoint negotiation when the LDS only offered None endpoints. Extract the unsecure client setup into createUnsecureClientConfig() which explicitly sets securityMode and securityPolicyUri to None. Also enable discovery-only None endpoint on ServerRegister so unencrypted clients can discover it, and update the unsecure_anonymous test configs to run fully without encryption.
* Add None endpoint so unsecure clients can discover secure serversThomas Vanbesien41 hours1-4/+0
| | | | | | | | | | UA_ServerConfig_addSecurityPolicyNone only adds the security policy, not an endpoint entry. Without a None endpoint in the GetEndpoints response, the open62541 client's internal endpoint negotiation fails with BadIdentityTokenRejected before the FindServers request is sent. Adding the endpoint via UA_ServerConfig_addEndpoint makes the None endpoint visible; securityPolicyNoneDiscoveryOnly still restricts it to discovery services only.
* Make client/server encryption optional, rename tests to full namesThomas Vanbesien42 hours23-142/+64
| | | | | | | | | | | | | | | | | | | Make encryption optional for both ServerRegister's LDS client connection and the server side of ServerLDS/ServerRegister: when certificate, privateKey, and trustStore are omitted the programs run with SecurityPolicy#None only. Secure servers also add a discovery-only None endpoint so unencrypted clients can still call FindServers and GetEndpoints. Consolidate tests from 5 policy-specific cases (nosec_anon, none_user, basic256sha256_anon, aes256_anon, aes128_user) down to 3 that cover the important axes: unsecure_anonymous, secure_anonymous, secure_user. Rename directories to use full names. Auto-generate certificates and trust stores in run_test.sh. Update readme and CLAUDE.md to reflect the current program interface (unified Client binary, split ServerRegister configs) and the new test names.
* Rename ClientFindServers certificate identity to ClientThomas Vanbesien47 hours5-15/+15
| | | | | | The unified client program is no longer just for FindServers. Regenerated the certificate as "Client" and updated all configs, trust store symlinks, readme, and script comments.
* Standardize config file section ordering, list operations in usageThomas Vanbesien48 hours20-38/+58
| | | | | | | Group config keys into sections separated by blank lines: identity, encryption (certificate/privateKey/trustStore), security mode, auth. Program-specific keys (cleanupTimeout, registerInterval) go last. Show available operations in Client usage message.
* Add aes256_anon test, expand readme certificate sectionThomas Vanbesien2 days4-0/+44
| | | | | | Create test configs for SignAndEncrypt / Aes256_Sha256_RsaPss with anonymous auth. Expand the readme certificate section with an identity table and clearer trust store explanation.
* Remove none_anon test, make nosec_anon fully unsecuredThomas Vanbesien2 days5-48/+0
| | | | | | none_anon was redundant — nosec_anon now covers the unsecured case with both LDS and ServerRegister running without security config. Update readme test table to reflect the change.
* Make LDS security config optional, add nosec_anon testThomas Vanbesien2 days4-0/+42
| | | | | | | | | | | | | ServerLDS and ServerRegister can now run without encryption when certificate, privateKey, and trustStore are all omitted from the server config file. When any of the three is present, all three are still required. The unsecured server uses UA_ServerConfig_setMinimal with SecurityPolicy#None only. Add nosec_anon integration test covering the LDS unsecured path. Update readme: use symlinks instead of copies for trust stores, note that ServerLDS and ServerRegister support running without certs.
* Update certificate generation: keep intermediate files, fix URI formatThomas Vanbesien2 days17-18/+18
| | | | | | | | Stop deleting intermediate PEM and CNF files so they can be reused. Change default application URI from urn:bobink.<name> to urn:localhost:bobink:<name> to follow proper URN syntax (Qt OPC UA rejects the dotted format). Update all config files and test configs to use the new URI format.
* Replace ClientFindServers with unified Client, use trust store directoriesThomas Vanbesien3 days27-310/+180
| | | | | | | | | | | | | | | | | | | | | | Replace the single-purpose ClientFindServers program with a unified Client that supports three operations via CLI: find-servers, get-endpoints, and read-time. This simplifies the architecture by using one client binary with a single config file instead of a monolithic program that did everything in one run. Split the ServerRegister config into separate server and client config files so the LDS-registration credentials are isolated from the server's own settings. The discovery URL moves from config to a CLI argument. Replace repeated trustList config entries with a single trustStore directory path. Each program now points to a directory under certs/trust/ containing .der files, so adding or removing trust is a file-copy operation rather than editing every config file. Add loadTrustStore()/freeTrustStore() to common.c and remove the now-unused configGetAll() from the config parser. Simplify the test matrix from 6 to 4 cases (security and auth are orthogonal, so the full 3x2 matrix is unnecessary). Update run_test.sh to invoke the new Client three times and use port-polling instead of sleep.
* Decouple LDS and server clients in ClientFindServersThomas Vanbesien3 days6-54/+96
| | | | | | | | | | | | | Create two independent UA_Client instances in client_find_servers.c: one for LDS discovery calls (FindServers, GetEndpoints) and one for server session calls (readServerTime). This allows different security modes, policies, auth, and trust lists for the LDS vs discovered servers. Config keys are now prefixed: discovery* for LDS connection settings, server* for discovered server settings. All config files updated accordingly with split trust lists (discoveryTrustList for LDS cert, serverTrustList for server cert).
* Add configurable log level as optional CLI argumentThomas Vanbesien3 days1-23/+23
| | | | | | | | | All three programs now accept an optional second argument [log-level] (trace, debug, info, warning, error, fatal) defaulting to info. The level is applied by setting the logger context pointer directly, avoiding a memory leak that would occur from overwriting the heap-allocated logger struct. Also documents the ASan leak-check workflow in CLAUDE.md.
* Replace CLI arguments with config-file parser and add integration testsThomas Vanbesien3 days19-0/+412
Introduce a reusable key=value config parser (config.h/c) and convert all three programs to read their settings from config files instead of positional command-line arguments. Add example config files in config/ and 6 CTest integration tests covering None/Basic256Sha256/Aes128 with anonymous and user authentication. Remove the now-obsolete launch.sh.