Commit graph

4 commits

Author SHA1 Message Date
Snider
427929f0e9 test(ansible): Phase 1 Step 1.4 — user/group & advanced module tests
69 new tests for user (7), group (7), cron (5), authorized_key (7),
git (8), unarchive (8), uri (6), ufw (8), docker_compose (7), and
dispatch (6) modules. 9 module shims added to mock infrastructure.
Total ansible tests: 334, all passing.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:52:42 +00:00
Snider
9638e77f30 test(ansible): Phase 1 Step 1.3 — service & package module tests
56 new tests for service (12), systemd (4), apt (9), apt_key (6),
apt_repository (8), package (3), pip (8), and dispatch (7) modules.
Extended mock with 7 module shims for sshRunner interface.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:44:50 +00:00
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