2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00
Commit Graph

69 Commits

Author SHA1 Message Date
Daniel Hilst 2bfad97348 fix(build): address review on builddebs.pl, and repoint CI at the new repo
Four fixes from @viniciusferrao's review plus the CI break his review predates.

orig tarball version. dpkg looks for <source>_<upstream>.orig.tar.gz with no
Debian revision, and the call site passed the full Version-Release. The rule now
lives in BuildUtils::upstream_version and orig_tarball_name applies it, so the
call site cannot get it wrong whichever string it is handed. Currently dormant --
every package is Format: 1.0, so the quilt branch does not run, which is why the
differential build did not catch it.

--dest could write to the filesystem root. Cwd::abs_path returns undef when a
PARENT component is missing (a missing leaf is fine), and the caller interpolated
that, so `--dest /no/such/parent/out` became `/debs` and `/xcat-core` at /.
Replaced with BuildUtils::resolve_dest, which is rel2abs and purely lexical --
correct for an output directory that does not exist yet.

Generated debian/control left behind. xCAT-genesis-scripts has no debian/control
of its own; it is generated from control-<arch>. The cleanup restored only files
that already existed, so the generated one stayed. Worse than dirty: ppc64el ran
last, so the restore put back the amd64 BACKUP and the leftover was the wrong
architecture's control, which a later single-arch build would have started from.
with_prepared_tree now records created files and removes them. Verified by a real
build: the checkout is byte-clean afterwards, matching the oracle.

CI install step. build-ubunturepo wrote its repo to $curdir/../../xcat-core,
which under GitHub's work/<repo>/<repo> layout IS $RUNNER_WORKSPACE, so
install_xcat's `./mklocalrepo.sh` happened to be in the directory it chdir'd to.
builddebs.pl writes inside the checkout instead -- that outside-the-checkout path
is what used to rm -rf the tree -- so install_xcat now names the script by its
real location and fails with a clear message if the build produced no repository.
This is what reddened xcat_pr_test at 2m13s; the builder itself was fine (the
exact CI invocation, `./builddebs.pl --force` with no --dest, returns 0 with all
14 packages).

The executable bit was already fixed before the review landed.

Both new helpers are tested and mutation-verified: not stripping the revision
reddens 3 assertions, swapping rel2abs back to abs_path reddens 2. Equivalence
re-measured after these changes -- all 14 packages identical to build-ubunturepo
in control and in every non-changelog file by md5.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-02 12:39:44 -03:00
Daniel Hilst b8510e1be3 refactor(build): replace build-ubunturepo with builddebs.pl and BuildUtils.pm
build-ubunturepo was 710 lines of shell doing the Debian half of what
buildrpms.pl does for rpms, with no code in common and a different CLI. It also
carried paths that are dead: GSA uploads, the PROMOTE/PREGA release flows, and a
-d mode that built an xcat-dep repository from a different project's packages.

builddebs.pl replaces it and mirrors buildrpms.pl -- Getopt::Long options, one
package list, build then index then sign -- so the two builders read the same way
and share BuildUtils.pm.

The design rests on one fact: xcat-core debs are Perl. They are byte-identical
for every Ubuntu release, so they are built ONCE and the same files are published
into every codename. Only xCAT, xCATsn and xCAT-genesis-scripts carry an
architecture, and there the difference is packaging metadata, not compiled
output. That is why this needs no sbuild and no per-codename chroot -- unlike
xcat-dep, whose packages are compiled and genuinely differ per release.

BuildUtils.pm holds what both builders need and what was worth making testable:
the Version-Release derivation from the commit time, the xCAT-probe helper
staging, the deb arch and dist tables, the debian/control version pinning, the
changelog rewrite, the reprepro conf generation, and the build lock. Every
function is pure or takes its side effect as an argument, so build_utils.t (45
assertions) drives each one rather than grepping a builder for evidence that it
is called. Verified by mutation: shrinking the arch table reddens 1, dropping
the /g from the control pin reddens 2.

The env-var CLI maps to options: BUILDALL=1 -> --force, GPGSIGN=1 -> --gpg-sign,
GPG_HOME -> --gpg-home, DEST -> --dest, DISTS -> --dist (repeatable). UP=0 has no
equivalent because uploading is gone -- the CD pipeline's deploy step publishes.

Callers updated: github_action_xcat_test.pl and travis.pl. The comment in
github_action_xcat_test.pl explaining why CI copies the tree before building is
corrected -- build-ubunturepo rm -rf'd $curdir/../../xcat-core, which under
GitHub's work/<repo>/<repo> layout is the checkout's own parent; builddebs.pl
writes under dist/debs inside the checkout and restores every file it edits, so
the copy is now only isolating the tests from build residue.

Two tests moved with it. build_ubunturepo_lock.t extracted the lock out of the
shell with a regex and ran that; the lock is now a function, so builddebs_lock.t
calls it -- and asserts what actually matters, that two builds of one checkout
fail fast while two builds of different checkouts run concurrently.
ubuntu_2604_pkglist.t asserted that resolute appeared in a shell fragment of
build-ubunturepo's source; it now asks BuildUtils for the release list and checks
a resolute stanza reaches conf/distributions. That assertion would have passed on
any file containing the fragment and broken on a reflow that changed nothing.

Verified: prove -r xCAT-test/unit fails on 6 files here against 7 on
upstream/master, the difference being apache_config_sources.t, fixed by the
preceding commit. The remaining 6 are missing DB modules on the machine that ran
it and are identical on both.

NOT done here, and required before this can merge: the Ubuntu core CD pipelines
still invoke ./build-ubunturepo (ci/ubuntu/Jenkinsfile.core-ubuntu-{devel,stable}
in VersatusHPC/xcat-core-ci-cd, and the inline script in each live Jenkins job).
Those must be switched to builddebs.pl in the same change window.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-02 12:39:43 -03:00
Vinícius Ferrão b73a7ca1d3 fix(ci): bound the apt network steps with timeouts and retries
The PR test job ran apt-get against the xcat.org repository with no
time limit of its own. When the repository stalled, the job hung on the
update step until the sixty minute workflow limit canceled the run, and
the log gave no reason.

Wrap the apt-get update and install steps in a timeout command and give
apt a transfer timeout with retries. A stalled repository now fails the
step in minutes, the driver prints its install error report, and a
rerun is possible at once.
2026-08-19 15:46:28 -03:00
Vinícius Ferrão 2a3e2f5eee fix(ci): skip installed source tests 2026-08-09 13:16:35 -03:00
Vinícius Ferrão 19c1c2c9ab fix(ci): make package installs noninteractive 2026-08-09 12:14:48 -03:00
Daniel Hilst 53e2b0bd7b fix(xcat-core): allow naming cases whose output survives a pass
run_fast_regression_test() prints a case's output only when it fails.
For 250 cases that is the right default, but it leaves no way to tell
whether a passing case did real work or skipped everything. That is not
academic for cases wrapping prove: prove exits 0 both when tests pass
and when every test skips, so integration_tests reports green either
way and the log cannot distinguish them.

Add @verbose_cases. A case named there has its output printed on a pass
as well, and the failure branch no longer prints a second copy. Seed it
with integration_tests to find out which of the three integration tests
actually run on a runner -- in particular whether
dhcp_kea_config_validation.t validates from /etc/kea now that the case
runs as root, or still skips. Emptying the list restores the previous
behaviour exactly.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 12:12:12 -03:00
Daniel Hilst 63505793db fix(xcat-core): keep a source tree for the unit tests to run against
The unit test stage failed on the first CI run with

    Cannot detect source of 'xCAT-test/unit/*.t'
    Files=0, Tests=0
    Result: NOTESTS

the glob reached prove unexpanded because it matched nothing. The source
tree is gone by the time the tests run: build-ubunturepo sets

    local_core_repo_path="$curdir/../../xcat-core"

and rm -rf's it before creating the apt repository there. GitHub checks
out into work/<repo>/<repo>, so for /home/runner/work/xcat-core/xcat-core
that path resolves to the checkout's own parent and the build wipes the
checkout, leaving an empty directory of the same name behind. The cd
still succeeds, which is why prove was handed a literal glob rather than
failing outright. This is also why every testcase that predates this
change proves /opt/xcat/share/xcat/tools/autotest/unit: after the build
the installed copy is the only one left.

Copy the checkout aside in preserve_source_tree() before the build and
prove that copy, so FindBin still resolves to a real source tree. Switch
to `prove -r xCAT-test/unit` as well, so a missing directory fails loudly
instead of silently degrading to a no-op the way an unmatched glob does.

Reproduced and verified by replaying the build under GitHub's directory
layout: the checkout drops to 0 test files, the preserved copy keeps all
47 and proves clean.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 10:00:19 -03:00
Daniel Hilst a0d2322b71 fix(xcat-core): run every xCAT-test unit test in the GitHub CI
The 47 test files under xCAT-test/unit/ were shipped but almost never
executed on a pull request. Only three hand-written xcattest cases
reached them -- dhcp_unit, ipmi_unit and xcatprobe_unit -- and each
proved a single glob against the installed copy, so the majority of the
suite had never run at all. Real drift went unnoticed as a result:
ubuntu_subiquity_template.t still asserted the pre-86e77bcd7 shape of
compute.subiquity.tmpl and failed against the current template.

Run `prove xCAT-test/unit/*.t` directly from github_action_xcat_test.pl.
The tests resolve xCAT modules and fixture files relative to the repo
root through FindBin, so they must be proved from the checkout and not
from /opt/xcat/share/xcat/tools/autotest/unit; install_xcat() chdir's
away, hence the getcwd() captured up front. The step runs after the
install because the suite needs the perl dependencies xCAT pulls in
(Net::DNS, XML::Simple) and a usable xCAT database.

Drop the three prove testcases so their tests do not run twice, and
refresh the two stale ubuntu_subiquity_template.t assertions: the
identity section is now intentional (86e77bcd7) and the MAC
normalization gained cut filters ahead of the tr (c6e38483f), which the
loosened regex plus a new assertion for the suffix stripping now cover.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 09:14:03 -03:00
Daniel Hilst 83323504a6 Fix GitHub CI: use noble image + latest/noble xcat-dep
The xcat-dep APT repo now publishes only the noble (24.04) codename at
.../apt/latest/xcat-dep; the bionic/devel dist no longer exists, so
install_xcat failed on apt-get update/install. Run the workflow on
ubuntu-24.04 and point the apt source at latest/xcat-dep noble main.

Drop the apt-key step: apt-key is removed on Ubuntu 24.04 and the legacy
apt.key is gone from the xcat-dep dir; the repo already installs via
allow-insecure-repositories/allow-unauthenticated.
2026-07-16 22:37:49 -03:00
Vinícius Ferrão a716e8ff90 Fix DHCP CI package layout 2026-04-28 15:47:42 -03:00
Mark Gurevich 071c6f1c2a Debug command output39 2022-07-14 16:13:42 -04:00
Mark Gurevich f2627be5d3 Debug command output36 2022-07-14 15:13:53 -04:00
Mark Gurevich 4764457cf2 Debug command output35 2022-07-14 14:20:41 -04:00
Mark Gurevich 59ce931593 Debug command output34 2022-07-14 14:06:05 -04:00
Mark Gurevich c5990db071 Debug command output33 2022-07-14 13:55:45 -04:00
Mark Gurevich e47f12a833 Debug command output32 2022-07-14 13:44:31 -04:00
Mark Gurevich c1a059ac90 Debug command output31 2022-07-14 13:30:35 -04:00
Mark Gurevich 778294254a Debug command output30 2022-07-14 13:18:30 -04:00
Mark Gurevich 1e1aeff63b Debug command output29 2022-07-14 13:17:11 -04:00
Mark Gurevich 8832ae6c9d Debug command output28 2022-07-14 13:05:56 -04:00
Mark Gurevich 8953e4ab86 Debug command output27 2022-07-14 12:48:24 -04:00
Mark Gurevich 2029ce38f2 Debug command output26 2022-07-14 12:31:21 -04:00
Mark Gurevich d7566f900e Debug command output23 2022-07-14 11:31:05 -04:00
Mark Gurevich 1a004cc223 Debug command output22 2022-07-14 11:11:35 -04:00
Mark Gurevich 676d8dad4c Debug command output21 2022-07-14 10:49:36 -04:00
Mark Gurevich 8af1d7a302 Debug command output20 2022-07-14 10:31:57 -04:00
Mark Gurevich b0a32dd87e Debug command output19 2022-07-14 10:18:33 -04:00
Mark Gurevich d316e205cf Debug command output18 2022-07-14 10:02:52 -04:00
Mark Gurevich 4cde750b3f Debug command output17 2022-07-14 09:45:05 -04:00
Mark Gurevich f5ee7934c7 Debug command output16 2022-07-14 09:33:07 -04:00
Mark Gurevich f5ac1fece8 Debug command output15 2022-07-13 16:43:38 -04:00
Mark Gurevich 802567ad52 Debug command output14 2022-07-13 16:28:26 -04:00
Mark Gurevich 313244045a Debug command output12 2022-07-13 15:15:54 -04:00
Mark Gurevich b2e74483c7 Debug command output11 2022-07-13 14:50:12 -04:00
Mark Gurevich 25de4415eb Debug command output9 2022-07-13 14:11:33 -04:00
Mark Gurevich d08312bebd Debug passed testcase count 2022-07-13 10:44:23 -04:00
Mark Gurevich c55930f591 Get GitHub action script directory reference31 2022-07-05 12:01:52 -04:00
Mark Gurevich 8876bbdaa2 Get GitHub action script directory reference30 2022-07-05 11:27:27 -04:00
Mark Gurevich 4868dc46dd Get GitHub action script directory reference29 2022-07-01 10:08:01 -04:00
Mark Gurevich 95b63483b4 Get GitHub action script directory reference28 2022-07-01 09:57:51 -04:00
Mark Gurevich cbbbbe43be Get GitHub action script directory reference27 2022-07-01 09:47:49 -04:00
Mark Gurevich 46c5fe518b Get GitHub action script directory reference26 2022-07-01 09:31:12 -04:00
Mark Gurevich db7abfd40d Get GitHub action script directory reference25 2022-07-01 09:20:46 -04:00
Mark Gurevich 56ec6ea8fb Get GitHub action script directory reference24 2022-07-01 09:09:26 -04:00
Mark Gurevich e52c04a4a1 Get GitHub action script directory reference23 2022-06-30 17:03:17 -04:00
Mark Gurevich 3789b2f6e4 Get GitHub action script directory reference22 2022-06-30 16:53:05 -04:00
Mark Gurevich 2042e19801 Get GitHub action script directory reference21 2022-06-30 16:42:49 -04:00
Mark Gurevich b30c81c6da Get GitHub action script directory reference2- 2022-06-30 16:29:38 -04:00
Mark Gurevich bfd0c56339 Get GitHub action script directory reference19 2022-06-30 16:15:32 -04:00
Mark Gurevich 084b0dafa1 Get GitHub action script directory reference18 2022-06-30 16:01:28 -04:00