From 8c2ecab18c8300b601817a5b361c430fb7ae938f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:27:17 -0300 Subject: [PATCH 1/2] 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> --- xCAT-test/debian/control | 8 ++- xCAT-test/unit/xcat_test_scapy_optional.t | 59 +++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 xCAT-test/unit/xcat_test_scapy_optional.t diff --git a/xCAT-test/debian/control b/xCAT-test/debian/control index 5603e4605c..2ab87adc1d 100644 --- a/xCAT-test/debian/control +++ b/xCAT-test/debian/control @@ -8,7 +8,13 @@ Homepage: https://xcat.org/ Package: xcat-test Architecture: all -Depends: ${perl:Depends}, python3-scapy +Depends: ${perl:Depends} +# Only blackboxtest's DHCP steps need scapy, and dhcp.py imports it inside scapy_module(), +# which raises UnsupportedError naming this package when the import fails. So xcat-test +# installs and every other step runs without it, which is why xCAT-test.spec has only ever +# recommended it. A hard Depends: also pulls scapy's own recommends -- matplotlib, scipy and +# ipython3, about 255 MB over 54 packages -- into a CI step capped at 1200 seconds. +Recommends: python3-scapy Description: xCAT automated test tool Provides automated test tool and buckets to help test xCAT commands automatically. diff --git a/xCAT-test/unit/xcat_test_scapy_optional.t b/xCAT-test/unit/xcat_test_scapy_optional.t new file mode 100644 index 0000000000..9b22576723 --- /dev/null +++ b/xCAT-test/unit/xcat_test_scapy_optional.t @@ -0,0 +1,59 @@ +#!/usr/bin/env perl +# SCAPY IS OPTIONAL, AND THE TWO PACKAGINGS MUST AGREE THAT IT IS. +# +# Only blackboxtest's DHCP steps need scapy. dhcp.py is the single module that imports it, and it +# does so inside scapy_module(), which raises UnsupportedError naming python3-scapy when the import +# fails -- so the package installs and every other blackboxtest step runs without it. +# +# xCAT-test.spec says exactly that and only RECOMMENDS the package, with the reason in a comment: +# a hard Requires: would make xCAT-test uninstallable on a management node without EPEL. +# debian/control said `Depends:`, which is the same claim with the opposite answer. +# +# 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 and about 255 MB, inside a +# step the GitHub workflow caps at 1200 seconds. On 2026-10-23 that download stalled and killed +# xcat_pr_test on xcat-core/#7974 at exactly 1200s, while a sibling run on another runner did the +# same install in 19 seconds. +# +# A packaging manifest is the artifact here -- there is nothing to execute and the text is the +# contract -- which is why this asserts on the files rather than on a build. +use strict; +use warnings; +use Test::More; +use FindBin; +use File::Slurper qw(read_text); + +my $root = "$FindBin::Bin/../.."; +my $control = "$root/xCAT-test/debian/control"; +my $spec = "$root/xCAT-test/xCAT-test.spec"; +ok(-f $control, 'xCAT-test/debian/control is present') or die "no control file\n"; +ok(-f $spec, 'xCAT-test/xCAT-test.spec is present') or die "no spec\n"; + +my $ctext = read_text($control); +my $stext = read_text($spec); + +# The xcat-test stanza, not the source stanza: Build-Depends lives above it. +my ($stanza) = $ctext =~ /^Package:\s*xcat-test\s*$(.*?)(?:^Package:|\z)/ms; +ok(defined $stanza && length $stanza, 'the xcat-test binary stanza is found') + or die "cannot isolate the xcat-test stanza\n"; + +my ($depends) = $stanza =~ /^Depends:\s*(.*)$/m; +my ($recommends) = $stanza =~ /^Recommends:\s*(.*)$/m; + +ok(defined $depends, 'xcat-test declares Depends'); +unlike($depends // '', qr/python3-scapy/, + 'python3-scapy is NOT a hard Depends of xcat-test'); +like($recommends // '', qr/python3-scapy/, + 'python3-scapy is Recommended instead'); +# The perl dependency is what makes the package work at all and must survive the change. +like($depends // '', qr/\$\{perl:Depends\}/, 'the perl dependency is still a Depends'); + +# PARITY. The two packagings answer the same question, so they must answer it the same way: the +# spec has recommended it since the tool was added, and the asymmetry is what this fixes. +like($stext, qr/^Recommends:\s*python3-scapy\s*$/m, 'the EL spec recommends python3-scapy'); +unlike($stext, qr/^Requires:[^\n]*python3-scapy/m, '... and does not require it'); + +# The reason belongs next to the decision, in both files, or the next person reverts it. +like($stanza, qr/scapy/i, 'the control stanza explains the choice'); + +done_testing; From b7076359f420ef45a8e318969ce939645cb2718f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:42:47 -0300 Subject: [PATCH 2/2] 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> --- xCAT-test/debian/control | 9 +++------ xCAT-test/unit/xcat_test_scapy_optional.t | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-test/debian/control b/xCAT-test/debian/control index 2ab87adc1d..2ce6662a06 100644 --- a/xCAT-test/debian/control +++ b/xCAT-test/debian/control @@ -8,12 +8,9 @@ Homepage: https://xcat.org/ Package: xcat-test Architecture: all -Depends: ${perl:Depends} -# Only blackboxtest's DHCP steps need scapy, and dhcp.py imports it inside scapy_module(), -# which raises UnsupportedError naming this package when the import fails. So xcat-test -# installs and every other step runs without it, which is why xCAT-test.spec has only ever -# recommended it. A hard Depends: also pulls scapy's own recommends -- matplotlib, scipy and -# ipython3, about 255 MB over 54 packages -- into a CI step capped at 1200 seconds. +Depends: ${perl:Depends}, python3 +# blackboxtest needs python3. Only its DHCP steps need scapy, and dhcp.py reports a missing +# scapy itself. A hard Depends: on scapy also installs about 255 MB of its Recommends. Recommends: python3-scapy Description: xCAT automated test tool Provides automated test tool and buckets to help test xCAT commands diff --git a/xCAT-test/unit/xcat_test_scapy_optional.t b/xCAT-test/unit/xcat_test_scapy_optional.t index 9b22576723..a7097156c8 100644 --- a/xCAT-test/unit/xcat_test_scapy_optional.t +++ b/xCAT-test/unit/xcat_test_scapy_optional.t @@ -47,6 +47,9 @@ like($recommends // '', qr/python3-scapy/, 'python3-scapy is Recommended instead'); # The perl dependency is what makes the package work at all and must survive the change. like($depends // '', qr/\$\{perl:Depends\}/, 'the perl dependency is still a Depends'); +# blackboxtest is a python3 program. Without scapy, nothing else pulls in the interpreter. +my @hard = map { s/^\s+|\s+$//gr } split /,/, $depends // ''; +ok((grep { /^python3(?:\s|$)/ } @hard), 'python3 is a hard Depends of xcat-test'); # PARITY. The two packagings answer the same question, so they must answer it the same way: the # spec has recommended it since the tool was added, and the asymmetry is what this fixes.