Skip to content

Commit a2787eb

Browse files
committed
test base: remove --force from warnet down during cleanup
1 parent cf3935e commit a2787eb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

test/test_base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import logging
33
import logging.config
44
import os
5+
import pexpect
56
import re
7+
import sys
68
import threading
79
from pathlib import Path
810
from subprocess import run
@@ -45,7 +47,10 @@ def cleanup(self, signum=None, frame=None):
4547
try:
4648
self.log.info("Stopping network")
4749
if self.network:
48-
self.warnet("down --force")
50+
session = pexpect.spawn(f"warnet down", encoding="utf-8")
51+
session.logfile = sys.stdout
52+
session.expect("Do you want to bring down the running Warnet?", timeout=30)
53+
session.sendline("y")
4954
self.wait_for_all_tanks_status(target="stopped", timeout=60, interval=1)
5055
except Exception as e:
5156
self.log.error(f"Error bringing network down: {e}")

0 commit comments

Comments
 (0)