2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-26 12:22:15 +00:00
Files
xcat-core/xCAT-test
Daniel Hilst 397d67c290 fix(xcat-core): restart a NIC when only its MTU changes
A network object that declares mtu=1496 leaves the NIC on its old MTU. After
"updatenode <node> -P confignetwork" the connection profile says 1496 and "ip link" says
1500. The new profile is not the active one either, so a query of the NIC reports the MTU of
the connection it replaced.

configeth chooses between writing the configuration files and also restarting the NIC. It
compares the addresses the node has against the addresses the networks table declares, and
it sets the flag for nicextraparams. An MTU change is in neither test, so bool_restart_flag
stays 0 whenever the NIC is up and xcat_history_important already names it. The files are
written, nmcli adds the connection, and the "nmcli con reload; nmcli con up" that activates
it never runs.

Compare the MTU as well, in xcat_nic_mtu_changed in xcatlib.sh, and set bool_restart_flag
when it differs. A network that declares no MTU is unchanged, as is a NIC whose MTU cannot be
read.

The case that covers this is confignetwork_secondarynic_updatenode. It fails on EL8 and EL9
and passes on EL10, where /etc/sysconfig/network-scripts does not exist, so
xcat_history_important is never written and every run takes the restart path.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit bde80e46ce15f6831fe49dda644f193f5d2e5b97)
2026-10-07 13:45:19 -03:00
..
2018-04-26 15:15:47 -04: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 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.