mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user