Added more sanitizer tests#1309
Merged
Merged
Conversation
Signed-off-by: Michael Medin <michael@medin.name>
6005f76 to
1ad3453
Compare
…ability Signed-off-by: Michael Medin <michael@medin.name>
…execution Signed-off-by: Michael Medin <michael@medin.name>
Signed-off-by: Michael Medin <michael@medin.name>
…l functions with sanitizers Signed-off-by: Michael Medin <michael@medin.name>
Signed-off-by: Michael Medin <michael@medin.name>
1ad3453 to
3c83be7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the sanitizer test surface by adding protobuf-free Lua acceptance tests (run via ctest) and by improving the Lua runtime bindings/concurrency so those tests can safely drive in-process module code paths (NRPE/NSCA/Scheduler/etc.) under ASan/UBSan/LSan. It also makes the web backend build behavior more robust by conditionally building nscp_mongoose and providing clearer CMake diagnostics when dependencies are missing.
Changes:
- Add
NSCP_ADD_LUA_TEST()and register multiplelua_*_testctests guarded by relevant module build flags. - Introduce Lua-side acceptance tests plus an updated Lua test harness (
test_helper.lua) compatible with Lua 5.4 / current NSClient++ Lua API. - Add Lua core bindings (
query_target,query_forward) and a process-wide Lua “GIL” to avoid cross-threadlua_Statecorruption, while releasing it around blocking/re-entrant core calls.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/CMakeLists.txt |
Guard mongoose wrapper tests behind TARGET nscp_mongoose; register Lua acceptance tests as *_test for sanitizer runs. |
scripts/lua/test_uptime.lua |
New Lua acceptance test for check_uptime timezone/threshold parsing behaviors. |
scripts/lua/test_selfcheck.lua |
Minimal Lua self-check script to validate unit-test harness wiring. |
scripts/lua/test_scheduler.lua |
New Lua acceptance test exercising Scheduler execution + submit path. |
scripts/lua/test_nsca.lua |
New Lua acceptance test for NSCA client/server in-process round trip. |
scripts/lua/test_nrpe.lua |
Replace old protobuf-based NRPE test with protobuf-free query_forward-based round-trip matrix. |
scripts/lua/test_nrpe_relay.lua |
New protobuf-free NRPE relay smoke test using query_target. |
scripts/lua/test_log_file.lua |
New Lua acceptance test for CheckLogFile filter engine and boundary behavior. |
scripts/lua/test_ext_script.lua |
Replace stale content with real CheckExternalScripts acceptance coverage (args/nasty char gating). |
scripts/lua/test_checks.lua |
New minimal CheckHelpers smoke test through simple_query(). |
scripts/lua/test_check_helpers.lua |
New broader CheckHelpers integration test suite (aliases, wrappers, multi, negate, timeout). |
scripts/lua/lib/test_helper.lua |
Modernize Lua test helper (no module(...), no require('nscp')), add assertions, return module table. |
modules/WEBServer/CMakeLists.txt |
Fail early with a targeted error if WEBServer is enabled but nscp_mongoose isn’t built. |
modules/LUAScript/LUAScript.h |
Add execute_script() helper declaration. |
modules/LUAScript/LUAScript.cpp |
Fix Lua runtime base path for require(); refactor CLI execution into execute_script(). |
libs/mongoose-cpp/CMakeLists.txt |
Skip building nscp_mongoose when backend deps aren’t satisfied; validate backend selection. |
libs/lua_nscp/lua_script.cpp |
Release Lua GIL around blocking core calls; add query_target/query_forward bindings. |
libs/lua_nscp/lua_core.cpp |
Add global Lua GIL and guard Lua entry points; fix submit handler argument counting. |
include/scripts/script_nscp.hpp |
Extend core provider API with targeted query and forward-query support. |
include/scripts/script_nscp.cpp |
Implement targeted simple_query(target,...) and query_forward(...) request building. |
include/scripts/script_interface.hpp |
Add core provider virtuals for targeted query and forward-query. |
include/lua/lua_script.hpp |
Expose query_target and query_forward in the Lua C API surface. |
include/lua/lua_core.hpp |
Define the process-wide Lua GIL guard/release helpers. |
CMakeLists.txt |
Remove unused ALL_LIB_NAMES accumulation. |
build/cmake/functions.cmake |
Add NSCP_ADD_LUA_TEST() helper to register Lua acceptance tests under sanitizer env. |
build/cmake/dependencies.cmake |
Make web backend dependency detection non-fatal; gate extra Boost components on availability. |
build.md |
Document that sanitizer runs include Lua acceptance tests and exclude Python tests due to ASan incompatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.