21692: Test RPM packages for build id conflicts
[arvados.git] / build / package-testing / rpm-common-test-packages.sh
index fb13eff33cfdc33051d1d14c58fca95d16747dd5..b6d7fec46876cd027ef1d34926d6563dd364cefc 100755 (executable)
@@ -17,44 +17,23 @@ fi
 target="$(basename "$0" .sh)"
 target="${target##*-}"
 
-case "$target" in
-    centos*) yum -q clean all ;;
-    rocky*) microdnf --assumeyes clean all ;;
-esac
+microdnf --assumeyes clean all
 touch /var/lib/rpm/*
 
 export ARV_PACKAGES_DIR="/arvados/packages/$target"
 
 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.before"
-
-case "$target" in
-    centos*) yum install --assumeyes -e 0 $1 ;;
-    rocky*) microdnf --assumeyes install $1 ;;
-esac
-
+microdnf --assumeyes install "$1"
 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.after"
-
 diff "$ARV_PACKAGES_DIR/$1".{before,after} >"$ARV_PACKAGES_DIR/$1.diff" || true
 
-# Enable any Software Collections that the package depended on.
-if [[ -d /opt/rh ]]; then
-    # We have to stage the list to a file, because `ls | while read` would
-    # make a subshell, causing the `source` lines to have no effect.
-    scl_list=$(mktemp)
-    ls /opt/rh >"$scl_list"
-
-    # SCL scripts aren't designed to run with -eu.
-    set +eu
-    while read scl; do
-        source scl_source enable "$scl"
-    done <"$scl_list"
-    set -eu
-    rm "$scl_list"
-fi
-
 mkdir -p /tmp/opts
 cd /tmp/opts
 
+# Install other packages alongside to test for build id conflicts.
+# This line can be removed after we have test-provision-rocky8, #21426.
+microdnf --assumeyes install arvados-client arvados-server python3-arvados-python-client
+
 rpm2cpio $(ls -t "$ARV_PACKAGES_DIR/$1"-*.rpm | head -n1) | cpio -idm 2>/dev/null
 
 if [[ "$DEBUG" != "0" ]]; then