All of lore.kernel.org
 help / color / mirror / Atom feed
* Don't use sudo in python tests
@ 2022-10-22  8:24 Heinrich Schuchardt
  2022-10-22 12:04 ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2022-10-22  8:24 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Tom Rini

Hello Simon,

As described in doc/develop/py_testing.doc using sudo in python tests
should be avoided.

* users building U-Boot may not be sudoers
* running code as sudo comes with a risk

You added sudo in test/py/tests/test_ut.py

Can we use virt-make-fs here?

Best regards

Heinrich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Don't use sudo in python tests
  2022-10-22  8:24 Don't use sudo in python tests Heinrich Schuchardt
@ 2022-10-22 12:04 ` Tom Rini
  2022-10-22 18:44   ` Sean Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2022-10-22 12:04 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Simon Glass, U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

On Sat, Oct 22, 2022 at 10:24:33AM +0200, Heinrich Schuchardt wrote:
> Hello Simon,
> 
> As described in doc/develop/py_testing.doc using sudo in python tests
> should be avoided.
> 
> * users building U-Boot may not be sudoers
> * running code as sudo comes with a risk
> 
> You added sudo in test/py/tests/test_ut.py
> 
> Can we use virt-make-fs here?

Note that virt-make-fs is only suitable for trivial cases as it's
otherwise too slow. This is possibly one of the cases where it's too
slow.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Don't use sudo in python tests
  2022-10-22 12:04 ` Tom Rini
@ 2022-10-22 18:44   ` Sean Anderson
  2022-10-22 20:02     ` Tom Rini
  2022-10-22 22:00     ` Heinrich Schuchardt
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Anderson @ 2022-10-22 18:44 UTC (permalink / raw)
  To: Tom Rini, Heinrich Schuchardt; +Cc: Simon Glass, U-Boot Mailing List

On 10/22/22 08:04, Tom Rini wrote:
> On Sat, Oct 22, 2022 at 10:24:33AM +0200, Heinrich Schuchardt wrote:
>> Hello Simon,
>>
>> As described in doc/develop/py_testing.doc using sudo in python tests
>> should be avoided.
>>
>> * users building U-Boot may not be sudoers
>> * running code as sudo comes with a risk
>>
>> You added sudo in test/py/tests/test_ut.py
>>
>> Can we use virt-make-fs here?
> 
> Note that virt-make-fs is only suitable for trivial cases as it's
> otherwise too slow. This is possibly one of the cases where it's too
> slow.
> 

An easy way to do this is to use fuse2fs/fusefat.

--Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Don't use sudo in python tests
  2022-10-22 18:44   ` Sean Anderson
@ 2022-10-22 20:02     ` Tom Rini
  2022-10-22 22:00     ` Heinrich Schuchardt
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2022-10-22 20:02 UTC (permalink / raw)
  To: Sean Anderson; +Cc: Heinrich Schuchardt, Simon Glass, U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Sat, Oct 22, 2022 at 02:44:27PM -0400, Sean Anderson wrote:
> On 10/22/22 08:04, Tom Rini wrote:
> > On Sat, Oct 22, 2022 at 10:24:33AM +0200, Heinrich Schuchardt wrote:
> > > Hello Simon,
> > > 
> > > As described in doc/develop/py_testing.doc using sudo in python tests
> > > should be avoided.
> > > 
> > > * users building U-Boot may not be sudoers
> > > * running code as sudo comes with a risk
> > > 
> > > You added sudo in test/py/tests/test_ut.py
> > > 
> > > Can we use virt-make-fs here?
> > 
> > Note that virt-make-fs is only suitable for trivial cases as it's
> > otherwise too slow. This is possibly one of the cases where it's too
> > slow.
> 
> An easy way to do this is to use fuse2fs/fusefat.

I guess at this point some patches to migrate a test or two over, so we
can see how they perform, would be much appreciated.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Don't use sudo in python tests
  2022-10-22 18:44   ` Sean Anderson
  2022-10-22 20:02     ` Tom Rini
@ 2022-10-22 22:00     ` Heinrich Schuchardt
  2022-10-23  1:16       ` Sean Anderson
  1 sibling, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2022-10-22 22:00 UTC (permalink / raw)
  To: Sean Anderson, Tom Rini; +Cc: Simon Glass, U-Boot Mailing List



Am 22. Oktober 2022 20:44:27 MESZ schrieb Sean Anderson <seanga2@gmail.com>:
>On 10/22/22 08:04, Tom Rini wrote:
>> On Sat, Oct 22, 2022 at 10:24:33AM +0200, Heinrich Schuchardt wrote:
>>> Hello Simon,
>>> 
>>> As described in doc/develop/py_testing.doc using sudo in python tests
>>> should be avoided.
>>> 
>>> * users building U-Boot may not be sudoers
>>> * running code as sudo comes with a risk
>>> 
>>> You added sudo in test/py/tests/test_ut.py
>>> 
>>> Can we use virt-make-fs here?
>> 
>> Note that virt-make-fs is only suitable for trivial cases as it's
>> otherwise too slow. This is possibly one of the cases where it's too
>> slow.
>> 
>
>An easy way to do this is to use fuse2fs/fusefat.

My experience with fusefat is that it was terribly buggy 2-3 years ago.

Last upstream source is from 2018.

Best regards

Heinrich 

>
>--Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Don't use sudo in python tests
  2022-10-22 22:00     ` Heinrich Schuchardt
@ 2022-10-23  1:16       ` Sean Anderson
  0 siblings, 0 replies; 6+ messages in thread
From: Sean Anderson @ 2022-10-23  1:16 UTC (permalink / raw)
  To: Heinrich Schuchardt, Tom Rini; +Cc: Simon Glass, U-Boot Mailing List

On 10/22/22 18:00, Heinrich Schuchardt wrote:
> 
> 
> Am 22. Oktober 2022 20:44:27 MESZ schrieb Sean Anderson <seanga2@gmail.com>:
>> On 10/22/22 08:04, Tom Rini wrote:
>>> On Sat, Oct 22, 2022 at 10:24:33AM +0200, Heinrich Schuchardt wrote:
>>>> Hello Simon,
>>>>
>>>> As described in doc/develop/py_testing.doc using sudo in python tests
>>>> should be avoided.
>>>>
>>>> * users building U-Boot may not be sudoers
>>>> * running code as sudo comes with a risk
>>>>
>>>> You added sudo in test/py/tests/test_ut.py
>>>>
>>>> Can we use virt-make-fs here?
>>>
>>> Note that virt-make-fs is only suitable for trivial cases as it's
>>> otherwise too slow. This is possibly one of the cases where it's too
>>> slow.
>>>
>>
>> An easy way to do this is to use fuse2fs/fusefat.
> 
> My experience with fusefat is that it was terribly buggy 2-3 years ago.
> 
> Last upstream source is from 2018.

Yeah, I had not used it before. fuse2fs is nice. It doesn't support replaying
the journal, but this doesn't matter when creating a filesystem.

mtools seems incredibly clunky, but it appears to work, and has reasonable
performance.

LKL [1] seemed like it might have been the most robust solution (with lklfuse),
but it hasn't made it upstream yet (and the primary author seems to have stopped
trying).

--Sean

[1] https://github.com/lkl/linux

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-23  1:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-22  8:24 Don't use sudo in python tests Heinrich Schuchardt
2022-10-22 12:04 ` Tom Rini
2022-10-22 18:44   ` Sean Anderson
2022-10-22 20:02     ` Tom Rini
2022-10-22 22:00     ` Heinrich Schuchardt
2022-10-23  1:16       ` Sean Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.