On Thu, Sep 17, 2020 at 02:06:33PM +0200, Christian Schoenebeck wrote: > On Donnerstag, 17. September 2020 11:55:00 CEST Thomas Huth wrote: > > On 17/09/2020 11.37, Daniel P. Berrangé wrote: > > > On Thu, Sep 17, 2020 at 10:26:36AM +0100, Alex Bennée wrote: > > >> Christian Schoenebeck <qemu_...@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. > > > > Another thing to consider: If you want to create Unix sockets in your > > tests, make sure that the file name does not get too long, since there > > are limits on certain systems - i.e. socket files should be created in a > > /tmp subdirectory, indeed. > > > > Thomas > > These answers already cover everything I need right now. Thanks! > > Final question: if at some later point one large file needs to be created for > some test case, is there some approximate size limit to stay below for not > causing issues with free CI cloud services?
A GIT source tree checkout of QEMU is approx 1 GB in size right now. A build with just one target enable takes another 1 GB. So if creating files in the source tree, or a build tree then, I'd suggest a rule of thumb is to stay below that level as a rough order of magnitude. If creating in /tmp then stay below 100 MB, as it can be surprisingly space constrained in some cases. Regards, Daniel -- |: 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 :|