mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-25 09:14:05 +00:00
888698e384
genesis_ubuntu_build_root.t cut REQUIRED_PACKAGES out of builddeb-genesis-base with a regex and evaluated it through bash -c. It then matched the apt-cache fallback calls as text. Reformatting the script broke it, and a wrong choice between renamed packages passed it. genesis_payload_verification.t ran the verifier script and parsed its stderr. genesis_ubuntu_build_root.t now calls required_packages() with a chosen set of carried packages and asserts the exact result: the amd64 extras, the name picked for each renamed package, the order apt is asked, tzdata-legacy, and the error for a release that carries neither name. It reads the mandatory commands from XCAT::GenesisPayload, the code the build uses. genesis_payload_verification.t calls the XCAT::GenesisPayload functions with chosen payload trees and asserts the exact missing paths and results. 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.