Difference between revisions of "DPI809/SBR600 Mock Lab"
Chris Tyler (talk | contribs) (Created page with 'Category:SBR600 LabsCategory:DPI908 Labs = Purpose = To use and become familiar with the ''mock'' tool. ''Mock'' is used to test that the BuildRequires for a package ar…') |
(No difference)
|
Revision as of 22:39, 4 September 2012
Purpose
To use and become familiar with the mock tool.
Mock is used to test that the BuildRequires for a package are complete and accurate, by creating a bare-bones chroot environment containing only the basic build packages plus any packages indicated by BuildRequires lines in the spec file.
Background Resources
Required Resources
Before starting this lab, you will need:
- A Fedora Account System (FAS2) account.
- The SRPMs from the previous lab.
Preparation
- Install the mock package:
yum install mock
- Add yourself to the mock group:
usermod -aG mock yourUserName
and logout/login.
Steps
- Run this command for each of your SRPMs:
mock -r fedora-26-x86_64 yourSRPM
- Replace fedora-26-x86_64 with the appropriate distribution-release-arch values; the example is for Fedora 26 on 64-bit AMD/Intel systems. This must correspond to a config file in
/etc/mock
(without the.cfg
extension). - Replace yourSRPM with the filename of the SRPM you wish to test.
- Replace fedora-26-x86_64 with the appropriate distribution-release-arch values; the example is for Fedora 26 on 64-bit AMD/Intel systems. This must correspond to a config file in
- If there are errors, they will be recorded in the results directory. Refer to the mock output for the location of the results directory, which will vary according to the mock configuration file used (if the configuration is fedora-26-x86_64, the results will be in
/var/lib/mock/fedora-26-x86_64/result
). - Correct any errors by adding appropriate
BuildRequilres:
tags, build the source RPM, and then retest.
Deliverable
Create a blog post describing your experience. Include:
- Notes on what you did, and what worked and didn't work.
- How long mock took to complete the build (the first time and on subsequent runs, compared to the rpmbuild time).
- The results, including a link to your SRPM if it was modified from your previous lab.
- Your reflections on the tools, process, and experience.