diff --git a/.zuul.yaml b/.zuul.yaml index ae37045b..9dd45a71 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -11,6 +11,8 @@ - openstack-tox-linters - openstack-tox-pep8 - stx-fault-build + - flock-check-packaging: + voting: false gate: jobs: - build-openstack-api-ref @@ -56,3 +58,12 @@ fault: https://opendev.org/starlingx/fault integ: https://opendev.org/starlingx/integ update: https://opendev.org/starlingx/update + +- job: + name: flock-check-packaging + parent: tox + description: Sanity check RPM spec files + required-projects: + - name: starlingx/integ + vars: + tox_envlist: rpm-packaging-lint diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 00000000..2873110a --- /dev/null +++ b/bindep.txt @@ -0,0 +1,2 @@ +diffutils +rpm diff --git a/fm-rest-api/opensuse/fm-rest-api.spec b/fm-rest-api/opensuse/fm-rest-api.spec index c4a2120a..b0f92653 100644 --- a/fm-rest-api/opensuse/fm-rest-api.spec +++ b/fm-rest-api/opensuse/fm-rest-api.spec @@ -6,16 +6,16 @@ License: Apache-2.0 Group: Development/Tools/Other URL: https://opendev.org/starlingx/fault Source0: %{name}-%{version}.tar.xz -BuildRequires: python2-oslo.config +BuildRequires: insserv-compat BuildRequires: python-oslo.db -BuildRequires: python2-oslo.log BuildRequires: python-oslo.messaging BuildRequires: python-oslo.middleware BuildRequires: python-setuptools +BuildRequires: python2-oslo.config +BuildRequires: python2-oslo.log BuildRequires: python2-pip BuildRequires: systemd BuildRequires: systemd-rpm-macros -BuildRequires: insserv-compat Requires: python-eventlet Requires: python-paste Requires: python-webob diff --git a/test-requirements.txt b/test-requirements.txt index 71c1c3c4..a0833c46 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,3 +2,4 @@ hacking!=0.13.0,<0.14,>=0.12.0 bashate >= 0.2 PyYAML >= 3.1.0 yamllint >= 0.5.2 +spec_cleaner>=1.0.9 diff --git a/tox.ini b/tox.ini index 369605a5..6803b471 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = linters,pep8 +envlist = linters,pep8,rpm-packaging-lint minversion = 2.3 skipsdist = True @@ -11,6 +11,26 @@ setenv = VIRTUAL_ENV={envdir} OS_TEST_TIMEOUT=60 deps = -r{toxinidir}/test-requirements.txt +[testenv:rpm-packaging-lint] +basepython = python3 +setenv = + VIRTUAL_ENV={envdir} + LC_ALL=en_US.utf-8 +install_command = pip install -U \ + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \ + {opts} {packages} +deps = -r{toxinidir}/test-requirements.txt +whitelist_externals = bash +commands = + bash -c 'if [ -d {toxinidir}/../integ ]; then integdir={toxinidir}/../integ; \ + else integdir={toxinidir}/../stx-integ; \ + fi; \ + find . \ + -not \( -type d -name .?\* -prune \) \ + -not \( -type d -name centos -prune \) \ + -type f -name \*.spec \ + -print0 | xargs -0 $integdir/tools/spec-tools/speclint.sh' + [testenv:linters] basepython = python3 whitelist_externals = bash