]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
functional: ensure sockets and files are closed
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 15 Jul 2025 14:30:18 +0000 (15:30 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 21 Jul 2025 05:58:57 +0000 (07:58 +0200)
The multiprocess and virtio_gpu tests open sockets but then forget
to close them, which triggers resource leak warnings

The virtio_gpu test also fails to close a log file it opens.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250715143023.1851000-10-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/test_multiprocess.py
tests/functional/test_virtio_gpu.py

index 751cf10e635cd23929efd047de334723c0850300..92d5207b0eb2086edc68074b5ed0f9c6ce81ffc1 100755 (executable)
@@ -83,6 +83,9 @@ class Multiprocess(QemuSystemTest):
                                           'cat /sys/bus/pci/devices/*/uevent',
                                           'PCI_ID=1000:0012')
 
+        proxy_sock.close()
+        remote_sock.close()
+
     def test_multiprocess(self):
         kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
         if self.arch == 'x86_64':
index 81c9156d63876488283a415a55bfe2862417d253..be96de24da219ff568bf57340ef9a858df4c8702 100755 (executable)
@@ -108,6 +108,7 @@ class VirtioGPUx86(QemuSystemTest):
             shell=False,
             close_fds=False,
         )
+        self._vug_log_file.close()
 
         self.vm.set_console()
         self.vm.add_args("-cpu", "host")
@@ -135,6 +136,7 @@ class VirtioGPUx86(QemuSystemTest):
                                           "features: +virgl +edid")
         self.vm.shutdown()
         qemu_sock.close()
+        vug_sock.close()
         vugp.terminate()
         vugp.wait()