From 973ecc22f6599ee9907a72cc467f004bc8e55842 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Wed, 28 Oct 2020 14:08:59 +0000 Subject: [PATCH] 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 --- ftests/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() -- 2.47.2