mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 15:18:19 +00:00
06cc43c863
Every service node defect in this change set was a generated artifact that was already wrong before any node booted: a repository file that enabled no builder repo, a template that resolved to the wrong installer, an exports line that was never written. The tests that caught them are one file per fix, so each knows one defect and together they know no defect class. A fix nobody has made yet is covered by none of them. service_node_artifacts_el.t renders the artifacts an EL service node needs from one fixture and asserts each: the builder repository per release and vendor, including that EL8 is powertools and not crb; the template the service profile resolves, which must not be a Subiquity one; and the export line for a local directory and for a re-exported mount, where an absent fsid is what made a service node export nothing. A missing module or sub fails rather than skips, and the file reports every gap instead of dying at the first, because on an unfixed tree this test is the gap report. Measured: 17 assertions pass on the branch, and the base fails two of them by name. It does not cover the boot half -- the lease, the tftp handover, the mount the installer performs -- so it replaces no end-to-end run. It replaces the 45 to 90 minutes those runs cost in the ROUNDS of a minimization. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT-test
Unit tests that run from the source checkout are split by implementation language:
| Test type | Location | Runner |
|---|---|---|
| Perl unit tests | xCAT-test/unit/*.t |
prove -r xCAT-test/unit |
| Shell unit tests | xCAT-test/bats/*.bats |
bats -r xCAT-test/bats |
| CLI functional tests | xCAT-test/autotest/testcase/ and xCAT-test/autotest/bundle/ |
xcattest -f <cluster.conf> -t <case> or xcattest -f <cluster.conf> -b <bundle> |
Use Perl .t tests for Perl modules, Perl scripts, templates, and repository
artifacts. Use BATS tests for shell-script behavior that can be exercised from
the checkout by sourcing a shell library or script and shadowing external
commands.
Shell behavior should not be tested by Perl tests that grep shell source. Put
those tests under xCAT-test/bats instead.
See unit/README.md and bats/README.md for the detailed rules for
each unit-test suite.