Repository navigation
Guard access control dependent tests when OPENDAQ_ENABLE_ACCESS_CONTROL is OFF - #40
Merged
Merged
Conversation
…OL is OFF With access control disabled in openDAQ the permission manager grants every request, so tests asserting a denial cannot pass. Compile them only when access control is enabled: - Tms*Test.Permissions in opcuatms_server tests - AsseccPTest.* in opcuatms_server test_tms_user_access.cpp - TmsUserAccessTest.Anonymous/CommonUser/CommonUserForRootDevice and all TmsUserAccessPTest cases except CommonChecks in the integration tests Authentication tests (connect/login) are unaffected and stay enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JakaMohorko
requested review from
JakaMohorko
and removed request for
denise-opendaq
September 30, 2026 05:22
JakaMohorko
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When openDAQ is built with
OPENDAQ_ENABLE_ACCESS_CONTROL=OFF, the permission manager is a stub that grants every request, so tests that assert an access denial cannot pass. This compiles those tests only when access control is enabled:Tms*Test.Permissionsin theopcuatms_servertests (channel, DAQ server component, device, function block, input port, property, property object, signal, value)AsseccPTest.*and its instantiation inopcuatms_server/tests/test_tms_user_access.cpptests/opcuatms_integration/test_tms_user_access.cpp:TmsUserAccessTest.Anonymous,CommonUser,CommonUserForRootDevice, and allTmsUserAccessPTestcases exceptCommonChecksAuthentication tests (
ConnectAnonymousNotAllowed,ConnectionPTest.UserConnectTest,CreateClientDevice,CommonChecks) do not depend on permissions and stay enabled.OPENDAQ_ENABLE_ACCESS_CONTROLis a public compile definition of openDAQ'scoreobjects, so it reaches these test targets through their openDAQ dependencies.Testing
Built openDAQ (full preset, Debug, MSVC, Ninja) with this module twice, once with access control OFF and once ON:
test_opcuatms_serverandtest_opcuatms_integration; with the change they are compiled out and both binaries pass.The companion openDAQ change is openDAQ/openDAQ#1329.
🤖 Generated with Claude Code