Repository navigation
Add end-to-end tests for whitelist_modules exec-dispatch dichotomy - #70778
Merged
dwoz merged 2 commits intoNov 13, 2026
Merged
Conversation
Verify the user-facing behavior of the two-loader model from saltstack#69983 (VCOPS-90587): - SLS-authored `module.run: <mod>.<fun>` is wire-filtered; dispatch to a non-whitelisted exec module fails with `result: False` and a `"<mod>.<fun> is not available"` comment. - A whitelisted function under `module.run` still succeeds, proving the whitelist is the discriminator (not some incidental breakage). - A shipped state's internal `__salt__[<mod>.<fun>]` dispatch is NOT gated: the `cmd.run` state runs `/bin/true` successfully even when `cmd` is absent from `whitelist_modules`, because state modules get the unfiltered inner loader as `__salt__`. All three tests exercise `State.call_high` end-to-end rather than introspecting the loader pack -- the existing suite covers plumbing; these cover the observable result.
dwoz
force-pushed
the
dwoz/test/whitelist-modules-exec-dispatch
branch
from
November 13, 2026 06:41
23fc259 to
d16c74f
Compare
twangboy
approved these changes
Nov 13, 2026
This branch was previously deployed
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
Verifies the user-facing behavior of the two-loader
whitelist_modulesmodel from #69983 (VCOPS-90587) — specifically, what happens when an SLS tries to invoke an execution module that isn't on the whitelist.The existing suite covers the loader plumbing (which packed loader a state module sees as
__salt__, that_wire_salt()returns the gated loader, etc.). These new tests exerciseState.call_highend-to-end and observe the chunk result dicts, which is what users actually see.Three cases, all under a narrow
whitelist_modulesfixture that deliberately excludescmd:test_module_run_rejects_non_whitelisted_exec— SLSmodule.run: cmd.runreturnsresult: Falsewith"cmd.run is not available"in the comment.test_module_run_allows_whitelisted_exec— counterpart;module.runof a whitelisted function (test.ping) succeeds. Proves the whitelist is the discriminator, not some incidentalmodule.runbreakage.test_shipped_state_reaches_non_whitelisted_exec— thecmd.runstate runs/bin/truesuccessfully even thoughcmdis not whitelisted, because the state module's packed__salt__is the unfiltered inner loader. Skipped on Windows.Test-only; no production code change.
Test plan
pytest tests/pytests/functional/loader/test_state_whitelist_dunder.py— 11/11 pass locally (8 existing + 3 new) againstorigin/3008.x