summaryrefslogtreecommitdiffstats
path: root/ipatests/util.py
diff options
context:
space:
mode:
authorMilan KubĂ­k <mkubik@redhat.com>2015-08-23 16:19:59 +0200
committerMartin Basti <mbasti@redhat.com>2015-09-16 18:51:56 +0200
commit1550b5ab50966387bac19f46b34a2107010d08d4 (patch)
tree8bc902debafde360cd34e6fc7c487962e742e244 /ipatests/util.py
parenta4aace730cefa3f24e23b985fb8edd6bd06262e3 (diff)
downloadfreeipa-1550b5ab50966387bac19f46b34a2107010d08d4.tar.gz
freeipa-1550b5ab50966387bac19f46b34a2107010d08d4.tar.xz
freeipa-1550b5ab50966387bac19f46b34a2107010d08d4.zip
ipatests: Add basic tests for certificate profile plugin
Reviewed-By: Lenka Doudova <ldoudova@redhat.com> Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
Diffstat (limited to 'ipatests/util.py')
-rw-r--r--ipatests/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ipatests/util.py b/ipatests/util.py
index 5a6595a62..2039095b0 100644
--- a/ipatests/util.py
+++ b/ipatests/util.py
@@ -650,3 +650,13 @@ class MockLDAP(object):
def unbind(self):
if self.connection is not None:
self.connection.unbind_s()
+
+
+def prepare_config(template, values):
+ with open(template) as f:
+ template = f.read()
+
+ with tempfile.NamedTemporaryFile(mode='w', delete=False) as config:
+ config.write(template.format(**values))
+
+ return config.name