On Mon, Dec 02, 2024 at 10:19:47AM +0100, Thomas Huth wrote: > On 29/11/2024 18.31, Daniel P. Berrangé wrote: > > Add helper methods that construct paths for > > > > * log files - to be preserved at the end of a test > > * scratch files - to be purged at the end of a test > > * build files - anything relative to the build root > > * data files - anything relative to the functional test source root > > * socket files - a short temporary dir to avoid UNIX socket limits > > > > These are to be used instead of direct access to the self.workdir, > > or self.logdir variables, or any other place where paths are built > > manually. > > > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> > > --- > > tests/functional/qemu_test/testcase.py | 86 ++++++++++++++++++++++++++ > > 1 file changed, 86 insertions(+)
> > + ''' > > + def log_file(self, *args): > > + return str(Path(self.logdir, *args)) > > + > > def setUp(self, bin_prefix): > > self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must > > be set') > > self.arch = self.qemu_bin.split('-')[-1] > > + self.socketdir = None > > Should we also delete the socketdir during teardown again? Yes, we should be purging this object and deleting the dir With 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 :|