2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-19 17:02:15 +00:00
Files
xcat-core/.github/workflows/xcat_test.yml
T
Daniel Hilst 4509c4bb5d fix(xcat-core): the ISC path got no IPv6 reverse zone, and the Kea test passed under JSON::PP
getzonesfornet in dhcp.pm rounded the prefix itself and passed the rounded value beside a
network that still carried its own. getIPv6PrefixLength prefers the embedded prefix, so the
rounded value was ignored and no reverse zone was written at all: dhcpd updated no PTR record
for a /62 or /126 network and reported nothing. The ddns.pm copy stripped the prefix first and
was unaffected, so the previous commit's claim that both copies were fixed was wrong.

The zones now come from xCAT::NetworkUtils::getIPv6ReverseZones, which both copies call. A
network whose prefix is not a multiple of 4 is covered by the zones of the next nibble -- a /62
by its four /64 zones -- which is what the IPv4 arm does with a /22. Rounding down to the /60
made xCAT answer for three networks it does not own.

kea_subnet_id_numeric.t only observes the encoding under the XS backend, and passed 6 of 6
under JSON::PP with the bug in place. It skips unless JSON->backend is the XS one, and the
workflow installs libjson-xs-perl so the backend is there.

dhcp6_boot_server now reports a substituted boot server, so an unresolvable tftpserver is not
silent, and the caller reports a warning that arrives with a server. The routine also moved
below grub2_node_loader, whose comment it had separated from it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 11:38:48 -03:00

159 lines
8.7 KiB
YAML

name: xcat_test
on: [pull_request, workflow_dispatch]
jobs:
xcat_pr_test:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Refresh package indexes
run: sudo apt-get update
- name: Install dependencies
run: sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests bats bubblewrap cpio xz-utils gzip gawk mawk jq socat rpm rsyslog build-essential fakeroot reprepro devscripts debhelper libcapture-tiny-perl libfile-slurper-perl libjson-perl libjson-xs-perl libyaml-pp-perl libparallel-forkmanager-perl libsoap-lite-perl libdbi-perl libdbd-sqlite3-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common grub-common grub-efi-amd64-bin squashfs-tools pigz python3-yaml
- name: Enable postscript test namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Install lifecycle test dependencies
run: sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests ucf debconf-utils systemd libxml-simple-perl apache2 curl
- name: Test Debian package lifecycle
run: prove -v xCAT-test/native/xcatd_debian_lifecycle.t xCAT-test/native/xcatd_restart_callers.t xCAT-test/native/debian_chroot_services.t xCAT-test/native/debian_management_recovery.t xCAT-test/native/apache_package_lifecycle.t xCAT-test/native/package_upgrade_logging.t xCAT-test/native/profile_package_payload.t
- name: Test optional statelite host keys
if: ${{ !cancelled() }}
run: prove -v xCAT-test/native/statelite_optional_hostkey.t
- name: Test Cumulus discovery key failure
if: ${{ !cancelled() }}
run: bats xCAT-test/native/cumulus_discovery_key_failure.bats
- name: Test FIPS package artifacts
if: ${{ !cancelled() }}
run: prove -v xCAT-test/native/fips_build_guard.t xCAT-test/native/fips_package_payload.t
- name: Install image test dependencies
if: ${{ !cancelled() }}
run: sudo apt-get install -y --no-install-recommends cpio gzip libdbd-sqlite3-perl libxml-simple-perl libnet-dns-perl
- name: Exercise image driver selection
if: ${{ !cancelled() }}
run: prove xCAT-test/native/genimage_network_drivers.t
- name: Exercise image package policy
if: ${{ !cancelled() }}
run: prove xCAT-test/native/el10_image_package_policy.t
- name: Exercise image chroot mounts
if: ${{ !cancelled() }}
run: prove xCAT-test/native/rh_genimage_chroot_mounts.t
- name: Check Debian probe payload permissions
if: ${{ !cancelled() }}
run: bats xCAT-test/native/probe_debian_permissions.bats
- name: Test isolated system scripts
if: ${{ !cancelled() }}
run: |
workdir=$(sudo mktemp -d /tmp/xcat-script-tests.XXXXXX)
trap 'sudo rm -rf -- "$workdir"' EXIT
sudo cp -R xCAT-test xCAT-server perl-xCAT xCAT "$workdir/"
status=0
sudo sh -c 'cd "$1" && bats xCAT-test/native/getinstdisk_selection.bats' sh "$workdir" || status=1
sudo sh -c 'cd "$1" && bats xCAT-test/native/syslog_log_directory.bats' sh "$workdir" || status=1
sudo sh -c 'cd "$1" && prove -v xCAT-test/native/getinstdisk_installer.t xCAT-test/native/enablekdump_per_node.t xCAT-test/native/sudoer_password_source.t xCAT-test/native/remoteshell_credentials.t' sh "$workdir" || status=1
exit "$status"
- name: Prepare xCAT syslog directory
if: ${{ !cancelled() }}
run: sudo install -d -o syslog -g adm -m 0750 /var/log/xcat
- name: Run Ubuntu image fixture tests
if: ${{ !cancelled() }}
run: >-
prove xCAT-test/native/ubuntu_live_media_guardrails.t
xCAT-test/native/ubuntu_genimage_debootstrap_arch.t
xCAT-test/native/ubuntu_genimage_apt_mirror.t
xCAT-test/native/ubuntu_genimage_resolver_libs.t
- name: Exercise the liteimg ramdisk archive
if: ${{ !cancelled() }}
run: prove xCAT-test/native/liteimg_ramdisk_archive.t
- name: Exercise the UFTP listener
if: ${{ !cancelled() }}
run: prove xCAT-test/native/uftp_listener.t
- name: Run tests
if: ${{ !cancelled() }}
run: perl github_action_xcat_test.pl
- name: Install package test dependencies
id: package-deps
if: ${{ !cancelled() }}
run: sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests cpio createrepo-c zstd rsync gnupg libxml-libxml-perl python3-rpm
- name: Exercise probe package payloads
if: ${{ !cancelled() && steps.package-deps.outcome == 'success' }}
run: prove xCAT-test/native/probe_package_payload.t
- name: Exercise release repositories
if: ${{ !cancelled() && steps.package-deps.outcome == 'success' }}
run: prove xCAT-test/native/release_repository.t
- name: Check parsed package relations
if: ${{ !cancelled() && steps.package-deps.outcome == 'success' }}
run: prove xCAT-test/native/package_relations.t
# Ubuntu ships no mock, so the mock result directory test runs as root on Fedora.
- name: Run mock result directory test
run: |
set -o pipefail
docker run --rm -v "$PWD:/src:ro" -w /src fedora:42 bash -ec '
dnf -y -q install mock perl perl-File-Slurper >/dev/null
prove -v xCAT-test/native/mock_resultdir_owner.t \
xCAT-test/native/build_sources_other_uid.t' 2>&1 | tee mock.tap
if grep -iE '# skip' mock.tap; then
echo 'a mock result directory test was skipped' >&2
exit 1
fi
- name: Run profile artifact tests
if: ${{ !cancelled() }}
working-directory: ${{ runner.temp }}/xcat-core-unitsrc
shell: bash
run: |
log=$(mktemp)
trap 'rm -f -- "$log"' EXIT
prove -v xCAT-test/native/install_profile_riscv64.t xCAT-test/native/netboot_profile_riscv64.t xCAT-test/native/netboot_profile_postinstall.t xCAT-test/native/builddebs_riscv64.t xCAT-test/native/ubuntu_subiquity_template.t | tee "$log"
! grep -qi skipped "$log"
rpm_lifecycle_test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- image: almalinux:8
repository: powertools
- image: almalinux:10
repository: crb
container:
image: ${{ matrix.image }}
options: --privileged --init
steps:
- uses: actions/checkout@v6
- name: Install lifecycle test dependencies
run: |
dnf install -y epel-release
dnf --enablerepo=${{ matrix.repository }} install -y perl perl-Capture-Tiny perl-File-Slurper perl-Test-Simple perl-DBI perl-DBD-SQLite perl-JSON perl-XML-Simple rpm-build bubblewrap dash systemd chkconfig initscripts tar gzip bzip2 which diffutils httpd curl procps-ng openssl
- name: Enable lifecycle test namespaces
run: sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Test RPM package lifecycle
run: su -s /bin/sh nobody -c 'prove -v xCAT-test/native/xcatd_rpm_lifecycle.t xCAT-test/native/xcatd_relocated_startup.t xCAT-test/native/apache_rpm_configuration.t xCAT-test/native/apache_package_lifecycle.t xCAT-test/native/package_upgrade_logging.t xCAT-test/native/profile_package_payload.t'
- name: Test FIPS package artifacts
if: ${{ !cancelled() }}
run: su -s /bin/sh nobody -c 'prove -v xCAT-test/native/fips_package_payload.t'
- name: Test netboot postinstall profiles
if: ${{ !cancelled() }}
run: su -s /bin/sh nobody -c 'prove -v xCAT-test/native/netboot_profile_postinstall.t'
selinux_policy_test:
runs-on: ubuntu-24.04
timeout-minutes: 20
container:
image: almalinux:10
options: --privileged
steps:
- uses: actions/checkout@v6
- name: Install policy test dependencies
run: |
dnf install -y epel-release
dnf --enablerepo=crb install -y make selinux-policy-devel selinux-policy-targeted libselinux-utils policycoreutils policycoreutils-python-utils attr perl perl-Capture-Tiny perl-Test-Simple perl-Test-Harness
- name: Look up and relabel the xCAT file contexts
run: |
mkdir -p /mnt/labels
mount -t tmpfs -o size=1g tmpfs /mnt/labels
TMPDIR=/mnt/labels prove -v xCAT-test/native/selinux_file_contexts.t
- name: Repair a published artifact and keep the guest labels
if: ${{ !cancelled() }}
run: TMPDIR=/mnt/labels prove -v xCAT-test/native/selinux_image_repair.t