Skip to content

Commit

Permalink
Re-enable CI on C9S
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaarreell committed Oct 15, 2024
1 parent e3117dd commit c3ffd27
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 31 deletions.
1 change: 1 addition & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
57 changes: 26 additions & 31 deletions setup/install_upstream_keylime/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Check warning

Code scanning / shellcheck

PYTHON_PACKAGES appears unused. Verify use (or export if used externally). Warning test

PYTHON_PACKAGES appears unused. Verify use (or export if used externally).
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
Expand All @@ -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
Expand Down

0 comments on commit c3ffd27

Please sign in to comment.