From c3ffd2733ca25056801a678e6ec224d4cfc23892 Mon Sep 17 00:00:00 2001 From: Karel Srot Date: Tue, 15 Oct 2024 11:45:31 +0200 Subject: [PATCH] Re-enable CI on C9S --- .packit.yaml | 1 + setup/install_upstream_keylime/test.sh | 57 ++++++++++++-------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index ee8762da..ae054d3e 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -7,6 +7,7 @@ jobs: #- fedora-branched - fedora-all - centos-stream-10-x86_64 + - centos-stream-9-x86_64 skip_build: true tf_extra_params: environments: diff --git a/setup/install_upstream_keylime/test.sh b/setup/install_upstream_keylime/test.sh index c1341486..7133cbae 100755 --- a/setup/install_upstream_keylime/test.sh +++ b/setup/install_upstream_keylime/test.sh @@ -10,46 +10,41 @@ rlJournalStart rlPhaseStartTest "Install keylime and its dependencies" - # remove all install keylime packages - rlRun "yum remove -y --noautoremove python3-keylime\* keylime\*" - # build and install keylime-99 dummy RPM - rlRun -s "rpmbuild -bb keylime.spec" - RPMPKG=$( awk '/Wrote:/ { print $2 }' $rlRun_LOG ) - # replace installed keylime with our newly built dummy package - rlRun "rpm -Uvh $RPMPKG" - EXTRA_PKGS="python3-lark-parser python3-packaging" - # for RHEL8 and CentOS Stream8 configure Sergio's copr repo providing necessary dependencies - if rlIsRHEL 8 || rlIsCentOS 8; then - rlRun 'cat > /etc/yum.repos.d/keylime.repo <<_EOF -[copr:copr.fedorainfracloud.org:scorreia:keylime] -name=Copr repo for keylime owned by scorreia -baseurl=https://download.copr.fedorainfracloud.org/results/scorreia/keylime/centos-stream-\$releasever-\$basearch/ -type=rpm-md -skip_if_unavailable=True -gpgcheck=1 -gpgkey=https://download.copr.fedorainfracloud.org/results/scorreia/keylime/pubkey.gpg -repo_gpgcheck=0 -enabled=1 -enabled_metadata=1 -priority=999 -_EOF' - EXTRA_PKGS="python3-pip" - rlIsRHEL '<10' && EXTRA_DNF_ARGS="--enablerepo epel" || EXTRA_DNF_ARGS="" - EXTRA_PIP_PKGS="packaging lark-parser typing_extensions" - elif rlIsRHEL 9 || rlIsCentOS 9; then - EXTRA_PKGS+=" python3-typing-extensions" + EXTRA_PKGS="git-core libselinux-python3 patch procps-ng tpm2-abrmd tpm2-tss tpm2-tools rpm-build" + PYTHON_PACKAGES="python3-alembic python3-cryptography python3-gpg python3-jinja2 python3-jsonschema python3-pip python3-psutil python3-pyasn1 python3-pyasn1-modules python3-pyyaml python3-requests python3-sqlalchemy python3-tornado python3-lark-parser python3-packaging" + if rlIsRHELLike 9; then + EXTRA_PKGS+=" gpgme gpgme-devel" + PYTHON_PKGS="python3.12 python3.12-setuptools python3.12-pip python3.12-requests python3.12-pyyaml python3.12-wheel python3-gpg" + EXTRA_PIP_PKGS="typing-extensions cryptography packaging pyasn1 pyasn1-modules jinja2 lark jsonschema tornado sqlalchemy psutil alembic" elif rlIsFedora 36; then EXTRA_PKGS+=" python3-pip" EXTRA_PIP_PKGS="typing_extensions" fi - rlRun "yum -y install git-core libselinux-python3 patch procps-ng python3-alembic python3-cryptography python3-gpg python3-jinja2 python3-jsonschema python3-pip python3-psutil python3-pyasn1 python3-pyasn1-modules python3-pyyaml python3-requests python3-sqlalchemy python3-tornado tpm2-abrmd tpm2-tss tpm2-tools ${EXTRA_PKGS} ${EXTRA_DNF_ARGS}" + rlRun "yum -y install ${EXTRA_PKGS} ${PYTHON_PKGS} ${EXTRA_DNF_ARGS}" if [ -z "$KEYLIME_TEST_DISABLE_REVOCATION" ] && rlIsFedora; then rlRun "yum -y install python3-zmq" fi # need to install few more pgs from pip if [ -n "$EXTRA_PIP_PKGS" ]; then - rlRun "pip3 install $EXTRA_PIP_PKGS" + if rlIsRHELLike 9; then + rlRun "pip3.12 install $EXTRA_PIP_PKGS" + else + rlRun "pip3 install $EXTRA_PIP_PKGS" + fi fi + # need to fake python3.12-gpg since it cannot be installed + if rlIsRHELLike 9; then + rlRun "cp -r /usr/lib64/python3.9/site-packages/gpg /usr/lib64/python3.12/site-packages/" + rlRun "find /usr/lib64/python3.12/site-packages/gpg -name __pycache__ -exec rm -rf {} \\;" 0,1 + rlRun "mv /usr/lib64/python3.12/site-packages/gpg/_gpgme.cpython-39-x86_64-linux-gnu.so /usr/lib64/python3.12/site-packages/gpg/_gpgme.cpython-312-x86_64-linux-gnu.so" + fi + # remove all install keylime packages + rlRun "yum remove -y --noautoremove python3-keylime\* keylime\*" + # build and install keylime-99 dummy RPM + rlRun -s "rpmbuild -bb keylime.spec" + RPMPKG=$( awk '/Wrote:/ { print $2 }' $rlRun_LOG ) + # replace installed keylime with our newly built dummy package + rlRun "rpm -Uvh $RPMPKG" if [ -d /var/tmp/keylime_sources ]; then rlLogInfo "Installing keylime from /var/tmp/keylime_sources" else @@ -71,7 +66,7 @@ _EOF' [ -d /usr/local/lib/python*/site-packages/keylime-*/keylime/migrations ] && rlRun "rm -rf /usr/local/lib/python*/site-packages/keylime-*/keylime/migrations" [ -d /etc/keylime ] && rlRun "mv /etc/keylime /etc/keylime.backup$$" && "rm -rf /etc/keylime" rlRun "mkdir -p /etc/keylime && chmod 700 /etc/keylime" - rlRun "python3 setup.py install" + rlRun "python3.12 setup.py install" # create directory structure in /etc/keylime and copy config files there for comp in "verifier" "tenant" "registrar" "ca" "logging"; do