mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
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.
This commit is contained in:
parent
ea5c800175
commit
d4cbe042ef
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user