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

Tomas Babej tbabej at redhat.com
Mon Mar 3 12:41:38 UTC 2014


Finally got to this patchset!

PATCH 337: ACK
PATCH 338: ACK

This prohibits us to use extra roles that end in digits. Can you put a
note explaining that in

http://www.freeipa.org/page/V3/Integration_testing#Host_configuration

Also, this wiki page points out to environment variables so that it
seems it is the preferred method of configuration. We should mention
more user friendly YAML here first.

PATCH 339: ACK
PATCH 340: ACK
PATCH 341:

The have_master variable seems redundant in from_dict method (it's only
a local definition and not referenced anywhere else):

+    def from_dict(cls, dct, config):
+        from ipatests.test_integration.host import BaseHost
+
+        domain_type = dct.pop('type')
+        assert domain_type in ('IPA', 'AD')
+        domain_name = dct.pop('name')
+        self = cls(config, domain_name, domain_type)
+
+        have_master = False
+        for host_dict in dct.pop('hosts'):
+            host = BaseHost.from_dict(host_dict, self)
+            self.hosts.append(host)
+            if host.role == 'master':
+                have_master = True
+
+        check_config_dict_empty(dct, 'domain %s' % domain_name)
+
+        return self

PATCH 342: ACK
PATCH 343: ACK

PATCH 348: ACK
PATCH 349: ACK


On 01/06/2014 11:13 AM, Petr Viktorin wrote:
> 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.
>

-- 
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 




More information about the Freeipa-devel mailing list