Testing rt-tests Compile options with mock (chroot environment)

From RTwiki
Jump to: navigation, search

I wanted to set-up a chroot environment without the libnuma libs installed to make sure that the make NUMA=0 option compiled correctly. So, I used mock to quickly set-up the chroot sandbox.

TODO
needs editing

First as root or using sudo (substitute your own user name for jkacur of course)

# usermod -a -G mock jkacur
# cd /etc/mock
# cp fedora-22-x86_64.cfg rt-tests.cfg

Then as your user name

$ mock -r rt-tests --init

This creates a chroot environment here: /var/lib/mock/fedora-22-x86_64/root/rt-tests/

$ mock -r rt-tests --copyin /home/jkacur/source/rt-tests rt-tests

The above creates /var/lib/mock/fedora-22-x86_64/root/rt-tests Now we can test

$ mock -r rt-tests --shell 'cd rt-tests && make clean'
$ mock -r rt-tests --shell 'cd rt-tests && make'

Since your changeroot environment shouldn't have the numa libs installed, you should get the following error

{{{1}}}
In file included from src/cyclictest/cyclictest.c:39:0:
src/cyclictest/rt_numa.h:29:18: fatal error: numa.h: No such file or directory
compilation terminated.
Makefile:87: recipe for target 'bld/cyclictest.o' failed
make: *** [bld/cyclictest.o] Error 1
Finish: shell

Then rebuild with NUMA=0

$ {{{1}}}
Personal tools