From 5b9f4e067edfd8c60b38c817e8fdb11261a132cd Mon Sep 17 00:00:00 2001 From: guazhang Date: Wed, 11 Dec 2024 02:35:31 +0000 Subject: [PATCH] add tmt for libaio gating --- .fmf/version | 1 + ci.fmf | 1 + gating.yaml | 3 +- plans/libaio.fmf | 56 ++++++++++++++++++++++++++++++++++ tests/test_against_local.patch | 18 +++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .fmf/version create mode 100644 ci.fmf create mode 100644 plans/libaio.fmf create mode 100644 tests/test_against_local.patch diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..c5aa0e0 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate diff --git a/gating.yaml b/gating.yaml index 9a1fdc8..f67af1d 100644 --- a/gating.yaml +++ b/gating.yaml @@ -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} + diff --git a/plans/libaio.fmf b/plans/libaio.fmf new file mode 100644 index 0000000..cb258fd --- /dev/null +++ b/plans/libaio.fmf @@ -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. + diff --git a/tests/test_against_local.patch b/tests/test_against_local.patch new file mode 100644 index 0000000..342a85a --- /dev/null +++ b/tests/test_against_local.patch @@ -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