#!/bin/bash
# Clean version compatibility fixture; no existing database and no Python build.
fail() { printf 'ERROR: %s\n' "$*" >&2; exit 1; }
[[ $(id -u) == 0 && -f /run/sdp-container-test && -d /inputs/sdp ]] || fail 'Disposable root container/source required.'
[[ $(cat /proc/1/comm) == systemd ]] || fail 'PID 1 must be systemd.'
[[ $# == 1 && "$1" =~ ^r[0-9]{2}\.[0-9]+$ ]] || fail 'One release argument is required.'
[[ ! -e /p4 && ! -L /p4 ]] || fail 'Version fixtures must start without an existing installation.'
mkdir -p /results /inputs/binaries || exit 1
bash /inputs/sdp/test/containers/download_binaries.sh "$1" /inputs/binaries /results || exit 1
cp /inputs/sdp/.export-manifest.json /results/source-manifest.json || exit 1
cp /etc/os-release /results/os-release || exit 1
/inputs/sdp/test/reset.sh --root /srv/sdp-test-integration --instance 1 --port 19999 --os-user perforce \
--source /inputs/sdp --p4 /inputs/binaries/p4 --p4d /inputs/binaries/p4d \
--p4broker /inputs/binaries/p4broker --p4p /inputs/binaries/p4p \
--initialize --confirm-disposable > /results/provision.log 2>&1 || fail 'Actual mkdirs provisioning failed.'
cp /srv/sdp-test-integration/mkdirs.cfg /results/mkdirs.cfg || exit 1
printf '/srv/sdp-test-integration/sdp/Server/Unix/setup/mkdirs.sh /srv/sdp-test-integration/mkdirs.cfg\n' > /results/installer-command.txt || exit 1
/p4/1/bin/p4d_1_init stop >> /results/provision.log 2>&1 || fail 'Cannot transfer fixture service to systemd.'
cat > /etc/systemd/system/p4d_1.service <<'UNIT'
[Unit]
Description=Disposable SDP version compatibility instance 1
After=network.target
[Service]
Type=forking
User=perforce
Environment=OS_INIT_MECHANISM=systemd
PIDFile=/p4/1/root/server.pid
ExecStart=/p4/1/bin/p4d_1_init start
ExecStop=/p4/1/bin/p4d_1_init stop
TimeoutStartSec=180
TimeoutStopSec=180
[Install]
WantedBy=multi-user.target
UNIT
[[ $? == 0 ]] || exit 1
printf 'perforce ALL=(root) NOPASSWD: /usr/bin/systemctl * p4d_1, /usr/bin/systemctl * p4d_1.service\n' > /etc/sudoers.d/sdp-version-test || exit 1
chmod 440 /etc/sudoers.d/sdp-version-test || exit 1
visudo -cf /etc/sudoers.d/sdp-version-test || exit 1
systemctl daemon-reload && systemctl enable --now p4d_1.service || fail 'Systemd service failed.'
DISTRO=${SDP_DISTRO_PYTHON:-/usr/bin/python3}
"$DISTRO" -m venv /opt/sdp-version-python || fail 'Distro venv failed.'
/opt/sdp-version-python/bin/python3 -m pip install --only-binary=:all: 'p4python==2026.1.*' > /results/python-install.log 2>&1 || fail 'P4Python installation failed.'
[[ ! -e /p4/common/python && ! -L /p4/common/python ]] || fail 'Unexpected Python installation.'
ln -s /opt/sdp-version-python /p4/common/python || exit 1
/opt/sdp-version-python/bin/python3 -c 'import sys,P4; print(sys.version); print(P4.P4.identify())' > /results/python-version.txt || exit 1
systemctl is-active --quiet p4d_1.service || fail 'Service is not active.'
printf 'Clean version compatibility installation complete.\n'
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 34004 | Russell C. Jackson (Rusty) |
Improve SDP backup/recovery, Maintenance, logging and cloud operation. Add owned checkpoint locks, recovery-aware retention, preserved database switches, bounded cleanup and coordinated AWS/Azure snapshots. Fix service-user password initialization, edge staging, standby promotion state parsing, proxy cache setup, typed depot verification and historical-server configuration/error handling. Remove unused OTP programs; keep Windows removed, server.locks cleanup and the journal-count condition unchanged. Add no global shell strict modes. Update operational documentation and add reproducible mkdirs.sh/mkdirs.cfg container assurance. Validate Ubuntu 26.04 and UBI 8.10/9.8/10.2 across both Python runtimes: 44 stages; 428 offline tests per runtime/OS, zero offline skips; 19 deployed-archive comparisons per combination. Three six-node topology runs pass all 30 recovery/failure scenarios. P4D 2023.1 through 2026.1 on UBI 8/9 pass all 14 cells and 98 scenarios. Static, documentation and provenance checks pass. Containers do not certify every fleet kernel, patch build or integration. Tested source manifest SHA-256: e1a23e17b8ced8c1148d9a250589977c6f6e98606bf2a81dc3ff5d7c909e3695 Deployed comparison archive SHA-256: 1bd23217356ee3808e040d39aea5be9519bda7c8f2b4924656a70aff8ad7293a |