1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
From: Guilhem Moulin <guilhem@debian.org>
Date: Fri, 1 Apr 2022 23:27:50 +0200
Subject: Support running test_aslr without venv.
Without this patch the test fails because the remote shell can't parse
the command:
$ ; echo nay
bash: syntax error near unexpected token `;'
Forwarded: https://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/2022q2/002328.html
---
test/test_aslr.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/test_aslr.py b/test/test_aslr.py
index ec38844..b2fa272 100644
--- a/test/test_aslr.py
+++ b/test/test_aslr.py
@@ -9,9 +9,12 @@ def test_reexec(request, dropbear):
This indicates that re-exec makes ASLR work
"""
map_script = (Path(request.node.fspath).parent / "parent_dropbear_map.py").resolve()
- # run within the same venv, for python deps
activate = own_venv_command()
- cmd = f"{activate}; {map_script}"
+ if activate == "":
+ cmd = map_script
+ else:
+ # run within the same venv, for python deps
+ cmd = f"{activate}; {map_script}"
print(cmd)
r = dbclient(request, cmd, capture_output=True, text=True)
map1 = r.stdout.rstrip()
|