[Freeipa-devel] [PATCHES] [WIP] 0337-0343 YAML test configuration

Petr Viktorin pviktori at redhat.com
Thu Dec 12 11:40:25 UTC 2013


Hello Tomáš! I'm planning a little Christmas present for you. Instead of 
a surprise I'm Releasing early :)
Apply patches or: git pull http://github.com/encukou/freeipa yaml-config


These patches add YAML/JSON configuration for tests.

YAML/JSON is completely optional, the existing envvar style continues to 
work. The ipa-test-config tool can convert between the two (which is not 
just for show, export will be needed for debugging and unit tests).
If you choose to use YAML, you need PyYAML (python-yaml) installed.


Example:

$ MASTER=master.ipa.test REPLICA=repl.ipa.test 
TESTHOST_XYZ_env1=xyz.ipa.test BEAKERMASTER1_IP_env1=1.2.3.4 
BEAKERREPLICA1_IP_env1=1.2.3.5 BEAKERXYZ1_IP_env1=1.2.3.6 
ipa-test-config --global --yaml | tee /tmp/testconf.yaml
ad_admin_name: Administrator
ad_admin_password: Secret123
admin_name: admin
admin_password: Secret123
debug: false
dirman_dn: cn=Directory Manager
dirman_password: Secret123
dns_forwarder: 8.8.8.8
domains:
- hosts:
     master:
       external_hostname: master.ipa.test
       ip: 1.2.3.4
       role: master
     repl:
       external_hostname: repl.ipa.test
       ip: 1.2.3.5
       role: replica
     xyz:
       external_hostname: xyz.ipa.test
       ip: 1.2.3.6
       role: xyz
   name: ipa.test
   type: IPA
ipv6: false
nis_domain: ipatest
ntp_server: 2.pool.ntp.org
root_password: null
root_ssh_key_filename: ~/.ssh/id_rsa
test_dir: /root/ipatests

$ IPATEST_YAML_CONFIG=/tmp/testconf.yaml ipa-run-tests ...



What's left is to update the design and write tests. I'll get to it 
eventually, but now I'll probably be busy for a few days. If you'd like 
to do them as part of review, tests could be in the format:

from ipatests.test_integration import config
conf = config.Config.from_env($environment)
assert conf.to_dict() == {$result}

conf = config.Config.from_dict($inputdict)
assert conf.to_dict() == {$result}


https://fedorahosted.org/freeipa/ticket/3938

-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0337-test_integration.config-Fix-crash-in-to_env-when-no-.patch
Type: text/x-patch
Size: 2357 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0338-test_integration.config-Do-not-save-the-input-enviro.patch
Type: text/x-patch
Size: 5025 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0339-test_integration.config-Use-a-more-declarative-appro.patch
Type: text/x-patch
Size: 7278 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0340-test_integration.config-Do-not-store-the-index-in-Do.patch
Type: text/x-patch
Size: 8584 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0341-test_integration.config-Load-store-from-to-dicts.patch
Type: text/x-patch
Size: 6120 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0342-test_integration.config-Add-environment-variables-fo.patch
Type: text/x-patch
Size: 1953 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0343-ipa-test-config-Add-json-and-yaml-output-options.patch
Type: text/x-patch
Size: 3905 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131212/86645f83/attachment-0006.bin>


More information about the Freeipa-devel mailing list