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

Petr Viktorin pviktori at redhat.com
Mon Jan 6 10:13:05 UTC 2014


On 12/12/2013 12:40 PM, Petr Viktorin wrote:
> 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

Tests added, new version attached.
As for #4081 (Export dynamic roles properly in ipa-test-config), hosts 
are exported like static roles are (from the TestComplexConfig case):

TESTHOST_EXTRAROLEM_env1="extram1.ipadomain.test extram2.ipadomain.test",
TESTHOST_EXTRAROLEM1_env1="extram1.ipadomain.test"
TESTHOST_EXTRAROLEM2_env1="extram2.ipadomain.test"

For cases where there's just a single host of the role, it'll export it 
both with the number and without.

-- 
Petr³

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0337.2-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/20140106/5580d477/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0338.2-test_integration.config-Do-not-save-the-input-enviro.patch
Type: text/x-patch
Size: 5588 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0339.2-test_integration.config-Use-a-more-declarative-appro.patch
Type: text/x-patch
Size: 7368 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0340.2-test_integration.config-Do-not-store-the-index-in-Do.patch
Type: text/x-patch
Size: 8601 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0341.2-test_integration.config-Load-store-from-to-dicts.patch
Type: text/x-patch
Size: 6299 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0342.2-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/20140106/5580d477/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0343.2-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/20140106/5580d477/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0348.2-test_integration.config-Convert-some-text-values-to-.patch
Type: text/x-patch
Size: 3098 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0349.2-Add-tests-for-integration-test-configuration.patch
Type: text/x-patch
Size: 17460 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140106/5580d477/attachment-0008.bin>


More information about the Freeipa-devel mailing list