add tmt for libaio gating

This commit is contained in:
guazhang 2024-12-11 02:35:31 +00:00
parent 238ab262a1
commit 5b9f4e067e
5 changed files with 78 additions and 1 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -3,4 +3,5 @@ product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.openstack-tier1-gating.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/libaio.functional}

56
plans/libaio.fmf Normal file
View File

@ -0,0 +1,56 @@
summary: libaio gating tests
prepare:
how: install
package:
- rpm-build
- gcc
- libaio-devel
- gcc-c++
- wget
discover:
how: shell
url: https://gitlab.com/redhat/centos-stream/rpms/libaio.git
ref: c10s
dist-git-source: true
dist-git-install-builddeps: true
tests:
- name: regression tests
test: |
set -x
if [ -z "$PKG_VER" ]; then
PKG_VER=`rpmspec -q --srpm --qf "%{version}" libaio.spec`
fi
if [ -z "$PKG_VER" ]; then
echo "Error: Unable to extract package version"
exit 1
fi
pushd "$TMT_SOURCE_DIR/libaio-$PKG_VER"
ls -l
cp ../tests/test_against_local.patch ./ || wget https://gitlab.cee.redhat.com/kernel-qe/kernel/-/raw/master/storage/block/libaio/harness/test_against_local.patch
if [[ ! -f test_against_local.patch ]];then
echo "Don't get the lcoal patch"
exit 1
fi
! grep -q 'make LIBAIO=-laio partcheck' harness/Makefile && patch -p0 < test_against_local.patch
if [[ $? != 0 ]];then
echo "apply local patch failed"
exit 1
fi
make install || echo "make install faield in $(pwd)"
pushd harness
make || echo "make in harness failed"
make check || exit 1
popd
popd
execute:
- how: tmt
adjust:
enabled: false
when: distro == fedora
because: They don't have access to internal repos.

View File

@ -0,0 +1,18 @@
--- harness/Makefile 2019-06-28 02:50:39.028675707 -0400
+++ harness/Makefile.new 2019-06-28 02:55:12.037687654 -0400
@@ -9,10 +9,14 @@
CFLAGS+=-Wall -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
#-lpthread -lrt
+# Change this on the build line to run tests against the installed libraries:
+# make LIBAIO=-laio partcheck
+LIBAIO?=../src/libaio.a
+
all: $(PROGS)
$(PROGS): %.p: %.t $(HARNESS_SRCS)
- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a -lpthread
+ $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) -lpthread
clean:
rm -f $(PROGS) *.o runtests.out rofile wofile rwfile