Skip to content

Harden and repair the acceptance suite - #172

Open
hcaballero2 wants to merge 2 commits into
masterfrom
acceptance-hardening
Open

Harden and repair the acceptance suite#172
hcaballero2 wants to merge 2 commits into
masterfrom
acceptance-hardening

Conversation

@hcaballero2

@hcaballero2 hcaballero2 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Acceptance-suite hardening, split out of the original combined PR #168 per review feedback.

  • 00_default_spec.rb: add a noop convergence check (catch_changes + noop) after idempotency in both the bare-include and full-config contexts, to catch resources that report spurious pending changes under noop.
  • 05_schedule_spec.rb: repair the schedule suite. ~23 assertions were written as expect { X.to eq Y } (a block passed to expect with no matcher chained — always passes silently and asserts nothing); they are now expect(X).to eq Y. Three crontab checks additionally had a .strip to eq typo (missing ).to) and are corrected. Pin aide::minute => 22 in the root/etc contexts so the hardcoded '22 4 * * 0' crontab expectations and the sed-based drift test are deterministic (the module default is fqdn_rand(59)).
  • Relax the puppet_aide.timer and puppet_aide.service enable assertions in cron modes: assert only the deterministic guarantee (ensure => stopped). Both units ship no [Install] section, so they are staticsystemctl disable is a no-op on a static unit and Puppet's systemd provider always reports enable => 'true' (is-enabled exits 0), so the enable => 'false' assertions can never pass regardless of module code (this is the AlmaLinux 9/10 acceptance failure). The module-side fix (give the timer an [Install] section so enable becomes enforceable) is tracked in Switching aide scheduling from systemd to cron stops but does not disable puppet_aide.timer #169.

Branches off master; independent of the AGENTS.md and rspec PRs (linked below).

Related PRs (split from #168)

🤖 Generated with Claude Code

- 00_default_spec.rb: add a noop convergence check (catch_changes + noop)
  after idempotency in both the bare-include and full-config contexts, to
  catch resources that report spurious pending changes under noop.
- 05_schedule_spec.rb: repair the schedule suite. ~23 assertions were
  written as `expect { X.to eq Y }` -- a block passed to expect with no
  matcher chained, which always passes silently and asserts nothing; they
  are now `expect(X).to eq Y`. Three crontab checks additionally had a
  `.strip to eq` typo (missing `).to`) and are corrected. Pin
  aide::minute => 22 in the root/etc contexts so the hardcoded
  '22 4 * * 0' crontab expectations and the sed-based drift test are
  deterministic (the module default is fqdn_rand(59)).
- Relax the puppet_aide.timer enable assertions in cron modes: assert only
  the deterministic guarantee (`ensure => stopped`), since systemd::timer
  does not reliably disable an already-enabled timer (stopped-but-enabled,
  no drift). Tracked for a proper module-side fix in #169.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The root/etc "does not have puppet_aide.service loaded" examples asserted
`enable => 'false'`, but the oneshot unit -- like the timer -- has no
[Install] section, so it is static: `systemctl disable` is a no-op on a
static unit and Puppet's systemd provider always reports `enable => 'true'`
(is-enabled exits 0). The assertion can never pass regardless of module
code, which is the AlmaLinux 9/10 acceptance failure.

Relax both service examples to the deterministic guarantee
(`ensure => 'stopped'`), matching the timer examples, and correct the
root-mode timer NOTE which mis-described the unit as an "already-enabled
timer" rather than static. The module-side fix (give the timer an
[Install] section so `enable` becomes enforceable) is tracked in #169.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants