2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-20 14:45:41 +00:00
Files
xcat-core/xCAT-test
Daniel Hilst fefced0b49 fix(xcat-core): otherpkgs prints the whole package list on every run
The otherpkgs postscript writes two diagnostic lines for each package
sublist: the split package array with its size, and the detected package
manager. On a list with tens of entries these lines fill the updatenode
output and the node log, and hide the install results.

The two echo commands sit in xCAT/postscripts/otherpkgs, after the
IFS split that builds pkgsarray, and no condition guards them. Every
other diagnostic in the script runs only when VERBOSE is set.

This change puts the two lines in the same "if [ $VERBOSE ]" block the
rest of the script uses.

xCAT-test/bats/postscripts_otherpkgs.bats runs the split and the lines
that follow it. One case asserts no output when VERBOSE is empty, and
fails on the parent commit. A second case asserts both lines are still
printed when VERBOSE is set.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 402a6f4a45)
2026-09-24 14:56:56 +00: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
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.