/
python-octavia-tests-tempest.spec
177 lines (142 loc) · 5.45 KB
/
python-octavia-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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Macros for py2/py3 compatibility
%if 0%{?fedora} || 0%{?rhel} > 7
%global pyver %{python3_pkgversion}
%else
%global pyver 2
%endif
%global pyver_bin python%{pyver}
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
%global pyver_install %{expand:%{py%{pyver}_install}}
%global pyver_build %{expand:%{py%{pyver}_build}}
# End of macros for py2/py3 compatibility
%global service octavia
%global plugin octavia-tempest-plugin
%global module octavia_tempest_plugin
%global with_doc 1
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global common_desc \
This package contains Tempest tests to cover the Octavia project. \
Additionally it provides a plugin to automatically load these tests into Tempest.
Name: python-%{service}-tests-tempest
Version: 1.3.0
Release: 1%{?dist}
Summary: Tempest Integration of Octavia Project
License: ASL 2.0
URL: https://git.openstack.org/cgit/openstack/%{plugin}/
Source0: http://tarballs.openstack.org/%{plugin}/%{plugin}-%{upstream_version}.tar.gz
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python%{pyver}-%{service}-tests-tempest-golang
Summary: python%{pyver}-%{service}-tests-tempest golang files
%{?python_provide:%python_provide python%{pyver}-%{service}-tests-tempest-golang}
BuildRequires: golang
BuildRequires: glibc-static
%if 0%{?rhel} > 7
BuildRequires: openssl-static
BuildRequires: zlib-static
%endif
%description -n python%{pyver}-%{service}-tests-tempest-golang
%{common_desc}
This package contains Octavia tempest golang httpd code.
%package -n python%{pyver}-%{service}-tests-tempest
Summary: %{summary}
BuildArch: noarch
%{?python_provide:%python_provide python%{pyver}-%{service}-tests-tempest}
BuildRequires: python%{pyver}-devel
BuildRequires: python%{pyver}-pbr
BuildRequires: python%{pyver}-setuptools
Obsoletes: python-octavia-tests < 2.0.0
Requires: python%{pyver}-%{service}-tests-tempest-golang
Requires: python%{pyver}-pbr >= 3.1.1
Requires: python%{pyver}-oslotest >= 3.2.0
Requires: python%{pyver}-tempest >= 1:18.0.0
Requires: python%{pyver}-tenacity >= 4.8.0
Requires: python%{pyver}-dateutil
Requires: python%{pyver}-octavia-lib >= 1.0.0
Requires: python%{pyver}-oslo-config
Requires: python%{pyver}-oslo-log
Requires: python%{pyver}-oslo-utils
Requires: python%{pyver}-requests
Requires: python%{pyver}-six
Requires: python%{pyver}-cryptography >= 2.1
Requires: python%{pyver}-barbicanclient >= 4.5.2
Requires: python%{pyver}-pyOpenSSL >= 17.1.0
Requires: python%{pyver}-oslo-serialization >= 2.18.0
Requires: python%{pyver}-keystoneauth1 >= 3.3.0
# Handle python2 exception
%if %{pyver} == 2
Requires: python-ipaddress
%endif
%description -n python%{pyver}-%{service}-tests-tempest
%{common_desc}
%if 0%{?with_doc}
%package -n python-%{service}-tests-tempest-doc
Summary: python-%{service}-tests-tempest documentation
BuildArch: noarch
BuildRequires: python%{pyver}-sphinx
BuildRequires: python%{pyver}-sphinxcontrib-apidoc
BuildRequires: python%{pyver}-sphinxcontrib-rsvgconverter
BuildRequires: python%{pyver}-openstackdocstheme
# Required for documentation build
BuildRequires: python%{pyver}-barbicanclient
BuildRequires: python%{pyver}-octavia-lib
BuildRequires: python%{pyver}-oslo-config
BuildRequires: python%{pyver}-tempest
BuildRequires: python%{pyver}-tenacity
BuildRequires: python%{pyver}-pyOpenSSL
%description -n python-%{service}-tests-tempest-doc
It contains the documentation for the Octavia tempest plugin.
%endif
%prep
%autosetup -n %{plugin}-%{upstream_version} -S git
# Let's handle dependencies ourseleves
%py_req_cleanup
# Remove bundled egg-info
rm -rf %{module}.egg-info
%build
%{pyver_build}
rm -f %{module}/contrib/test_server/*bin
# Generate octavia test httpd binary from test_server.go
pushd %{module}/contrib/test_server
%if 0%{?rhel} > 7
go build -ldflags '-compressdwarf=false -linkmode external -extldflags "-z now -pie -static -ldl -lz"' -o %{plugin}-tests-httpd test_server.go
%else
go build -ldflags '-linkmode external -extldflags -static' -o %{plugin}-tests-httpd test_server.go
%endif
popd
# Generate Docs
%if 0%{?with_doc}
export PYTHONPATH=.
sphinx-build-%{pyver} -b html doc/source doc/build/html
# remove the sphinx build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%install
%{pyver_install}
# Move httpd binary to proper place
install -d -p %{buildroot}%{_libexecdir}
install -p -m 0755 %{module}/contrib/test_server/%{plugin}-tests-httpd %{buildroot}%{_libexecdir}/%{plugin}-tests-httpd
ln -s -f %{_libexecdir}/%{plugin}-tests-httpd %{buildroot}%{pyver_sitelib}/%{module}/contrib/test_server/test_server.bin
# Remove test_server.go code
rm %{buildroot}%{pyver_sitelib}/%{module}/contrib/test_server/test_server.go
%files -n python%{pyver}-%{service}-tests-tempest-golang
%{_libexecdir}/%{plugin}-tests-httpd
%{pyver_sitelib}/%{module}/contrib/test_server/test_server.bin
%files -n python%{pyver}-%{service}-tests-tempest
%license LICENSE
%doc README.rst
%exclude %{pyver_sitelib}/%{module}/contrib/test_server/test_server.bin
%{pyver_sitelib}/%{module}
%{pyver_sitelib}/*.egg-info
%if 0%{?with_doc}
%files -n python-%{service}-tests-tempest-doc
%doc doc/build/html
%license LICENSE
%endif
%changelog
* Thu Apr 2 2020 Carlos Goncalves <cgoncalves@redhat.com> 1.3.0-1
- Update to 1.3.0
* Thu Sep 26 2019 RDO <dev@lists.rdoproject.org> 1.2.0-1
- Update to 1.2.0