mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 23:28:19 +00:00
87974d91c4
uninstall_xcat hands the whole GO_XCAT_UNINSTALL_LIST to the package manager. Most of that list is not installed on any one node -- it names packages xCAT stopped producing, so that `go-xcat uninstall` still removes them where they are present. apt answers "Unable to locate package" for a name it does not know and go-xcat prints a warning for each; dnf answers "No match for argument" and fails the whole call when nothing in the list matches. The test runs uninstall_xcat with rpm and dpkg-query answering from a fake package database and remove_package shadowed, and reads the argument list the package manager would have been given. A fourth case hands over a database where everything is installed, so a filter that dropped everything could not pass the other three. 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.