[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QEMU policy for real file tests

From: Daniel P . Berrangé
Subject: Re: QEMU policy for real file tests
Date: Thu, 17 Sep 2020 10:37:56 +0100
User-agent: Mutt/1.14.6 (2020-07-11)

On Thu, Sep 17, 2020 at 10:26:36AM +0100, Alex Bennée wrote:
> Christian Schoenebeck <qemu_oss@crudebyte.com> writes:
> > Hi,
> >
> > is there a QEMU policy for test cases that create/write/read/delete real 
> > files 
> > and directories? E.g. should they be situated at a certain location and is 
> > any 
> > measure of sandboxing required?
> I don't think we have a hard and fast policy. It also depends on what
> you are doing the test in - but ideally you should use a secure mktempd
> (that can't clash) and clean-up after you are finished. This is a bit
> easier in python than shell I think.

mktempd will end up on /tmp usually which can be tmpfs and size limited,
so be mindful of the size of files you create. Don't assume you can
create multi-GB sized files !  Creating a temp dir underneath the build
dir (effectively CWD of the test) is a reasonable alternative.

> For example iotests end up in $BUILD_DIR/scratch (driven by TEST_DIR
> being set somewhere) whereas the gdb stub tests use socket_dir =
> TemporaryDirectory("qemu-gdbstub") which get auto-cleaned when it
> finishes.

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

reply via email to

[Prev in Thread] Current Thread [Next in Thread]