Compare commits

...

1 Commits

Author SHA1 Message Date
Michal Pospisil 0fa116787f migrate gating tests to fmf 2023-11-02 03:41:57 +00:00
6 changed files with 106 additions and 98 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

1
.pcs.metadata Normal file
View File

@ -0,0 +1 @@
3176b2f2b332c2b6bf79fe882e83feecf3d3f011 pyagentx-0.4.pcs.2.tar.gz

54
gating.fmf Normal file
View File

@ -0,0 +1,54 @@
summary: PCS gating test plan
description: Runs upstream tier0, tier1 and smoke tests
discover:
how: shell
dist-git-source: true
tests:
# Workaround until tmt supports patching sources
- name: Patch sources and run autotools
test: ./prepare-env.sh
duration: 30m
- name: Tier 0 tests
test: ./builddir/pcs-*/pcs_test/suite --tier0 -v --vanilla --installed
duration: 10m
- name: Tier 1 tests
test: ./builddir/pcs-*/pcs_test/suite --tier1 -v --vanilla --installed
duration: 2h
- name: Smoke tests
test: |
systemctl start pcsd
./builddir/pcs-*/pcs_test/smoke.sh
duration: 10m
prepare:
- name: Install config-manager DNF plugin for enabling HA repos
how: install
package: dnf-command(config-manager)
- name: Enable HA repo
how: shell
script: dnf config-manager --set-enabled highavailability crb
- name: Install packages
how: install
package:
- autoconf
- automake
- make
- rpm-build
- ruby-devel
- git-core
- booth-site
- fence-agents-apc
- fence-agents-ipmilan
- fence-agents-scsi
- fence-virt
- openssl
- pcs
- pcs-snmp
- python3-pip
- python3-setuptools_scm
- python3-wheel
- rubygem-json
- rubygem-test-unit
- wget
execute:
how: tmt

View File

@ -1,6 +1,6 @@
Name: pcs
Version: 0.11.6
Release: 3%{?dist}
Release: 4%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPL-2.0-only: pcs
@ -308,31 +308,35 @@ update_times_patch %{PATCH3}
echo "%version+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version
%endif
# prepare dirs/files necessary for building all bundles
# -----------------------------------------------------
# 1) rubygems sources
%if 0%{?skip_bundle_prep}
echo "Skipping copying bundled dependencies."
%else
# prepare dirs/files necessary for building all bundles
# -----------------------------------------------------
# 1) rubygems sources
mkdir -p %{rubygem_cache_dir}
cp -f %SOURCE81 %{rubygem_cache_dir}
cp -f %SOURCE82 %{rubygem_cache_dir}
cp -f %SOURCE83 %{rubygem_cache_dir}
cp -f %SOURCE84 %{rubygem_cache_dir}
cp -f %SOURCE85 %{rubygem_cache_dir}
cp -f %SOURCE86 %{rubygem_cache_dir}
cp -f %SOURCE87 %{rubygem_cache_dir}
cp -f %SOURCE88 %{rubygem_cache_dir}
cp -f %SOURCE89 %{rubygem_cache_dir}
cp -f %SOURCE90 %{rubygem_cache_dir}
cp -f %SOURCE91 %{rubygem_cache_dir}
cp -f %SOURCE92 %{rubygem_cache_dir}
cp -f %SOURCE93 %{rubygem_cache_dir}
mkdir -p %{rubygem_cache_dir}
cp -f %SOURCE81 %{rubygem_cache_dir}
cp -f %SOURCE82 %{rubygem_cache_dir}
cp -f %SOURCE83 %{rubygem_cache_dir}
cp -f %SOURCE84 %{rubygem_cache_dir}
cp -f %SOURCE85 %{rubygem_cache_dir}
cp -f %SOURCE86 %{rubygem_cache_dir}
cp -f %SOURCE87 %{rubygem_cache_dir}
cp -f %SOURCE88 %{rubygem_cache_dir}
cp -f %SOURCE89 %{rubygem_cache_dir}
cp -f %SOURCE90 %{rubygem_cache_dir}
cp -f %SOURCE91 %{rubygem_cache_dir}
cp -f %SOURCE92 %{rubygem_cache_dir}
cp -f %SOURCE93 %{rubygem_cache_dir}
# 2) prepare python bundles
mkdir -p %{pcs_bundled_dir}/src
cp -f %SOURCE41 rpm/
cp -f %SOURCE42 rpm/
cp -f %SOURCE44 rpm/
# 2) prepare python bundles
mkdir -p %{pcs_bundled_dir}/src
cp -f %SOURCE41 rpm/
cp -f %SOURCE42 rpm/
cp -f %SOURCE44 rpm/
%endif
%build
%define debug_package %{nil}
@ -537,6 +541,10 @@ run_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Fri Oct 27 2023 Michal Pospisil <mpospisi@redhat.com> - 0.11.6-4
- No changes, testing a new quality control process
- Resolves: RHEL-15217
* Fri Jul 14 2023 Michal Pospisil <mpospisi@redhat.com> - 0.11.6-3
- Refreshing any page in pcs-web-ui no longer causes it to display a blank page
- Resolves: rhbz#2222788

19
prepare-env.sh Executable file
View File

@ -0,0 +1,19 @@
set -eo xtrace
# Rpmbuild expects patches in the _sourcedir
mv *.patch $TMT_SOURCE_DIR
mkdir builddir
# Workaround for tmt not downloading rubygems, there is a spec macro that skips
# copying them during prep phase
rpmbuild -bp pcs.spec --nodeps --define "_sourcedir $TMT_SOURCE_DIR" \
--define "_builddir $(pwd)/builddir" --define="skip_bundle_prep 1"
# Remove pcs-web-ui in builddir for "cd pcs-*" to have exactly one match
rm -rf builddir/pcs-web-ui-*
cd builddir/pcs-*
# Run autotools, use bundled dependencies from the system
export PYTHONPATH=/usr/lib64/pcs/pcs_bundled/packages/
export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/
./autogen.sh
# Workaround until configure.ac is prepared for centos-stream-*
./configure --with-distro=rhel
# Remove pcs sources to make sure tests are not using any of those files
rm -rf pcs

View File

@ -1,75 +0,0 @@
- hosts: localhost
tags:
- classic
vars:
# standard-test-basic directory for tests are relative to {{ tenv_workdir }}
tenv_workdir: /var/test
pre_tasks:
- import_role:
name: standard-test-source
vars:
fetch_only: True
- name: Copy files including source to test environment
synchronize:
src: "{{ playbook_dir }}/.."
dest: "{{ tenv_workdir }}"
mode: push
ssh_args: "-o UserKnownHostsFile=/dev/null"
- name: Start pcsd
systemd:
state: started
name: pcsd
daemon_reload: yes
roles:
# roles documentation:
# https://pagure.io/standard-test-roles/blob/master/f/roles/standard-test-source
- role: standard-test-basic
required_packages:
- autoconf
- automake
- make
- rpm-build
- ruby-devel
- git-core
- booth-site
- fence-agents-apc
- fence-agents-ipmilan
- fence-agents-scsi
- fence-virt
- openssl
- pcs
- pcs-snmp
- python3-pip
- python3-setuptools_scm
- python3-wheel
- rubygem-json
- rubygem-test-unit
- wget
required_services:
- pcsd
tests:
# dir: . -> dot means tests dir in distgit
- prepare-source:
dir: ./
run: rpmbuild -bp {{tenv_workdir}}/*.spec --nodeps --define "_sourcedir {{tenv_workdir}}" --define "_builddir {{tenv_workdir}}/source"
# pcs-web-ui sources are deleted because there are conflicts during move of sources
# pcs-web-ui sources aren't needed during testing
- flatten-source:
dir: ./
run: rm -rf {{tenv_workdir}}/source/pcs-web-ui-*; shopt -s dotglob; mv {{tenv_workdir}}/source/*/* {{tenv_workdir}}/source
- build_sources:
dir: ./source
run: "export PYTHONPATH=/usr/lib64/pcs/pcs_bundled/packages/; export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/; ./autogen.sh && ./configure"
- remove_sources:
dir: ./source
run: rm -rfv pcs
- run_upstream_tier0_tests:
dir: ./source
run: pcs_test/suite --tier0 -v --vanilla --installed
- run_upstream_tier1_tests:
dir: ./source
run: pcs_test/suite --tier1 -v --vanilla --installed
- run_smoke_tests:
dir: ./source
run: pcs_test/smoke.sh