diff test/test_aslr.py @ 1863:b550845e500b

Use venv for test_aslr Otherwise we can't find the psutil dependency
author Matt Johnston <matt@ucc.asn.au>
date Sun, 30 Jan 2022 13:37:20 +0800
parents 2b3a8026a6ce
children d940f8007a45
line wrap: on
line diff
--- a/test/test_aslr.py	Sun Jan 30 10:23:06 2022 +0800
+++ b/test/test_aslr.py	Sun Jan 30 13:37:20 2022 +0800
@@ -8,7 +8,11 @@
 	Tests that two consecutive connections have different address layouts.
 	This indicates that re-exec makes ASLR work
 	"""
-	cmd = (Path(request.node.fspath).parent / "parent_dropbear_map.py").resolve()
+	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}"
+	print(cmd)
 	r = dbclient(request, cmd, capture_output=True, text=True)
 	map1 = r.stdout.rstrip()
 	print(r.stderr, file=sys.stderr)