diff options
author | Martin Milata <martin@martinmilata.cz> | 2020-03-28 15:29:49 +0100 |
---|---|---|
committer | Martin Milata <martin@martinmilata.cz> | 2020-03-29 00:03:59 +0100 |
commit | d4cbe042ef5cfd763ce712c5e1d21399e19c0f17 (patch) | |
tree | 1ff8f2ae4e6a6e7b533062ccb06a7d2139913c61 /nixos | |
parent | ea5c800175f3bec015ff04a68649bc1aa422c2e8 (diff) |
test-driver.py: use temporary dir for vde1.ctl
Send SIGTERM instead of SIGKILL to vde_switch to give it chance to delete the directories.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/test-driver/test-driver.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 7825025893d3a..744fadb1a4f3f 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -102,10 +102,12 @@ def make_command(args: list) -> str: def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any]: global log log.log("starting VDE switch for network {}".format(vlan_nr)) - vde_socket = os.path.abspath("./vde{}.ctl".format(vlan_nr)) + vde_socket = tempfile.mkdtemp( + prefix="nixos-test-vde-", suffix="-vde{}.ctl".format(vlan_nr) + ) pty_master, pty_slave = pty.openpty() vde_process = subprocess.Popen( - ["vde_switch", "-s", vde_socket, "--dirmode", "0777"], + ["vde_switch", "-s", vde_socket, "--dirmode", "0700"], bufsize=1, stdin=pty_slave, stdout=subprocess.PIPE, @@ -939,7 +941,7 @@ if __name__ == "__main__": machine.process.kill() for _, _, process, _ in vde_sockets: - process.kill() + process.terminate() log.close() tic = time.time() |