Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent(rhel8): move the C8S jobs to C9S #727

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions agent/bootstrap-rhel8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ADDITIONAL_DEPS=(

# Install and enable EPEL
cmd_retry dnf -y install epel-release epel-next-release dnf-plugins-core
cmd_retry dnf config-manager --enable epel --enable powertools
cmd_retry dnf config-manager --enable epel --enable crb
# Upgrade the machine to get the most recent environment
cmd_retry dnf -y upgrade
# Install systemd's build dependencies
Expand Down Expand Up @@ -186,7 +186,10 @@ fi
-Dslow-tests=true
-Dtests=unsafe
-Dinstall-tests=true
--werror
# FIXME?: --werror
# gcc in RHEL 9 has some additional warnings enabled for which we don't have the respective
# patches in RHEL 8's systemd
#--werror
-Dman=true
-Dhtml=true
)
Expand Down Expand Up @@ -220,6 +223,27 @@ else
CGROUP_KERNEL_ARGS="systemd.unified_cgroup_hierarchy=0 systemd.legacy_systemd_cgroup_controller=1"
fi

# Disable irqbalance, as we don't really need it and it sometimes SIGTRAPs, causing spurious
# coredumps
systemctl disable --now irqbalance

# dbus-broker on RHEL 9 is not compatible with systemd < 243, so replace it with dbus-daemon
dnf -y install dbus-daemon
systemctl disable dbus-broker
systemctl disable --global dbus-broker
systemctl enable dbus-daemon
systemctl enable --global dbus-daemon

# Several test/test-functions tweaks to make it work with RHEL 9
#
# RHEL 8's test/test-functions overwrites $QEMU_OPTIONS instead of appending to
# it, so setting it as usual won't work. Let's, temporarily, patch
# test/test-functions directly
sed -i '0,/QEMU_OPTIONS=".*/s//&\n-cpu Nehalem \\/' test/test-functions
# Make it work on systems where dbus-broker is the default
sed -i '/dbus.service/d' test/test-functions
sed -i '/dbus.socket/a\ inst /etc/systemd/system/dbus.service' test/test-functions

# Let's check if the new systemd at least boots before rebooting the system
(
# Ensure the initrd contains the same systemd version as the one we're
Expand All @@ -228,7 +252,7 @@ fi
# comments in `testsuite.sh` for the explanation
export INITRD="/var/tmp/ci-sanity-initramfs-$(uname -r).img"
cp -fv "/boot/initramfs-$(uname -r).img" "$INITRD"
dracut --kver "$LATEST_KERNEL" -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD"
dracut --kver "$LATEST_KERNEL" -o "multipath rngd dbus-broker" -a dbus-daemon --filesystems ext4 --rebuild "$INITRD"

centos_ensure_qemu_symlink

Expand All @@ -243,7 +267,11 @@ fi
export QEMU_TIMEOUT=600
# Disable nspawn version of the test
export TEST_NO_NSPAWN=1
export QEMU_OPTIONS="-cpu max"
# Work around 'Fatal glibc error: CPU does not support x86-64-v2'
# See:
# - https://bugzilla.redhat.com/show_bug.cgi?id=2060839
# - https://access.redhat.com/solutions/6833751
export QEMU_OPTIONS="-cpu Nehalem"

make -C test/TEST-01-BASIC clean setup run clean

Expand All @@ -257,7 +285,7 @@ fi
SYSTEMD_LOG_LEVEL=debug systemctl daemon-reexec
[[ -n "${XDG_RUNTIME_DIR:-}" ]] && SYSTEMD_LOG_LEVEL=debug systemctl --user daemon-reexec

dracut -f --regenerate-all
dracut -o dbus-broker -a dbus-daemon -f --regenerate-all

# Check if the new dracut image contains the systemd module to avoid issues
# like systemd/systemd#11330
Expand Down
24 changes: 21 additions & 3 deletions agent/testsuite-rhel8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,18 @@ sed -i '/TEST_LIST=/aTEST_LIST=("${TEST_LIST[@]/\\/usr\\/lib\\/systemd\\/tests\\
# See:
# https://github.com/systemd/systemd/commit/fd23f9c9a70e1214507641d327da40d1688b74d7
# https://github.com/systemd/systemd/commit/a1e3f0f38b43e68ff9ea33ab1935aed4edf6ed7f
echo 'int main(void) { return 77; }' > src/test/test-barrier.c
echo 'int main(void) { return 77; }' >src/test/test-barrier.c

# FIXME (not really): test-execute and parse-hwdb
# Both tests are not compatible with newer packages on RHEL 9 and backporting all the necessary stuff would
# be a major PITA. Since we run both of these tests in other CIs (both externally and internally), let's just
# not bother here.
echo 'int main(void) { return 77; }' >src/test/test-execute.c
cat >hwdb/parse_hwdb.py <<EOF
#!/usr/bin/python3
import sys
sys.exit(77)
EOF

# Run the internal unit tests (make check)
exectask "ninja-test" "meson test -C build --print-errorlogs --timeout-multiplier=3"
Expand Down Expand Up @@ -111,7 +122,7 @@ export INITRD="/var/tmp/ci-initramfs-$(uname -r).img"
# command line arguments the original initrd was built with)
cp -fv "/boot/initramfs-$(uname -r).img" "$INITRD"
# Rebuild the original initrd without the multipath module
dracut -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD"
dracut -o "multipath rngd dbus-broker" -a dbus-daemon --filesystems ext4 --rebuild "$INITRD"

for t in test/TEST-??-*; do
if [[ ${#SKIP_LIST[@]} -ne 0 ]] && in_set "$t" "${SKIP_LIST[@]}"; then
Expand All @@ -132,7 +143,14 @@ for t in test/TEST-??-*; do
# Set QEMU_SMP appropriately (regarding the parallelism)
# OPTIMAL_QEMU_SMP is part of the common/task-control.sh file
export QEMU_SMP=$OPTIMAL_QEMU_SMP
export QEMU_OPTIONS="-cpu max"
# Work around 'Fatal glibc error: CPU does not support x86-64-v2'
# See:
# - https://bugzilla.redhat.com/show_bug.cgi?id=2060839
# - https://access.redhat.com/solutions/6833751
export QEMU_OPTIONS="-cpu Nehalem"
# Several syscalls we need are not whitelisted by default in RHEL 8's systemd, but systemd knows
# about them, so let's tell it to whitelist all known syscalls
export NSPAWN_ARGUMENTS="--system-call-filter=@known"

# Suffix the $TESTDIR of each retry with an index to tell them apart
export MANGLE_TESTDIR=1
Expand Down
5 changes: 3 additions & 2 deletions common/task-control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ exectask_retry() {
local task_command="${2:?Missing task command}"
local retries="${3:-$TASK_RETRY_DEFAULT}"
local ec=0
local orig_testdir
local orig_testdir orig_nspawn_arguments

for ((i = 1; i <= retries; i++)); do
local logfile="$LOGDIR/${task_name}_${i}.log"
Expand All @@ -202,7 +202,8 @@ exectask_retry() {
rm -f "$TESTDIR/pass"

# Also, set a unique name for each nspawn container to prevent scope clash
export NSPAWN_ARGUMENTS="--machine=${task_name}--${i}"
orig_nspawn_arguments="${orig_nspawn_arguments:-$NSPAWN_ARGUMENTS}"
export NSPAWN_ARGUMENTS="$orig_nspawn_arguments --machine=${task_name}--${i}"
fi

# shellcheck disable=SC2086
Expand Down
4 changes: 2 additions & 2 deletions jenkins/runners/rhel8-centos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ git clone https://github.com/systemd/systemd-centos-ci
cd systemd-centos-ci

# RHEL 8 job with legacy cgroup hierarchy
./agent-control.py --no-index --pool virt-ec2-t2-centos-8s-x86_64 \
./agent-control.py --no-index --pool virt-ec2-t2-centos-9s-x86_64 \
--bootstrap-script="bootstrap-rhel8.sh" \
--bootstrap-args="-h legacy" \
--testsuite-script="testsuite-rhel8.sh" \
Expand All @@ -50,7 +50,7 @@ cd systemd-centos-ci
# RHEL 8.1 branches
if [[ "$TARGET_BRANCH" != "rhel-8.0.0" && "$TARGET_BRANCH" != "rhel-8.1.0" ]]; then
# RHEL 8 job with unified cgroup hierarchy
./agent-control.py --no-index --pool virt-ec2-t2-centos-8s-x86_64 \
./agent-control.py --no-index --pool virt-ec2-t2-centos-9s-x86_64 \
--bootstrap-script="bootstrap-rhel8.sh" \
--bootstrap-args="-h unified" \
--testsuite-script="testsuite-rhel8.sh" \
Expand Down
Loading