Open main menu

CDOT Wiki β

DPI908/SBR600 Mock Lab

Revision as of 15:18, 16 September 2013 by Chris Tyler (talk | contribs)

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:

  1. A Fedora Account System (FAS2) account.
  2. 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

  1. 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.
  2. 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).
  3. 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.