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
This commit is contained in:
Petr Viktorin
2013-05-24 19:55:21 +02:00
parent 226f9d681d
commit c577420e40
6 changed files with 484 additions and 10 deletions

View File

@@ -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()