Commit graph

2 commits

Author SHA1 Message Date
Snider
c7da9ad16c test(ansible): Phase 1 Step 1.2 — file operation module tests
54 new tests for copy/file/lineinfile/blockinfile/stat/template modules.
Extended mock_ssh_test.go with sshFileRunner interface and 6 module shims.
Fixed unsupported module test (copy→hostname now that copy is supported).
Total ansible tests: 208.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:39:27 +00:00
Snider
3330e55b2b test(ansible): Phase 1 Steps 1.0-1.1 — SSH mock + command module tests
Step 1.0: MockSSHClient with command registry, file system simulation,
become state tracking, execution log, upload log, and assertion helpers.
Module shims via sshRunner interface for testability.

Step 1.1: 48 tests for command/shell/raw/script modules verifying:
- command uses Run(), shell uses RunScript()
- chdir wrapping, non-zero RC, SSH error propagation
- raw passes through without shell wrapping
- script reads local file content, sends via RunScript()
- Cross-module dispatch differentiation
- Template variable resolution in args

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:31:48 +00:00