pcs/tests/prepare-tests.sh
Michal Pospíšil 402e13b60a set bundled package paths in plan
There is a key difference between Fedora and RHEL. Fedora has pcs as a
noarch package which causes it to be installed into /usr/lib rather
than /usr/lib64. This means that bundled packages have a different path.
This caused import errors in tests.

There is also a better way of setting the environment variables -
through tmt instead of the preparation script.
2025-11-13 17:16:51 +01:00

21 lines
795 B
Bash
Executable File

#!/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
# tmt patched the sources with rpmbuild, but RPM<4.20 still leaves the SPECPARTS
# folder, remove it
rm -rfv *SPECPARTS
# 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-*/
./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