From 286d3dbc2879e8d95435ef693a5d5768f88aebfd Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: May 24 2017 12:27:42 +0000 Subject: don't generate self.run(..., shell=True) calls This causes the host-side shell to expand variables breaking things in non-obvious ways. --- diff --git a/moduleframework/generator.py b/moduleframework/generator.py index cd48750..845da59 100755 --- a/moduleframework/generator.py +++ b/moduleframework/generator.py @@ -64,7 +64,9 @@ class GeneratedTestsConfig(module_framework.AvocadoTest): self.start() """ % testname for line in testlines: - self.output = self.output + ' self.%s(""" %s """, shell=True)\n' % (method, line) + # only use shell=True for runHost() calls, otherwise variables etc. + # get expanded too early, i.e. on the host + self.output = self.output + ' self.%s(""" %s """, shell=%r)\n' % (method, line, method == "runHost") print("Added test (runmethod: %s): %s" % (method, testname))