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]:
|
def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any]:
|
||||||
global log
|
global log
|
||||||
log.log("starting VDE switch for network {}".format(vlan_nr))
|
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()
|
pty_master, pty_slave = pty.openpty()
|
||||||
vde_process = subprocess.Popen(
|
vde_process = subprocess.Popen(
|
||||||
["vde_switch", "-s", vde_socket, "--dirmode", "0777"],
|
["vde_switch", "-s", vde_socket, "--dirmode", "0700"],
|
||||||
bufsize=1,
|
bufsize=1,
|
||||||
stdin=pty_slave,
|
stdin=pty_slave,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
@ -939,7 +941,7 @@ if __name__ == "__main__":
|
||||||
machine.process.kill()
|
machine.process.kill()
|
||||||
|
|
||||||
for _, _, process, _ in vde_sockets:
|
for _, _, process, _ in vde_sockets:
|
||||||
process.kill()
|
process.terminate()
|
||||||
log.close()
|
log.close()
|
||||||
|
|
||||||
tic = time.time()
|
tic = time.time()
|
||||||
|
|
Loading…
Reference in New Issue