Add gating tests

Resolves: RHEL-54174

Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
This commit is contained in:
Štěpán Horáček 2024-10-11 15:19:46 +02:00
parent 99620c8298
commit e7b22771fd
4 changed files with 79 additions and 1 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

46
tests/runtest.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# get tpm simulator code
git clone https://git.code.sf.net/p/ibmswtpm2/tpm2 ibmswtpm2-tpm2
# unpackage and build the source
pushd ibmswtpm2-tpm2/src
# fixup for openssl 3
sed -i -e "s|OPENSSL_VERSION_NUMBER >= 0x10200000L|OPENSSL_VERSION_NUMBER > 0x30200020L|" TpmToOsslMath.h
sed -i -e "s|CCFLAGS = -Wall|CCFLAGS = -Wall -Wno-error=deprecated-declarations|" makefile
make
res="$?"
if [[ "$res" -ne 0 ]]; then
echo "make of ibmtpm failed"
popd
rm -rf ibmtpm ibmtpm$IBMTPM_VERSION.tar.gz
exit 1
fi
(./tpm_server)&
popd
sleep 10
export TPM_INTERFACE_TYPE=socsim
# use the tss2 tests from the sources
pushd ./source/utils
# fix python calls to use rhel name for python3
sed -i -e 's/^PREFIX=\.\//PREFIX=tss/g' reg.sh
# fix paths in rootcerts.txt
c=`pwd`
sed -i "s|/home/kgold/tss2/utils|${c}|" certificates/rootcerts.txt
# run the tests
TPM_TSS_NODEPRECATEDALGS=1 ./reg.sh -a
res="$?"
popd
# clean up
pkill tpm_server
rm -rf ibmtpm tss
exit $res

22
tests/tests.yml Normal file
View File

@ -0,0 +1,22 @@
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- classic
required_packages:
- gcc
- make
- wget
- openssl
- openssl-devel
- sed
- tss2
- git
tests:
- ibm-tss2:
dir: .
run: ./runtest.sh
timeout: 30m

View File

@ -9,7 +9,7 @@ Name: tss2
# this is the release of the TSS library
Version: 2.3.2
# this is the release of the fedora package, goes back to 1 when version changes
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
Summary: IBM's TCG Software Stack (TSS) for TPM 2.0 and related utilities
@ -79,6 +79,10 @@ find %{buildroot} -type f -name "*.la" -delete -print
%doc ibmtss.docx
%changelog
* Fri Oct 11 2024 Štěpán Horáček <shoracek@redhat.com> - 1:2.3.2-2
- Version bump
- Resolves: RHEL-54174
* Thu Oct 3 2024 Štěpán Horáček <shoracek@redhat.com> - 1:2.3.2-1
- Update to 2.3.2
- Resolves: RHEL-54174