move helper gating script to tests dir

Sometimes changes to the helper script for the gating plan are needed
without a ticket. Since this is a shell script, it is not exempt from
dist-git policy that requires a ticket for any non-test change. The
gating plan itself is a fmf file which is exempt, so only this used to
be a problem in the past.

Because of the STI test format, the whole tests folder is exempt too.
Moving the helper script there to avoid the need for tickets.
This commit is contained in:
Michal Pospíšil 2025-08-27 23:48:07 +02:00
parent 4f41f5db77
commit 08eca9831e
2 changed files with 54 additions and 0 deletions

32
plan-gating.fmf Normal file
View File

@ -0,0 +1,32 @@
summary: PCS gating test plan
description: Runs upstream tier0, tier1 and smoke tests
discover:
dist-git-source: true
dist-git-install-builddeps: true
how: shell
tests:
- name: tier0
test: |
./tests/prepare-tests.sh
$TMT_SOURCE_DIR/pcs-*/pcs_test/suite --tier0 -v --vanilla --installed
duration: 10m
tier: 0
tag: fast
- name: tier1
test: |
./tests/prepare-tests.sh
$TMT_SOURCE_DIR/pcs-*/pcs_test/suite --tier1 -v --vanilla --installed
duration: 2h
tier: 1
- name: smoke
test: |
systemctl start pcsd
./tests/prepare-tests.sh
$TMT_SOURCE_DIR/pcs-*/pcs_test/smoke.sh
duration: 10m
tier: smoke
tag: fast
execute:
how: tmt

22
tests/prepare-tests.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -eo xtrace
cd $TMT_SOURCE_DIR
# Use stamp file to abort if this script already ran
if [ -e tests-prepared-stamp ]; then exit 0; fi
# RPM 4.20 changed the builddir structure - unpacked sources go to *-build but
# tmt copies them back to pcs-*, so the pcs-*-build folder is empty
# Remove pcs-web-ui, pcs-*-build for "cd pcs-*" to have exactly one match
rm -rf pcs-web-ui-* pcs-*-build
cd pcs-*/
# Run autotools, use bundled dependencies from the system
export PYTHONPATH=/usr/lib/pcs/pcs_bundled/packages/
export GEM_HOME=/usr/lib/pcsd/vendor/bundle/
# We need to use cd pcs-* because when pcs-web-ui starts using autotools, running
# autogen and configure with expanded TMT_SOURCE_DIR will match that too
./autogen.sh
./configure --enable-local-build --enable-use-local-cache-only \
--enable-individual-bundling --enable-webui --with-pcs-lib-dir=/usr/lib
# Remove pcs sources to make sure tests are not using any of those files
rm -rf pcs
touch ../tests-prepared-stamp