From f9dec0a74d8065d2bebf17462005e8b77b558459 Mon Sep 17 00:00:00 2001 From: Jakub Haruda Date: Wed, 9 Jul 2025 17:17:41 +0200 Subject: [PATCH] Convert the STI test to TMT --- .fmf/version | 1 + tests/libva-tests/runtests.sh | 80 ----------------------------------- tests/main.fmf | 22 ++++++++++ tests/runtests.sh | 42 ++++++++++++++++++ tests/tests.yml | 30 ------------- 5 files changed, 65 insertions(+), 110 deletions(-) create mode 100644 .fmf/version delete mode 100755 tests/libva-tests/runtests.sh create mode 100644 tests/main.fmf create mode 100755 tests/runtests.sh delete mode 100644 tests/tests.yml 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/tests/libva-tests/runtests.sh b/tests/libva-tests/runtests.sh deleted file mode 100755 index a124086..0000000 --- a/tests/libva-tests/runtests.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -function error() { - echo "$0: Error: $*" >&2 - exit 1 -} - -function tarball_fullname() { - ls -1 $1.tar.* | head -1 -} - -function tarball_exists() { - ls -1 $1.tar.* > /dev/null 1>&2 && test -s $(tarball_fullname $1) -} - -# Script directory is now a working directory. -cd $(dirname $0) || error "cannot cd to $(dirname $0)" - -# Handy shortcuts. -need_libva_utils_version=$(rpm -q --queryformat='%{VERSION}\n' libva) -[[ "x${need_libva_utils_version}" == "x" ]] && error "libva version cannot be retrieved" -libva_utils_tarball_basename=libva-utils-${need_libva_utils_version} - -# Get the libva-utils Fedora repo. -git clone https://src.fedoraproject.org/rpms/libva-utils.git || error "cannot fetch libva-utils Fedora repo" - -# cd to repo. -cd libva-utils || error "cannot cd to libva-utils" - -# Checkout the commit with desired libva-utils version. -git checkout $(git log -S "${libva_utils_tarball_basename}.tar" --oneline | tail -1 | awk '{print $1;}') || error "cannot checkout desired commit" - -# Try to fetch desired tarball. -spectool -g libva-utils.spec -if ! tarball_exists ${libva_utils_tarball_basename}; then - echo '{ "ANSIBLE_MODULE_ARGS": { "package": "libva-utils", "sources": "./sources", "target": "./" } }' > args.json - python3 /usr/share/ansible/roles/standard-test-source/library/source-lookaside.py args.json -fi -# Still no success? Let's take it from upstream as the last try. -if ! tarball_exists ${libva_utils_tarball_basename}; then - wget -O ${libva_utils_tarball_basename}.tar.gz "https://github.com/intel/libva-utils/archive/${need_libva_utils_version}.tar.gz" - tarball_exists ${libva_utils_tarball_basename} || error "cannot fetch libva-utils tarball" -fi -libva_utils_tarball=$(tarball_fullname ${libva_utils_tarball_basename}) - -# Unpack the sources. -case "${libva_utils_tarball}" in - *.tar.gz) - gzip -dc "${libva_utils_tarball}" | tar -xof - - ;; - *.tar.bz2) - bzip2 -dc "${libva_utils_tarball}" | tar -xof - - ;; - *.tar.xz) - xz -dc "${libva_utils_tarball}" | tar -xof - - ;; - *) - error "cannot unpack ${libva_utils_tarball}" - ;; -esac - -# Enter the directory with unpacked sources. -cd libva-utils-${need_libva_utils_version} || error "cannot cd to libva-utils-${need_libva_utils_version}" - -# Build the tests. -autoreconf -fvi || error "cannot reconfigure libva-utils" -rpm --eval '%configure --enable-tests' > configure.wrap || error "cannot wrap configure" -bash configure.wrap || error "cannot configure libva-utils" -make || error "cannot build libva-utils" - -# These tests can run also in VM (other needs real working graphic adapter). -GTEST_FILTER='Internal.Resolution' -GTEST_FILTER="${GTEST_FILTER}:VAAPIFixture.getDisplay" -GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.vaInitialize_vaTerminate_Bad_Environment" -GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.vaInitialize_vaTerminate_Bad_vaSetDriverName" -GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.InitTermWithoutDisplay" -export GTEST_FILTER - -# Run the tests. -./test/test_va_api diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..efe8d21 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,22 @@ +test: ./runtests.sh +duration: 15m +recommend: + - git + - wget + - rpm-build + - redhat-rpm-config + - autoconf + - automake + - libtool + - pkgconfig + - make + - gcc + - gcc-c++ + - libX11 + - libX11-devel + - libdrm + - libdrm-devel + - libva + - libva-devel + - wayland-devel +framework: shell diff --git a/tests/runtests.sh b/tests/runtests.sh new file mode 100755 index 0000000..062993b --- /dev/null +++ b/tests/runtests.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +function error() { + echo "$0: Error: $*" >&2 + exit 1 +} + +function tarball_fullname() { + ls -1 $1.tar.* | head -1 +} + +function tarball_exists() { + ls -1 $1.tar.* > /dev/null 1>&2 && test -s $(tarball_fullname $1) +} + +# Script directory is now a working directory. +cd $(dirname $0) || error "cannot cd to $(dirname $0)" + + +git clone https://github.com/intel/libva-utils --no-tags --no-checkout || error "cannot git clone intel/libva-utils" + +# Enter the directory with unpacked sources. +cd libva-utils || error "cannot cd to libva-utils" +GIT_COMMIT_LIBVA="7bad184b2cf2ffaf4fb3cc71d4df63d7b142d592" +git reset --hard ${GIT_COMMIT_LIBVA} || error "cannot checkout the commit ${GIT_COMMIT_LIBVA}" + +# Build the tests. +autoreconf -fvi || error "cannot reconfigure libva-utils" +rpm --eval '%configure --enable-tests' > configure.wrap || error "cannot wrap configure" +bash configure.wrap || error "cannot configure libva-utils" +make || error "cannot build libva-utils" + +# These tests can run also in VM (other needs real working graphic adapter). +GTEST_FILTER='Internal.Resolution' +GTEST_FILTER="${GTEST_FILTER}:VAAPIFixture.getDisplay" +GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.vaInitialize_vaTerminate_Bad_Environment" +GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.vaInitialize_vaTerminate_Bad_vaSetDriverName" +GTEST_FILTER="${GTEST_FILTER}:VAAPIInitTerminate.InitTermWithoutDisplay" +export GTEST_FILTER + +# Run the tests. +./test/test_va_api diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 6ab984e..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - required_packages: - - git - - spectool - - wget - - rpm-build - - redhat-rpm-config - - autoconf - - automake - - libtool - - pkgconfig - - make - - gcc - - gcc-c++ - - libX11 - - libX11-devel - - libdrm - - libdrm-devel - - libva - - libva-devel - - wayland-devel - tests: - - smoke: - dir: ./libva-tests - run: ./runtests.sh