A Smoke Test That Always Says OK
After each deploy, the pipeline runs scripts/smoke.sh URL (in /home/student/repos/inventory-api) against the health endpoint. Last night it printed smoke ok while the service answered 500 to everyone; the week before, a hung server blocked the pipeline for an hour.
A fake API for experiments: /srv/lab/bin/fake-api 8080 &, then try http://127.0.0.1:8080/ok, /flaky (fails twice, then works), /degraded, /err, /html and /hang.
Fix scripts/smoke.sh URL so that:
SMOKE_TRIES times (default 10), waiting SMOKE_DELAY seconds (default 3) between tries,SMOKE_TIMEOUT seconds (default 5),200 and the body is JSON with "status": "ok"; then it stops trying and exits 0,smoke failed to stderr and exits non-zero.About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of CI/CD Pipelines in Practice. Next step: A Blue-Green Switch That Never Switches
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.