[U-Boot] [RFC 1/3] test/py: convert fs-test.sh to pytest

Tuomas Tynkkynen tuomas.tynkkynen at iki.fi
Tue Sep 4 19:26:07 UTC 2018


Hi,

On 08/31/2018 10:22 AM, AKASHI Takahiro wrote:
> Hi Tuomas,
> 
> Thank you for interesting pointers.
> 
> On Thu, Aug 30, 2018 at 01:56:41PM +0300, Tuomas Tynkkynen wrote:
>> Hi Heinrich, Takahiro
>>
>> On 08/30/2018 01:26 PM, AKASHI Takahiro wrote:
>>> On Thu, Aug 30, 2018 at 12:01:32PM +0200, Heinrich Schuchardt wrote:
>>>> On 08/30/2018 08:52 AM, AKASHI Takahiro wrote:
>>>>> On Wed, Aug 29, 2018 at 11:36:51PM +0200, Heinrich Schuchardt wrote:
...
>>>> Using sudo for me is a NO-NO. I will not run any test that uses sudo.
>>>
>>> So this means that you have never tested file system using test-fs.sh.
>>>
>>> Since my script is logically "general", it can, if we want, run against
>>> other file systems as well. "sudo mount" is the only solution for those cases.
>>>
>> There are two general non-root implementations that I know of:
>>
>> 1) http://libguestfs.org/ which IIRC launches a small Linux VM in QEMU
>>     to do the filesystem accesses. I am not sure if the performance would be
>>     acceptable without KVM (which I assume we don't have in Travis).
> 
> I didn't dig into this tool, but if it is all about VM on qemu,
> the discussion here, whether we should be allowed to use sudo or not,
> would be pointless as we can do whatever we want to do under VM.
>

But that's exactly what was wanted - that the user running the tests for U-Boot
doesn't need to have sudo access on their build machine.

BTW I briefly benchmarked this on a AWS free-tier machine (no KVM available),
and copying a 2G file onto an ext4 partition took:

- 33s natively (sudo mount -o loop fs.img /mnt; sudo cp bigfile /mnt/; sudo umount /mnt)
- 2m 44s with guestfs (guestfish add fs.img : run : mount /dev/sda / : copy-in bigfile /)

so a 80% slowdown for things like Travis CI but still not unbearably slow.
I'm assuming here that it will run much faster with KVM and that developers usually
have KVM-capable machines so this shouldn't affect developers too badly.


>> 2) https://github.com/lkl/linux which is a port of Linux to run in userspace
>>     as a library. It comes with tools like cptofs and lklfuse to access any
>>     filesystem Linux has a driver for.
> 
> It appears to be a kind of libos or unikernel, or rather,
> resembles a sandbox of u-boot?

Correct.

> 
>> Sadly lkl isn't packaged in many distros.
> 
> Too bad.
> 

Yes, I'd say libguestfs is the most promising solution so far.


More information about the U-Boot mailing list