Skip to content

Commit

Permalink
Fix node debugging in e2e tests (#6646)
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou authored Nov 14, 2024
1 parent 73321de commit 835924f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion tests/infra/e2e_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def max_f(args, number_nodes):
return (number_nodes - 1) // 2


def default_platform():
if os.path.exists("PLATFORM"):
with open("PLATFORM") as f:
return f.read().strip()
return "virtual"


def cli_args(
add=lambda x: None,
parser=None,
Expand Down Expand Up @@ -110,7 +117,9 @@ def cli_args(
"-t",
"--enclave-platform",
help="Enclave platform (Trusted Execution Environment)",
default=os.getenv("TEST_ENCLAVE", os.getenv("DEFAULT_ENCLAVE_PLATFORM", "sgx")),
default=os.getenv(
"TEST_ENCLAVE", os.getenv("DEFAULT_ENCLAVE_PLATFORM", default_platform())
),
choices=("sgx", "snp", "virtual"),
)
log_level_choices = ("trace", "debug", "info", "fail", "fatal")
Expand Down
4 changes: 2 additions & 2 deletions tests/infra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from loguru import logger as LOG

DBG = os.getenv("DBG", "cgdb")
DBG = os.getenv("DBG", "lldb")

# Duration after which unresponsive node is declared as crashed on startup
REMOTE_STARTUP_TIMEOUT_S = 5
Expand Down Expand Up @@ -269,7 +269,7 @@ def get_cmd(self, include_dir=True):

def debug_node_cmd(self):
cmd = " ".join(self.cmd)
return f"cd {self.root} && {DBG} --args {cmd}"
return f"cd {self.root} && {DBG} -- {cmd}"

def check_done(self):
return self.proc is not None and self.proc.poll() is not None
Expand Down

0 comments on commit 835924f

Please sign in to comment.