From c577420e40a353f3038263bf8ef763f7c01f6f22 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 24 May 2013 19:55:21 +0200 Subject: Add a framework for integration test configuration Integration tests are configured via environment variables. Add a framework for parsing these variables and storing them in easy-to-use objects. Add an `ipa-test-config` executable that loads the configuration and prints out variables needed in shell scripts. Part of the work for https://fedorahosted.org/freeipa/ticket/3621 --- ipatests/beakerlib_plugin.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'ipatests/beakerlib_plugin.py') diff --git a/ipatests/beakerlib_plugin.py b/ipatests/beakerlib_plugin.py index 2ad2674eb..7478a82e5 100644 --- a/ipatests/beakerlib_plugin.py +++ b/ipatests/beakerlib_plugin.py @@ -32,14 +32,6 @@ from ipapython import ipautil from ipapython.ipa_log_manager import log_mgr -def shell_quote(string): - """Quote a string for the shell - - Adapted from Python3's shlex.quote - """ - return "'" + str(string).replace("'", "'\"'\"'") + "'" - - class BeakerLibLogHandler(logging.Handler): def __init__(self, beakerlib_command): super(BeakerLibLogHandler, self).__init__() @@ -103,7 +95,7 @@ class BeakerLibPlugin(Plugin): def run_beakerlib_command(self, cmd): """Given a command as a Popen-style list, run it in the Bash process""" for word in cmd: - self.bash.stdin.write(shell_quote(word)) + self.bash.stdin.write(ipautil.shell_quote(word)) self.bash.stdin.write(' ') self.bash.stdin.write('\n') self.bash.stdin.flush() -- cgit