2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-22 02:12:16 +00:00
Files
xcat-core/xCAT-test
Daniel Hilst f93367daae test(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh into initqueue/online, but mkinitrd_dracut in the Ubuntu
genimage copies a fixed file list into 97xcat, and that list does not
name xcat-online.sh. The stateless image gets no initrd and no kernel,
so nodeset fails and the node never boots.

This commit moves the copy into imgutils::stage_dracut_module, with the
same file list, so a unit test can call it. The test stages each mode
from the source tree and checks that every file the staged install
script gives to inst_hook is in the module. It fails on xcat-online.sh.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 4155d98dc35a65d5d6721298bf9c2c89428a29fa)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00
..
…

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
Black-box service tests xCAT-test/blackboxtest/ python3 -m unittest discover -s tests, then blackboxtest run <conf> on a management node
Native host tests xCAT-test/native/*.t, xCAT-test/native/*.bats Selected CI cases and explicit lab runs; see native/README.md
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.

blackboxtest is the odd one out: its Python unit tests and blackboxtest validate run offline like the others, but its point is the third column -- asking a management node what a booting node asks (DHCP, DNS, TFTP, HTTP, xcatd) and asserting on the answers. It talks to the services only as a client, so it does not depend on which DHCP server answers or on the xCAT database.

See unit/README.md, bats/README.md and blackboxtest/README.md for the detailed rules for each suite.