<p dir="ltr">Intersting, we are working on this:<br>
<a href="https://github.com/oVirt/vdsm/blob/master/tests/storagefakelib.py">https://github.com/oVirt/vdsm/blob/master/tests/storagefakelib.py</a></p>
<p dir="ltr">But it fakes vdsm module, not the underlying lvm commands.</p>
<div class="gmail_quote">בתאריך 22 בדצמ׳ 2015 6:50 אחה״צ,‏ &quot;Fabian Deutsch&quot; &lt;<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>&gt; כתב:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Dec 22, 2015 at 5:35 PM, Nir Soffer &lt;<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>&gt; wrote:<br>
&gt; What is fakelvm?<br>
&gt;<br>
&gt; We are interested in this for storage tests.<br>
<br>
It&#39;s actually a small class which mimics  teh LVM behavior.<br>
<br>
It was written from scratch - and is still rough. But the idea works out.<br>
It is intended to be used with python-mock.<br>
<br>
The module is here:<br>
<a href="https://gerrit.ovirt.org/gitweb?p=imgbased.git;a=blob;f=tests/fakelvm.py;hb=HEAD" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/gitweb?p=imgbased.git;a=blob;f=tests/fakelvm.py;hb=HEAD</a><br>
<br>
One consumer of this is:<br>
<a href="https://gerrit.ovirt.org/gitweb?p=imgbased.git;a=blob;f=tests/testSanity.py;hb=HEAD" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/gitweb?p=imgbased.git;a=blob;f=tests/testSanity.py;hb=HEAD</a><br>
<br>
The biggest gap is to document it and get the API straight.<br>
<br>
I.e. currently I tried to follow the following pattern:<br>
<br>
lv = LV()  # To instantiate a LV<br>
lv = VG().create(…)  # To create a mocked VG<br>
<br>
- fabian<br>
<br>
&gt; בתאריך 22 בדצמ׳ 2015 6:24 אחה״צ,‏ &quot;Fabian Deutsch&quot; &lt;<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>&gt;<br>
&gt; כתב:<br>
&gt;&gt;<br>
&gt;&gt; Hey,<br>
&gt;&gt;<br>
&gt;&gt; imgbased [1] is the layer management component in Node Next, leveraging<br>
&gt;&gt; lvm.<br>
&gt;&gt; In the last days I&#39;ve added unittests for this component.<br>
&gt;&gt;<br>
&gt;&gt; After Ryan ramped up the jobs, I spent some time to fix the unit tests.<br>
&gt;&gt; Previously imgbased was tested inside VMs to run the unit tests.<br>
&gt;&gt; Now I moved to a fake LVM which is modeling the real LVm behavior, to<br>
&gt;&gt; run the unit tests.<br>
&gt;&gt;<br>
&gt;&gt; This is _much_ quicker, and much easier to handle.<br>
&gt;&gt;<br>
&gt;&gt; To try it yourself, just clone [1] and run<br>
&gt;&gt;<br>
&gt;&gt; $ make check<br>
&gt;&gt;<br>
&gt;&gt; - fabian<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; [1] <a href="https://gerrit.ovirt.org/gitweb?p=imgbased.git" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/gitweb?p=imgbased.git</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Fabian Deutsch &lt;<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>&gt;<br>
&gt;&gt; RHEV Hypervisor<br>
&gt;&gt; Red Hat<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Devel mailing list<br>
&gt;&gt; <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
&gt;&gt; <a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/devel</a><br>
<br>
<br>
<br>
--<br>
Fabian Deutsch &lt;<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>&gt;<br>
RHEV Hypervisor<br>
Red Hat<br>
</blockquote></div>