Merge pull request #83598 from mmilata/test-driver-delete-vdectl
test-driver.py: don't leave vde1.ctl around
This commit is contained in:
commit
50b48ddd95
@ -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…
x
Reference in New Issue
Block a user