2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-25 09:14:05 +00:00
Files
xcat-core/xCAT-test
Daniel Hilst 574b3590db test(xcat-core): one node's request to the install monitor blocks every other node
The xcatd install monitor accepts a connection, resolves the peer to a node and
dispatches the request in line. Nothing else is accepted until that request
returns, so a node whose 'nodeset next' takes three seconds costs every other
installing node three seconds. A request that kills the process serving it takes
the whole monitor down with it.

do_installm_service in xCAT-server/sbin/xcatd is one process with one accept
loop. Every branch calls plugin_command directly. The per-request fork that once
stood there is commented out, because two requests for one node write the same
chain row and must not overlap.

This commit adds the test only. xcatd_install_monitor_concurrency.t lifts
do_installm_service out of the program, runs it on a port of its own against
stand-in plugins, and drives it with real clients: one node holds a three-second
request, a second node times its greeting, two requests for one node are checked
for overlap, and one request kills the process that serves it.

The test fails on this tree. The second node waits 5.7 seconds for its greeting,
and the monitor does not survive a request that kills its handler.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-15 13:11:12 -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
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.