CI smoke tests and maintenance
Quick answer
Continuous integration (CI) runs repeatable checks on changes. A smoke test exercises a small, essential behavior to detect obvious failures quickly.
A smoke test should fail when an essential behavior breaks: for a report service, check both the response and expected report content. Add a deliberately invalid fixture to prove the test rejects errors; a green pipeline alone is not proof of production readiness.
Prepare the practice environment
Run python3 lab-fixtures/automation/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not modify system services. Review the lab guide.
Prerequisites
Review: Ansible and cloud-init orientation.
How it works
Order checks from inexpensive to realistic: syntax, configuration schema, fixture behavior, then an authorized integration or staging health test. Fail the pipeline on a failed required check, preserve non-sensitive evidence and use explicit deadlines. A successful smoke test does not prove complete correctness. Maintenance needs an inventory, an approved change window, backups, staged rollout, recovery access and verification; avoid concurrent conflicting jobs. The fixture script accepts only ready as success. The negative test deliberately supplies not-ready and checks the exit code rather than treating an expected failure as a broken test. Real CI should use isolated runners, limited credentials and pinned reviewed dependencies.
Try the examples
Syntax checking does not execute the script.
Expected stdout:
syntax passedThe script checks its argument and emits a stable success message. No network or service is used.
Expected stdout:
smoke passedif bash smoke.sh not-ready > /dev/null; then exit 1else test "$?" -eq 3 printf 'failure detected\n'fiThe negative test verifies exit status 3 specifically. Run in a fresh Bash process so exit cannot close your interactive shell.
Expected stdout:
failure detectedCommon mistakes
Do not ignore failing tests, print secrets in logs or treat one passing smoke test as permission for a fleet-wide rollout.
Practice
Run syntax, positive and negative checks in fresh processes. Propose a maintenance checklist with one rollback trigger and a post-change verification.
Related references
Study: bash, curl. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
CI smoke tests and maintenance — Knowledge Check
Apply configuration management concepts to synthetic fixtures and VM-only scenarios.
What should a smoke test cover?
What does bash -n do?
Why include a negative test?
What is needed before maintenance rollout?