From: Tom Hromatka Date: Wed, 28 Oct 2020 14:08:59 +0000 (+0000) Subject: ftests: Add support for shell commands in containers X-Git-Tag: v2.0.3~11^2^2~31^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=973ecc22f6599ee9907a72cc467f004bc8e55842;p=thirdparty%2Flibcgroup.git ftests: Add support for shell commands in containers Add support for shell commands to Container.run() method. The parameter, shell_bool, is passed directly to Run.run() and is ultimately sent on to subprocess.Popen(). As the name implies, when shell_bool is set to true, the requested command will be executed through the shell. Signed-off-by: Tom Hromatka --- diff --git a/ftests/container.py b/ftests/container.py index 948018e6..8fc468d0 100644 --- a/ftests/container.py +++ b/ftests/container.py @@ -126,7 +126,7 @@ class Container(object): return Run.run(cmd) - def run(self, cntnr_cmd): + def run(self, cntnr_cmd, shell_bool=False): cmd = list() if self.privileged: @@ -148,7 +148,7 @@ class Container(object): else: raise ContainerError('Unsupported command type') - return Run.run(cmd).decode('ascii') + return Run.run(cmd, shell_bool=shell_bool).decode('ascii') def start(self): cmd = list()