<div dir="ltr"><div><div><div>Hello,<br><br></div>I would solve this by running my program in a chroot environment in some way. Chroot is used to <span class="gmail-_Tgc">change the apparent root directory for some running process and its children. You can then set up a mock /proc under e.g. /tmp/mock, and run your tests with chroot under pretense that /tmp/mock is your actual root folder. From python you can do this with os.chroot.<br><br></span></div><span class="gmail-_Tgc">Regards,<br></span></div><span class="gmail-_Tgc">Johan Olsén<br></span><div><div><span class="gmail-_Tgc"><br> <br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-24 14:51 GMT+01:00 David Palao <span dir="ltr">&lt;<a href="mailto:dpalao.python@gmail.com" target="_blank">dpalao.python@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I am writing a program that does something based on information read<br>
from /proc (the target OS is linux). But I have some problems figuring<br>
out how to mock the /proc filesystem, or at least, some files in it.<br>
<br>
The rationale is that I want to change some files inside /proc to<br>
simulate different configurations of the host computer so that I can<br>
run my functional tests against those different configurations.<br>
<br>
I was thinking in using docker for this task. But<br>
1) this is offtopic here :)<br>
and<br>
2) I would like to learn what is the standard way to deal with such<br>
situations. If there is a &quot;standard way&quot; at all... I mean, what am I<br>
supposed to do from the point of view of TDD?<br>
<br>
I would appreciate if someone with experience in such problems could<br>
share some advice.<br>
<br>
Best,<br>
<br>
<br>
David<br>
<br>
______________________________<wbr>_________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.<wbr>org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" rel="noreferrer" target="_blank">http://lists.idyll.org/<wbr>listinfo/testing-in-python</a><br>
</blockquote></div><br></div>