The case failed on openeuler20.03sp4, openeuler22.03sp4 and openeuler24.03sp4, 3 occurrences in xcat-ci build 89. The diff check failed, not the extraction. encrypted_passwd_openssl_diskfull is the only case in passwd/case0 that selects the extraction by distribution. It greps /etc/*release for SUSE, then for "Red Hat|CentOS|Rocky|Alma", then for Ubuntu. On an openEuler management node all three miss and openEuler matches, so the case takes the final arm, prints "Sorry,this is not supported os", writes nothing to /tmp/instcryptedpasswd, and the diff against the password table reports rc=2. openEuler now takes the Red Hat arm. compute.openeuler.tmpl writes "rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#", which is byte-identical to every EL template, so field 3 holds the hash and the EL cells already pass with that arm. The diff check is unchanged, so the case still fails when the extraction reads the wrong field: field 3 of the expanded line gives diff rc=0 and field 4 gives rc=1. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit a1b9372c413f54d18ba6a60d3839e9f75d7b8261)
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 |
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.