repo-install-test: centos8: fix almalinux keys

Run "dnf upgrade almalinux-release" inside centos8/almalinux8 to upgrade
the gpg keys first, in order to prevent gpg key errors while installing
packages. We are not running repo-install-test for centos8 in CI anymore
(SYS#6759), but I'm currently using this configuration to manually test
that fixing permissions during upgrade and running systemd services as
users works as expected on an rpm-based system.

Related: OS#4107
Related: https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
Change-Id: Ia06d24ce7ce48651f5a41489e78b5b55dc2d3921
diff --git a/scripts/repo-install-test.sh b/scripts/repo-install-test.sh
index 7bef5bf..66604f6 100755
--- a/scripts/repo-install-test.sh
+++ b/scripts/repo-install-test.sh
@@ -137,6 +137,15 @@
 			"$@"
 }
 
+qemu_prepare_vm() {
+	case "$DISTRO" in
+	centos8)
+		# https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
+		qemu_ssh dnf upgrade -y almalinux-release
+		;;
+	esac
+}
+
 qemu_run_test_script() {
 	cat <<- EOF > "$TEST_DIR/run-inside-env.sh"
 	#!/bin/sh -ex
@@ -268,4 +277,5 @@
 echo
 set -x
 
+qemu_prepare_vm
 qemu_run_test_script