2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 15:18:19 +00:00
Commit Graph

24 Commits

Author SHA1 Message Date
Vinícius Ferrão bf5e2bdb20 test(dhcp): cover the upstream loader dispatch
The packet test runs dhcpd and kea-dhcp4 in a network namespace with the
rules that BootPolicy renders, and sends relayed DHCPDISCOVER packets
from a second namespace. It checks the boot file of firmware PXE, xNBA
and iPXE clients, with each iPXE feature present or missing, for an xnba
node and an ipxe node that install, for both methods with a SAN disk,
and for an unknown node. On ISC it also covers an iSCSI node of each
method in the boot state, and repeats the node rows after a restart,
when dhcpd reads the host statements back from dhcpd.leases. On Kea it
repeats the rows of the ipxe nodes with a configuration that makedhcp
upgraded, which keeps the xNBA global classes of the older makedhcp -n.
It also checks that the UEFI clients of an xnba node get xNBA when the
server lacks the xNBA UEFI file.

The Kea validation test checks the x86 classes of xnba and ipxe nodes
with kea-dhcp4 -t. XCAT::Test::DHCP builds the packets, and the
integration case expects seven files.
2026-10-02 23:58:11 -03:00
Vinícius Ferrão 128e7fe197 test(dhcp): cover the upstream loader of unknown x86 clients
The global Kea classes give the upstream loader to an x86 client that
cannot fetch its script, and the Etherboot class gives it the BIOS
loader. The network classes and the ISC x86 lines give the Genesis
script under xcat/ipxe/nets to a client with the iPXE features of its
path, and the Kea subnet lists those classes. Without an upstream loader
file on the server, neither backend names it or the second stage that it
would fetch, and the ISC lines stop such a client before the fallback.
The xNBA files name no global class.

An xnba node gets xNBA from its own first-stage classes when the server
has the xNBA BIOS file, and still xcat/xnba.efi without the local UEFI
file. Without the xNBA BIOS file it has no first-stage classes, as it
has no ISC host statements. An ipxe node without a SAN disk carries the
upstream loader in its own first-stage classes.

The ISC configuration test also checks these lines in configurations
that makedhcp upgraded, one of them with indented declarations.

The DHCP wire cases now expect the upstream loader for an x86 client
with no reservation, and its network script for a second stage that
reports the features in option 175. A second stage without them gets the
loader again, and an xnba node still gets xNBA.
2026-10-02 23:58:11 -03:00
Vinícius Ferrão 2f123f7b24 test(dhcp): keep the ISC host statements of ipxe nodes parseable
dhcpd keeps the host statements that makedhcp gives it through OMAPI in
dhcpd.leases, where it saves them without parentheses, and reads them
back when it restarts.

The lease test stores the statements of netboot=ipxe nodes through OMAPI
in a private network namespace, checks the saved leases with dhcpd -t,
and restarts dhcpd with them. The configuration test checks the iPXE
feature declarations of the ISC header with dhcpd -t.

start_daemon can now keep the identity of the caller, and the
integration case expects six files.
2026-10-02 20:11:19 -03:00
Vinícius Ferrão 50d4145a69 test(dhcp): share the daemon helpers of the Kea smoke test
The helpers that start, wait for and stop a DHCP daemon lived in the
Kea smoke test. The ISC lease test and the packet test need them too.

They move to XCAT::Test::DHCP in integration/lib, which the xCAT-test
packages install with the tests. The smoke test loads them from there
and behaves as before.
2026-10-02 20:11:19 -03:00
Vinícius Ferrão da3c4e9dfe test(dhcp): cover the iPXE feature options of an upgraded configuration
makedhcp adds the missing ISC declarations after the gpxe option space,
and the missing Kea definitions after the existing ones, once. Indented
ISC declarations and declarations with more blanks count. An ISC
configuration without the gpxe space gives an error and stays as it is,
and so does a Kea definition of option 175 without the gpxe
encapsulation, and makedhcp then writes nothing.

makedhcp writes the ISC configuration and restarts dhcpd at once. When
the configuration declares no gpxe option space, or makedhcp cannot
write the file or restart dhcpd, it reports the error and changes no
subnet or host. A marker beside the configuration stays until a restart
succeeds, so the next run restarts dhcpd before it changes a host.
Without a dhcpd.conf, or with one that xCAT did not write, it gives no
error and goes on to write a new configuration. Kea restarts to load the
definitions, also when the Control Agent applies the host reservations.

Every option code stays a number: JSON::XS writes a number that Perl has
used as a string as a JSON string, and Kea rejects it. kea-dhcp4 -t
checks an upgraded and a current configuration that makedhcp writes
back.
2026-10-02 20:11:18 -03:00
Daniel Hilst 988b1654e1 Merge master into test/client-server-testing
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-01 08:22:20 -03:00
Vinícius Ferrão 4900bd2808 docs: document native test entry points 2026-09-22 23:15:54 -03:00
Vinícius Ferrão f49941fb62 test: separate native openEuler checks from unit tests 2026-09-22 23:15:42 -03:00
Vinícius Ferrão 741511aa40 test(openeuler): locate installed package postscripts 2026-09-21 19:04:34 -03:00
Vinícius Ferrão 5195d4c87c docs(test): describe native package integration requirements
List both openEuler package tests and their native prerequisites. Explain
that the integration file count verifies discovery and does not prove
skipped cases ran.
2026-09-14 23:47:33 -03:00
Vinícius Ferrão 29fc9a7580 test(openeuler): exercise signed postscript package transactions
Run the complete postscripts in private mount namespaces. Verify generated
repository scope, native key import, missing trust and repository failures.
Check keeprepo behavior and existing EL upgrade scope. Register both
integration tests.
2026-09-14 23:46:22 -03:00
Daniel Hilst 1a531128de fix(dhcp): close four more ISC/Kea drifts from the parity spec
Appendix A decisions 9, 21, 22 and 24. Each one is a difference an
operator never chose: the backend is picked by distribution version, so
whichever side is wrong is wrong on half the clusters.

9  -- Kea never loaded libdhcp_bootp.so, so a BOOTP-only client that ISC
      answered got nothing. The hook now sits alongside host_cmds in one
      hooks-libraries array, and when the hooks package is absent the
      operator is told which clients that leaves unanswered rather than
      being left to find out from a node that never boots.

21 -- The ISC host statements sent "send host-name", which is a dhcpd
      *client* keyword: it never reached option 12 and the node was
      handed no hostname at all. Kea has always sent one.

22 -- The PXE short lease existed on ISC in name only. dhcpd applies
      min-lease-time after max-lease-time, so the cluster default won and
      a pool address taken by a PXE ROM was held for half a day. The
      class now names all three bounds, and Kea is given the same 600
      seconds through xcat-pxe-lease.

24 -- ISC writes "authoritative;" into every generated subnet; Kea
      defaults to the opposite. A node that moved rack asked to keep an
      address from the network it had left and was answered with silence,
      so it waited out a lease that would never be renewed instead of
      being told to start over.

Also makes $xCAT_plugin::dhcp::callback a package variable. It was a file
lexical, so the tests' local() set something nothing read, and warnings
were only ever captured because an earlier process_request had left its
collector behind.
2026-09-10 13:38:32 -03:00
Vinícius Ferrão 0302670320 test(genesis): update integration test count 2026-09-06 11:09:27 -03:00
Vinícius Ferrão 6aba71b44c test(genesis): cover s390x config name 2026-09-04 16:37:39 -03:00
Vinícius Ferrão 7183fd8414 test(genesis): cover s390x boot behavior 2026-09-04 16:20:38 -03:00
Vinícius Ferrão 6711a5ce9e test(genesis): tighten s390x coverage 2026-09-04 15:31:33 -03:00
Vinícius Ferrão 2bb76b523e test(genesis): cover s390x boot handoff 2026-09-04 14:42:42 -03:00
Vinícius Ferrão 36ca4a369f test(genesis): cover s390x network boot 2026-09-04 12:48:32 -03:00
Vinícius Ferrão 0c0803d83a test(utils): reuse and cover executable lookup 2026-09-02 22:58:22 -03:00
Vinícius Ferrão 1add10053d test(debian): verify HTML::Form runtime dependency 2026-08-29 21:44:44 -03:00
Vinícius Ferrão 1034752080 test(kea): harden live Control Agent smoke 2026-07-25 01:26:46 -03:00
Daniel Hilst 764e667e0a fix(xcat-core): assert the integration case actually ran its tests
The case gated only on rc==0, but prove exits 0 both when tests pass and
when every test skips, so the case could report green having run nothing
at all. That is not hypothetical: all three tests carry environment
guards, and on the pull request run the harness discards a passing
case's output, so there was no way to tell from the log whether anything
had executed.

Add check:output=~Files=3, which proves prove found all three files. It
still tolerates a legitimate skip on a node without Kea, and it catches
a packaging regression or a rename. A missing directory was already
caught, since prove -r on a nonexistent path exits 2.

The count has to be maintained by hand when tests are added here, which
the README now says.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:47:15 -03:00
Daniel Hilst de17401338 fix(xcat-core): run the integration testcase on pull requests too
The integration testcase was added without the ci_test label on the
grounds that the pull request workflow has no management node. That was
wrong: github_action_xcat_test.pl builds xCAT, installs it, runs
setup-local-client.sh and chtab, and leaves xcatd running, which makes
the runner a single node management node. Running the ci_test cases
against it is exactly what the fast regression stage already does.

Label the case ci_test so the integration tests get pull request
coverage as well. This also unlocks a test that had been skipping for a
fixable reason: each case is invoked through sudo, and
dhcp_kea_config_validation.t skips only because /etc/kea is not writable
by the unprivileged runner user, so as root it validates instead of
skipping.

Running the integration suite as root and the unit suite unprivileged is
the right way round. Integration tests legitimately need to write to
places like /etc/kea, whereas running the unit tests as root would let
permission-related assertions pass for the wrong reason.

Correct both READMEs, which carried the mistaken claim that the
integration tests do not run in CI.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:11:31 -03:00
Daniel Hilst 6ab9aca0b7 fix(xcat-core): split the source-only unit tests from the MN integration tests
Three of the files under xCAT-test/unit are not unit tests. They need an
installed management node rather than a checkout: copycds_packages_integrity.t
wants an /install populated by a real copycds, dhcp_kea_config_validation.t
wants a kea-dhcp4 binary that can read the config it generates, and
dhcp_kea_control_agent_smoke.t wants live kea-dhcp4 and kea-ctrl-agent
daemons running as root.

On a GitHub runner none of that exists, so all three plan skip_all. They were
the only three files skipping in the pull request run, which is not a
coincidence -- the skip is the symptom of them being filed in the wrong place.
A skipped test reports neither pass nor fail, so leaving them mixed in with
the unit tests trains the reader to scroll past skips in a directory where a
skip should mean something is wrong.

Move them to xCAT-test/integration, ship that directory alongside unit in
both the rpm and the deb, and drive it from a new xcattest testcase that
proves the installed copy on an MN. The case is deliberately not labelled
ci_test: the pull request workflow has no management node and must not pick
it up. check:rc==0 is the right gate for it -- prove exits non-zero on a real
failure, exits 0 when a test legitimately skips on a node without Kea, and
exits 2 if the directory is missing entirely, so a packaging regression still
fails the case.

Add a README.md to each directory recording which side of the line a new test
belongs on and how each suite is run.

xCAT-test/unit is now 44 files and 802 assertions with no skips at all; the
assertion count is unchanged, confirming the three moved files were
contributing nothing but skips.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:06:10 -03:00