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/gating.fmf b/gating.fmf new file mode 100644 index 0000000..c56d032 --- /dev/null +++ b/gating.fmf @@ -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 ha powertools || true + - 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 diff --git a/pcs.spec b/pcs.spec index 80c1239..d22658c 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.10.17 -Release: 2%{?dist} +Release: 3%{?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 @@ -332,6 +332,9 @@ update_times_patch %{PATCH3} echo "%version+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version %endif +%if 0%{?skip_bundle_prep} + echo "Skipping copying bundled dependencies." +%else cp -f %SOURCE1 %{pcsd_public_dir}/images # prepare dirs/files necessary for building all bundles @@ -365,6 +368,7 @@ cp -f %SOURCE42 rpm/ cp -f %SOURCE43 rpm/ cp -f %SOURCE44 rpm/ cp -f %SOURCE45 rpm/ +%endif %build %define debug_package %{nil} @@ -580,6 +584,10 @@ remove_all_tests %license pyagentx_LICENSE.txt %changelog +* Wed Nov 1 2023 Michal Pospisil - 0.10.17-3 +- No changes, testing a new quality control process +- Resolves: RHEL-15218 + * Thu Jul 13 2023 Michal Pospisil - 0.10.17-2 - Make use of filters when extracting tarballs to enhance security if provided by Python (`pcs config restore` command) - Do not display duplicate records in commands `pcs property [config] --all` and `pcs property describe` diff --git a/prepare-env.sh b/prepare-env.sh new file mode 100755 index 0000000..27411e4 --- /dev/null +++ b/prepare-env.sh @@ -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 diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index a33da8e..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,66 +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" - - 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 - - pcs - - python3-setuptools_scm - - python3-wheel - - 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 --enable-tests-only" - - 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