[PATCH 0/2] tests: Stabilize tests when environment leaks FDs into them

Peter Krempa via Devel posted 2 patches 1 day, 23 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1778667163.git.pkrempa@redhat.com
src/libvirt_private.syms |   1 +
src/util/vircommand.c    | 101 +++++++++++++++++++++------------------
src/util/vircommand.h    |   3 ++
tests/testutils.c        |  10 ++++
4 files changed, 69 insertions(+), 46 deletions(-)
[PATCH 0/2] tests: Stabilize tests when environment leaks FDs into them
Posted by Peter Krempa via Devel 1 day, 23 hours ago
Jirka reported to me that one of the test cases I've introduced started
to fail for him. It turned out that flatpak "leaks" a FD of the wayland
socket to run programs in his env, which broke a test case wanting to
use fd '205'. (we use stable FD numbers via dup2 to ensure output stays
 identical)

To prevent this from happening refactor virCommandMassClose and use it
in all tests to close everything except stdio.

Peter Krempa (2):
  util: command: Extract non-virCommand related bits from
    virCommandMassClose
  testutils: Close FDs leaked into test programs to avoid random
    breakage

 src/libvirt_private.syms |   1 +
 src/util/vircommand.c    | 101 +++++++++++++++++++++------------------
 src/util/vircommand.h    |   3 ++
 tests/testutils.c        |  10 ++++
 4 files changed, 69 insertions(+), 46 deletions(-)

-- 
2.54.0