1 # -*- coding: utf-8 -*-
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # pylint: disable=invalid-name
17 from tools.rpm_test_data import cpp_expected
19 yum_installed_output = """Loaded plugins: fastestmirror, priorities
20 Loading mirror speeds from cached hostfile
54 From repo : purkki-3rdparty
55 Obsoletes : 2ndparty-pkg
59 rpm_info_output = """Name : non-repo-pkg-1
63 Source RPM : non-repo-pkg-1-1-1.src.rpm
68 Source RPM : non-repo-pkg-2-2-2.src.rpm
73 Source RPM : base-image-pkg-3-3.src.rpm
78 Source RPM : internal-pkg-4-4.src.rpm
83 Source RPM : 3rdparty-pkg-5-5.src.rpm
84 """ # noqa, PEP-8 disabled because of example output has trailing spaces
86 yum_available_output_header = """Added tmprepo repo from http://url1/
90 yum_available_output_base = """
100 yum_available_output_none2 = """
101 Name : non-repo-pkg-1
110 yum_available_output_none1 = """
111 Name : non-repo-pkg-2
119 yum_available_output_localrepo = """
129 yum_available_output_purkki_3rdparty = """
136 Repo : purkki-3rdparty
139 yum_available_output = yum_available_output_header + yum_available_output_base + \
140 yum_available_output_none1 + yum_available_output_none2 + \
141 yum_available_output_localrepo + yum_available_output_purkki_3rdparty
143 internal_pkg_bom = [{'name': '@types/d3-axis',
146 'source-url': 'http://some.url/1',
147 'crypto-capable': True},
148 {'name': '@types/d3-array@*',
151 'source-url': 'http://some.url/2'}]
152 boms_output = {'internal-pkg-4-4.noarch': {"bom": internal_pkg_bom}}
156 'Name': 'non-repo-pkg-1',
157 'Architecture': 'x86_64',
161 'Repo data': {'baseurl': 'test-url-for-none2', 'name': 'none2'},
163 'Source RPM': 'non-repo-pkg-1-1-1.src.rpm',
164 'Crypto capable': False,
167 'Name': 'non-repo-pkg-2',
168 'Architecture': 'noarch',
172 'Repo data': {'baseurl': 'test-url-for-none1', 'name': 'none1'},
174 'Source RPM': 'non-repo-pkg-2-2-2.src.rpm',
175 'Crypto capable': False,
178 'Name': 'base-image-pkg',
179 'Architecture': 'x86_64',
184 'Repo data': {'baseurl': 'test-url-for-base', 'name': 'base'},
186 'Source RPM': 'base-image-pkg-3-3.src.rpm',
187 'Crypto capable': False,
190 'Name': 'internal-pkg',
191 'Architecture': 'noarch',
195 'From repo': 'localrepo',
196 'Repo data': {'baseurl': 'test-url/artifact/results/repo',
197 'name': 'localrepo'},
199 'Source RPM': 'internal-pkg-4-4.src.rpm',
200 'Crypto capable': True,
201 'BOM': internal_pkg_bom,
203 'Name': '3rdparty-pkg',
204 'Architecture': 'x86_64',
208 'From repo': 'purkki-3rdparty',
209 'Repo data': {'baseurl': 'test-url-for-purkki-3rdparty', 'name': 'purkki-3rdparty',
210 'test-extra-option': 'test-value'},
211 'Obsoletes': '2ndparty-pkg',
212 'Source RPM': '3rdparty-pkg-5-5.src.rpm',
213 'Crypto capable': False,
217 basesystem_combined = {
219 'Name': 'basesystem',
221 'Release': '7.el7.centos',
222 'Architecture': 'noarch',
223 'Install Date': 'Fri 01 Apr 2016 11:47:25 AM EEST',
224 'Group': 'System Environment/Base',
226 'License': 'Public Domain',
227 'Signature': 'RSA/SHA256, Fri 04 Jul 2014 03:46:57 AM EEST, Key ID 24c6a8a7f4a80eb5',
228 'Source RPM': 'basesystem-10.0-7.el7.centos.src.rpm',
229 'Build Date': 'Fri 27 Jun 2014 01:37:10 PM EEST',
230 'Build Host': 'worker1.bsys.centos.org',
231 'Relocations': '(not relocatable)',
232 'Packager': 'CentOS BuildSystem <http://bugs.centos.org>',
234 'Summary': 'The skeleton package which defines a simple CentOS Linux system',
235 'Description': '\n'.join(
236 ['Basesystem defines the components of a basic CentOS Linux',
237 'system (for example, the package installation order to use during',
238 'bootstrapping). Basesystem should be in every installation of a system,',
239 'and it should never be removed.']),
244 centos_logos_combined = {
245 'Name': 'centos-logos',
247 'Release': '3.el7.centos',
248 'Architecture': 'noarch',
249 'License': u'Copyright © 2014 The CentOS Project. All rights reserved.',
252 cpp_combined = cpp_expected.copy()
253 cpp_combined.update({'Repo': 'installed',
254 'From repo': 'purkki-centos-base'})
256 dejavu_fonts_common_combined = {
257 'Name': 'dejavu-fonts-common',
260 'Architecture': 'noarch',
261 'Install Date': 'Wed Feb 7 13:49:27 2018',
262 'Group': 'User Interface/X',
264 'License': 'Bitstream Vera and Public Domain',
265 'Signature': 'RSA/SHA256, Fri Jul 4 01:06:50 2014, Key ID 24c6a8a7f4a80eb5',
266 'Source RPM': 'dejavu-fonts-2.33-6.el7.src.rpm',
267 'Build Date': 'Mon Jun 9 21:34:30 2014',
268 'Build Host': 'worker1.bsys.centos.org',
269 'Relocations': '(not relocatable)',
270 'Packager': 'CentOS BuildSystem <http://bugs.centos.org>',
272 'URL': 'http://dejavu-fonts.org/',
273 'Summary': 'Common files for the Dejavu font set',
274 'Description': '\n'.join(
275 ['The DejaVu font set is based on the “Bitstream Vera” fonts, release 1.10. Its',
276 'purpose is to provide a wider range of characters, while maintaining the',
277 'original style, using an open collaborative development process.',
279 'This package consists of files used by other DejaVu packages.']),
281 'From repo': 'purkki-centos-base'
284 crypto_rpms_json = """
287 "name": "internal-pkg-4-4.noarch",
289 "libgssapi_krb5.so.2()(64bit)",
290 "libk5crypto.so.3()(64bit)",
291 "libkrb5.so.3()(64bit)",
292 "libcrypto.so.10()(64bit)",
293 "libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)",
294 "libcrypto.so.10(OPENSSL_1.0.2)(64bit)",
295 "libcrypto.so.10(libcrypto.so.10)(64bit)",
296 "libssl.so.10()(64bit)",
297 "libssl.so.10(libssl.so.10)(64bit)",
298 "openssl-libs(x86-64)",