From Fedora Project Wiki
No edit summary
m (→‎Procedure: rpmlint requires python)
 
(One intermediate revision by one other user not shown)
Line 26: Line 26:
<pre>mock -r fedora-<release>-<arch> --install <package(s)></pre>
<pre>mock -r fedora-<release>-<arch> --install <package(s)></pre>
example:
example:
<pre>mock -r fedora-rawhide-x86_64 --install libfoo rpmlint vi less</pre>
<pre>mock -r fedora-rawhide-x86_64 --install libfoo rpmlint vi less python</pre>




Line 36: Line 36:
<mock-chroot> rpmlint libfoo
<mock-chroot> rpmlint libfoo
</pre>
</pre>


== Testing graphical packages with mock and Xnest ==
== Testing graphical packages with mock and Xnest ==

Latest revision as of 15:31, 30 March 2017

Prerequisite(s)

Testing non-graphical packages with mock

The situation may arise when you want to test a package without having it installed on your main system or for a different release than what you're running.

Advantages

  • You can test packages without polluting your main system.
  • You can test packages for different releases than your running (rawhide?) without use of bare metal or virtual machines.

Disadvantages

  • Regardless of the release your testing, you're still using the kernel version of the host.

Procedure

There's three basic steps involved:

1. Initialize a chroot with mock for the release you want to test with.

mock -r fedora-<release>-<arch> --init

example:

mock -r fedora-rawhide-x86_64 --init


2. Install the test package and any additional packages you need.

mock -r fedora-<release>-<arch> --install <package(s)>

example:

mock -r fedora-rawhide-x86_64 --install libfoo rpmlint vi less python


3. Go into the mock shell and perform the tests.

mock -r fedora-<release>-<arch> --shell

example:

mock -r fedora-rawhide-x86_64 --shell
<mock-chroot> rpmlint libfoo

Testing graphical packages with mock and Xnest

It is also possible to test graphical programs with the addition of Xnest. It's subject to the same advantages and disadvantages with the following addition. The package will be using the X server of the host and not of the release being tested which could make reproducing an error problematic depending on the source of the problem.

Additionally, it is possible to test packages remotely over X11 forwarding, or even from Windows machines using Cygwin

Procedure

In addition to the above steps, you need to setup Xnest.

Xnest :<display #> -ac &

example using xclock: (assuming the mock chroot has already been initialized)

mock -r fedora-rawhide-x86_64 --install xclock
Xnest :1 -ac &
mock -r fedora-rawhide-x86_64 --shell
<mock-chroot> xclock -display :1