2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Daniel Hilst efb8e81cb3 Merge pull request #7996 from VersatusHPC/fix/xcattest-table-value-class
fix(xcattest): a [Table_*] value stops at its first colon or slash
2026-11-06 16:28:35 -03:00
Daniel Hilst b7076359f4 fix(xcat-test): xcat-test can install without python3 on Debian
python3-scapy was the only Depends of xcat-test that pulled in
python3. With scapy moved to Recommends, apt-get install
--no-install-recommends xcat-test can leave python3 absent, and every
blackboxtest command fails before it starts, not only the DHCP steps.

Add python3 to Depends. xcat_test_scapy_optional.t checks that python3
is a hard Depends, and fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:42:47 -03:00
Daniel Hilst 8c2ecab18c fix(xcat-test): scapy is a hard Depends on Debian and only a Recommends on EL
Only blackboxtest's DHCP steps need scapy. dhcp.py is the single module that
imports it, inside scapy_module(), which raises UnsupportedError naming
python3-scapy when the import fails -- so xcat-test installs and every other
blackboxtest step runs without it. xCAT-test.spec has only ever RECOMMENDED the
package, and says why in a comment: a hard Requires: would make xcat-test
uninstallable on a management node without EPEL. debian/control answered the
same question with Depends:, which is the asymmetry this fixes.

The cost is not theoretical. `apt-get install -y xcat-test` installs Recommends
by default and python3-scapy recommends matplotlib, scipy and ipython3 -- 54
packages, about 255 MB -- inside a workflow step capped at 1200 seconds. On
2026-10-23 that download stalled and killed xcat_pr_test on xcat-core/#7974 at
exactly 1200s, step 21, while a sibling run on another runner did the same
install in 19 seconds. The job does 50 to 55 minutes of work against a
60-minute timeout, so a dependency of that size is most of its headroom.

Moving it to Recommends does not by itself stop apt pulling it: an installer
that wants the small package set has to ask, with --no-install-recommends. What
this changes is that xcat-test no longer REQUIRES 255 MB to install, which is
what the spec already said and what the code already supported.

xcat_test_scapy_optional.t asserts both packagings give the same answer: scapy
absent from Depends, present in Recommends, the perl dependency still a Depends,
and the spec recommending rather than requiring it. Restoring the hard Depends
fails one assertion; deleting the Recommends outright -- the other tempting
answer -- fails a different one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-23 17:27:17 -03:00
Daniel Hilst b5181574ea test(xcattest): a conf cannot set a vm.othersettings with two settings
An [Object_*] line of an xcattest conf declares an xCAT node attribute.
vm.othersettings holds several settings separated by a semicolon, which
is the syntax the kvm plugin reads, and such a line reaches the node cut
at its first semicolon with no message. The reader drops the rest, and
the chdef that applies it runs through /bin/bash -c unquoted, so the
shell would read the semicolon as a command separator.

load_config_file read each line with a regular expression written inline
and built the chdef by concatenation, so neither could be measured
without a database. xCAT::Test::Conf now holds the three readers and the
command builder, and xcattest calls them. The routines keep the behaviour
they replace, and both packages install the module.

xcattest_conf_object_attr.t fails five of its nine checks on this commit:
the semicolon value, the quoting and the order of the assignments.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:45 -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
Daniel Hilst ad511ff0c4 fix(xcat-core): xcattest dies on Ubuntu without xCAT::Test::OS
xCAT-test/debian/install did not list lib/xCAT/Test/OS.pm, so the
Debian package shipped xcattest without the module it loads, and
xcattest stopped at startup with "Can't locate xCAT/Test/OS.pm in @INC".

Install the module to opt/xcat/lib/perl/xCAT/Test, as the RPM spec does.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 20:26:58 -03:00
Daniel Hilst ce25575d7f refactor(blackboxtest): merge dhcptest and provtest into one client
dhcptest and provtest carried two copies of the config loader, the
assertion language, the $step.field substitution, the TAP reporter, the
error types and the CLI. The copies had already drifted: list equality,
multi-line regex and CIDR membership behaved differently in each.

blackboxtest keeps one of each. A step type table in steps.py declares
the keys, required keys and reply fields of every type, and the runner
dispatches to the DHCP client or to the dig, tftp, curl and xcatd
clients. One scenario can now use a DHCP reply in a TFTP step.

The shipped scenarios move unchanged to conf/dhcp/ and conf/prov/. Their
scenario, step and assertion lists are identical to the old ones. The
wire cases and fixtures move to autotest/testcase/blackboxtest/, and CI
runs one offline phase instead of two.

Removed because no scenario or fixture used them: the pretty and json
reports, --pcap, --mac, the discover subcommand, the decline, inform
and sleep steps, assert_all, select, and the keys dhcptest accepted and
ignored.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-18 08:40:21 -03:00
Daniel Hilst 711c4870db test(provtest): add the autotest cases and ship the tree in the packages
Ten cases: two offline ones labelled ci_test, the unit suite and a parse
of every shipped scenario, and eight wire cases labelled prov_wire, one
per stage of the chain a node walks -- DNS, loader and config, install
tree, genesis and discovery artefacts, discovery requests, the xcatd
protocols, the install monitor, and the three failures that look alike
from a console.

The wire cases are deliberately not ci_test: while one runs the
management node has an extra veth pair and namespace, four nodes, a
rewritten zone and possibly a moved http port. Each restores all of it
from a trap, and each passes with a message when the host cannot host it.

provfixture.sh holds every xCAT command; the scenarios read none of it.
2026-09-11 09:00:54 -03:00
Daniel Hilst 008f83d2e4 test(xCAT-test): add dhcptest, a wire-level DHCP client test tool
xCAT's DHCP behaviour is tested from two directions today, neither of which
touches the wire: xCAT-test/unit/dhcp_*.t assert on generated config text, and
xCAT-test/integration/dhcp_{isc,kea}_config_validation.t feed that config to a
real daemon and check it parses. Both stop at "the server accepted our
config". Nothing verifies that a client sending option 93 = 0x000b actually
gets an aarch64 loader back.

The one existing wire tool, xCAT-probe/subcmds/detect_dhcpd, hand-packs a
fixed DISCOVER carrying no option 60, 77 or 93 (so it never reaches any arch
branch), parses replies by regexing tcpdump output, and binds an
IO::Socket::INET to a local address, so it cannot run on a provisioning NIC
that has no address yet.

dhcptest fills that gap. It is a Python 3 tool using only the standard library
plus Scapy, speaking raw Layer 2, driving DHCP transactions declared in INI
files and asserting on what came back:

  dhcptest run      -i eth1 --set net=10.0.0.0/24 conf/full-lease.conf
  dhcptest validate conf/*.conf      # no root, no network, no scapy
  dhcptest list     conf/*.conf
  dhcptest discover -i eth1          # ad-hoc, no conf file

Scenarios cover DISCOVER/OFFER, the full lease, renew and rebind, reserved
versus pooled addresses, deliberate silence, the PXE architecture matrix and
the iPXE user-class split. Assertions are a small DSL -- target, operator,
value -- over message type, BOOTP header fields, options by number or name,
subnet membership, and the boot file a client would actually use (option 67
or the header, since servers differ on which they fill).

Two boundaries are enforced by unit test rather than by convention:

  - The tool is implementation-agnostic. It exchanges packets and checks
    fields; it never reads the xCAT database, never runs an xCAT command, and
    names no DHCP implementation. Anything that differs between servers is
    expressed by whoever writes the .conf.
  - Only runner.py imports scapy, so validate and list stay usable in CI on a
    host with neither scapy nor root.

Host networking is never modified. The client MAC defaults to a synthetic
locally-administered address, everything goes over a raw L2 socket, no leased
address is ever configured, and the ARP responder answers only for addresses
the session was actually granted.

Variables in .conf files are configparser's own BasicInterpolation, %(name)s,
fed from [vars] and --set. $offer.address and friends are resolved separately
at step-execution time, because they name a reply that has not arrived when
the file is read; BasicInterpolation gives $ no meaning, so the two coexist
without escaping.

Packaging and CI:

  - xCAT-test.spec installs dhcptest alongside unit/ and integration/, and
    only recommends python3-scapy: it lives in EPEL on EL, and a hard Requires
    would make xCAT-test uninstallable on a management node without EPEL.
    The deb depends on it outright.
  - github_action_xcat_test.pl runs the unit tests and `dhcptest validate`
    last, after the fast regression.
  - autotest/testcase/dhcptest/cases0 carries the two offline cases plus a
    wire case that stands down with an explanation when no provisioning NIC
    is available.

Verified against a real DHCP server in a network namespace: 34 lease, renew,
rebind, reservation and silence assertions and 22 PXE/iPXE assertions all
pass, and host networking is untouched before and after.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-10 08:19:41 -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
Vinícius Ferrão 88579fbd77 Wire DHCP unit tests into xcattest 2026-04-23 15:10:40 -03:00
GONG Jie 256c6c76c6 Remove trailing spaces in file xCAT-test/debian/copyright 2017-12-31 23:59:59 +00:00
Bin Xu 213e7e05de create framework for executing and saving performance testcase data (#2500)
- refine the xcatperftest tool to make it be easily integrated into xcattest
- add testcase/performance/.. to trigger the performance testcase
- fix manpage missing issue for xcatperftest
2017-05-18 17:16:58 +08:00
Bin Xu 8b8a82627b The tool to get xCAT node range operation performance baseline (#2681) (#2916)
* Feature #2681, to add a script in xCAT-test to get the performance baseline for node range operation.

* adopt review comments in PR#2916:
  1, add the rst file for xcatperftest (#2681)
  2, using /bin/bash as script executor
  3, FILES in manpage should not be in the same line
  4, minor adjustment if PERF_NOCREATE/PERF_DRYRUN is set
2017-05-09 04:49:15 -05:00
neo954 327db76f9e Make all the deb packages have the exactly same version and release numbers 2017-01-03 12:56:15 +08:00
Victor Hu 78a6d8e39e Revert "For Ubuntu builds, adding a .gitignore to ignore the files generated"
This reverts commit 829f107beb.
2015-06-15 17:32:34 -04:00
Victor Hu 829f107beb For Ubuntu builds, adding a .gitignore to ignore the files generated
from the builds.  Also remove the changelog because that file is going
to be ignored from the source tree.  Ubuntu builds are being done
in the xcat-core directory and causing issues when we are switching
between releases.    Should probably change the builds scripts as a longer
term solution
2015-06-15 17:14:05 -04:00
Victor Hu f8bd32838a Change the debian/rules file to executable to supress
a warning during the build.  The rules file is required to have
execute permission as it's the debian "Makefile"
2015-03-25 17:42:51 -04:00
xq2005 28d9fdd2aa change the Maintainer to xCAT when building packages on ubuntu
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16760 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-06-26 07:34:47 +00:00
arifali f2577efa77 Fix building debian packages so that the .svn files are not included
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12111 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-04-03 21:37:16 +00:00
adalbas 48c3e12220 add xcat-test build files for deb packages
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10754 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2011-10-12 15:39:05 +00:00