<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 אחה״צ, "Fabian Deutsch" <<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>> כתב:<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 <<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>> wrote:<br>
> What is fakelvm?<br>
><br>
> We are interested in this for storage tests.<br>
<br>
It'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>
> בתאריך 22 בדצמ׳ 2015 6:24 אחה״צ, "Fabian Deutsch" <<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>><br>
> כתב:<br>
>><br>
>> Hey,<br>
>><br>
>> imgbased [1] is the layer management component in Node Next, leveraging<br>
>> lvm.<br>
>> In the last days I've added unittests for this component.<br>
>><br>
>> After Ryan ramped up the jobs, I spent some time to fix the unit tests.<br>
>> Previously imgbased was tested inside VMs to run the unit tests.<br>
>> Now I moved to a fake LVM which is modeling the real LVm behavior, to<br>
>> run the unit tests.<br>
>><br>
>> This is _much_ quicker, and much easier to handle.<br>
>><br>
>> To try it yourself, just clone [1] and run<br>
>><br>
>> $ make check<br>
>><br>
>> - fabian<br>
>><br>
>><br>
>> --<br>
>> [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>
>><br>
>> --<br>
>> Fabian Deutsch <<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>><br>
>> RHEV Hypervisor<br>
>> Red Hat<br>
>> _______________________________________________<br>
>> Devel mailing list<br>
>> <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
>> <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 <<a href="mailto:fdeutsch@redhat.com">fdeutsch@redhat.com</a>><br>
RHEV Hypervisor<br>
Red Hat<br>
</blockquote></div>