On Mar 3, 2016, I started working on
python-
It took me about a month to complete the whole task. But in this time interval, I have made lots of mistakes and learned a lot.
Below are my findings
RDO test sub-packages naming conventions
- For openstack-
package, the test sub-package name is python- -tests . python-will be the required package. - If the OpenStack upstream project name is
-tests, a new package openstack- -tests should be included in RDO packages.
Placing the python test binaries at proper place
From %files macro of python-
The advantage of using %exclude is to avoid shipping twice the same files and creating conflicts.
%files -n python-<service>
%exclude %{python2_sitelib}/<service>/tests
%exclude %{python2_sitelib}/<service>_tempest_tests
%files -n python-<service>-tests
%{python2_sitelib}/<service>/tests
%{python2_sitelib}/<service>_tempest_tests
Use %license macro to place LICENSE
It is our common problem that we generally include LICENSE file under %doc macro which is still correct in any sub-package but %license has advantages like handling license specifics (a lot of duplication) and allowing some optimizations.
For more information check here : (http://www.rpm.org/ticket/116)
Do not do rm -rf .egg-info
Last night, we faced a lot of problems due to this silly mistake. If we
do rm -rf
So, think twice before you do this step in the spec file. For more information, check the Python Eggs from Fedora Python Packaging guidelines: (https://fedoraproject.org/wiki/Packaging:Python_Eggs)
Use rpmls command to verify the list of files with in a package
Use rpmls command from rpmdevtools package to check the files and their permissions included in the packages, so that you can fix later on based on your needs.
$ rpmls *.rpm
Use correct path in _tempest_plugin
We had completed the packaging of python-
# https://review.openstack.org/#/c/303792/1/mistral_tempest_tests/services/base.py
main_package = 'mistral'
# it should be
main_package = 'mistral_tempest_tests'
However, we have fixed the same in Zaqar and Mistral
That’s it! Now all RDO OpenStack packages contain tests sub-packages.
Thanks to Alan, Javier, Haikel and Emilien for helping in getting this huge task done on time and always inspiring me to learn more.