-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython-example-tests-tempest.spec
139 lines (111 loc) · 3.85 KB
/
python-example-tests-tempest.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
%{!?sources_gpg: %{!?dlrn:%global sources_gpg 1} }
# %global sources_gpg_sign <get the Cryptographic Signatures of current release from https://releases.openstack.org/#cryptographic-signatures>
%global sources_gpg_sign 0x2426b928085a020d8a90d0d879ab7008d0896c8a
# This spec can be used for packaging of tempest plugin when residing in
# a separate project as designate-tempest-plugin. For tempest plugins included
# in main project git repo, it should be a sub-package of openstack-<service>.
%global service example
%global plugin example-tempest-plugin
%global module example_tempest_plugin
%global with_doc 1
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{service}-tests-tempest
Version: XXX
Release: XXX
Summary: Tempest Integration of example
License: ASL 2.0
URL: https://github.com/openstack/%{plugin}/
Source0: https://tarballs.openstack.org/%{plugin}/%{plugin}-%{upstream_version}.tar.gz
# Required for tarball sources verification
%if 0%{?sources_gpg} == 1
Source101: https://tarballs.openstack.org/%{plugin}/%{plugin}-%{upstream_version}.tar.gz.asc
Source102: https://releases.openstack.org/_static/%{sources_gpg_sign}.txt
%endif
BuildArch: noarch
%description
This package contains Tempest tests to cover the example project.
Additionally it provides a plugin to automatically load these tests into tempest.
# Required for tarball sources verification
%if 0%{?sources_gpg} == 1
BuildRequires: /usr/bin/gpgv2
BuildRequires: openstack-macros
%endif
%package -n python2-%{service}-tests-tempest
Summary: %{summary}
%{?python_provide:%python_provide python2-%{service}-tests-tempest}
BuildRequires: python2-devel
BuildRequires: python-pbr
BuildRequires: python-setuptools
BuildRequires: git-core
Requires: python-xxxxx >= a.b.c
%description -n python2-%{service}-tests-tempest
This package contains Tempest tests to cover the example project.
Additionally it provides a plugin to automatically load these tests into tempest.
%if 0%{?with_doc}
%package -n python-%{service}-tests-tempest-doc
Summary: python-%{service}-tests-tempest documentation
BuildRequires: python-sphinx
BuildRequires: python-oslo-sphinx
%description -n python-%{service}-tests-tempest-doc
It contains the documentation for the example tempest tests.
%endif
%if 0%{?with_python3}
%package -n python3-%{service}-tests-tempest
Summary: %{summary}
%{?python_provide:%python_provide python3-%{service}-tests-tempest}
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
Requires: python3-xxxxx >= a.b.c
%description -n python3-%{service}-tests-tempest
This package contains Tempest tests to cover the example project.
Additionally it provides a plugin to automatically load these tests into tempest.
%endif
%prep
# Required for tarball sources verification
%if 0%{?sources_gpg} == 1
%{gpgverify} --keyring=%{SOURCE102} --signature=%{SOURCE101} --data=%{SOURCE0}
%endif
%autosetup -n %{plugin}-%{upstream_version} -S git
# remove requirements
%py_req_cleanup
# Remove bundled egg-info
rm -rf *.egg-info
%build
%if 0%{?with_python3}
%py3_build
%endif
%py2_build
# Generate Docs
%if 0%{?with_doc}
%{__python2} setup.py build_sphinx
# remove the sphinx build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%install
%if 0%{?with_python3}
%py3_install
%endif
%py2_install
%check
# Use the test command required by the plugin
ostestr --whitelist-file test-whitelist.txt
%files -n python2-%{service}-tests-tempest
%license LICENSE
%{python2_sitelib}/%{module}
%{python2_sitelib}/*.egg-info
%if 0%{?with_python3}
%files -n python3-%{service}-tests-tempest
%license LICENSE
%{python3_sitelib}/%{module}
%{python3_sitelib}/*.egg-info
%endif
%if 0%{?with_doc}
%files -n python-%{service}-tests-tempest-doc
%doc doc/build/html
%license LICENSE
%endif
%changelog