diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-11-10 16:47:29 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-11-19 10:31:42 -0500 |
commit | d4f25453e116ca132208e99d5e320500efbe5d9c (patch) | |
tree | 658ba9a4d0429480a7e40043440d6b7eac2370c9 /tests | |
parent | 2046eddb7ab3e56f57f9decd172f6354f0a945aa (diff) | |
download | freeipa.git-d4f25453e116ca132208e99d5e320500efbe5d9c.tar.gz freeipa.git-d4f25453e116ca132208e99d5e320500efbe5d9c.tar.xz freeipa.git-d4f25453e116ca132208e99d5e320500efbe5d9c.zip |
Add managedby to Host entries
This will allow others to provision on behalf of the host.
ticket 280
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/test_host_plugin.py | 112 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_hostgroup_plugin.py | 1 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_netgroup_plugin.py | 1 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_service_plugin.py | 2 |
4 files changed, 113 insertions, 3 deletions
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py index 283674c2..6026efea 100644 --- a/tests/test_xmlrpc/test_host_plugin.py +++ b/tests/test_xmlrpc/test_host_plugin.py @@ -35,6 +35,9 @@ service1 = u'dns/%s@%s' % (fqdn1, api.env.realm) service1dn = u'krbprincipalname=%s,cn=services,cn=accounts,%s' % (service1.lower(), api.env.basedn) fqdn2 = u'shouldnotexist.%s' % api.env.domain dn2 = u'fqdn=%s,cn=computers,cn=accounts,%s' % (fqdn2, api.env.basedn) +fqdn3 = u'testhost2.%s' % api.env.domain +short3 = u'testhost2' +dn3 = u'fqdn=%s,cn=computers,cn=accounts,%s' % (fqdn3, api.env.basedn) servercert = 'MIICbzCCAdigAwIBAgICA/4wDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMDgwOTE1MDIyN1oXDTIwMDgwOTE1MDIyN1owKTEMMAoGA1UEChMDSVBBMRkwFwYDVQQDExBwdW1hLmdyZXlvYWsuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwYbfEOQPgGenPn9vt1JFKvWm/Je3y2tawGWA3LXDuqfFJyYtZ8ib3TcBUOnLk9WK5g2qCwHaNlei7bj8ggIfr5hegAVe10cun+wYErjnYo7hsHYd+57VZezeipWrXu+7NoNd4+c4A5lk4A/xJay9j3bYx2oOM8BEox4xWYoWge1ljPrc5JK46f0X7AGW4F2VhnKPnf8rwSuzI1U8VGjutyM9TWNy3m9KMWeScjyG/ggIpOjUDMV7HkJL0Di61lznR9jXubpiEC7gWGbTp84eGl/Nn9bgK1AwHfJ2lHwfoY4uiL7ge1gyP6EvuUlHoBzdb7pekiX28iePjW3iEG9IawIDAQABoyIwIDARBglghkgBhvhCAQEEBAMCBkAwCwYDVR0PBAQDAgUgMA0GCSqGSIb3DQEBBQUAA4GBACRESLemRV9BPxfEgbALuxH5oE8jQm8WZ3pm2pALbpDlAd9wQc3yVf6RtkfVthyDnM18bg7IhxKpd77/p3H8eCnS8w5MLVRda6ktUC6tGhFTS4QKAf0WyDGTcIgkXbeDw0OPAoNHivoXbIXIIRxlw/XgaSaMzJQDBG8iROsN4kCv' @@ -44,6 +47,7 @@ class test_host(Declarative): cleanup_commands = [ ('host_del', [fqdn1], {}), ('host_del', [fqdn2], {}), + ('host_del', [fqdn3], {}), ('service_del', [service1], {}), ] @@ -90,6 +94,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[fqdn1], ), ), ), @@ -120,7 +125,8 @@ class test_host(Declarative): description=[u'Test host 1'], l=[u'Undisclosed location 1'], krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], - has_keytab=False + has_keytab=False, + managedby_host=[fqdn1], ), ), ), @@ -145,7 +151,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], serverhostname=[u'testhost1'], objectclass=objectclasses.host, - managedby=[dn1], + managedby_host=[fqdn1], ipauniqueid=[fuzzy_uuid], has_keytab=False ), @@ -167,6 +173,7 @@ class test_host(Declarative): description=[u'Test host 1'], l=[u'Undisclosed location 1'], krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], + managedby_host=[u'%s' % fqdn1], ), ], ), @@ -194,8 +201,8 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], serverhostname=[u'testhost1'], objectclass=objectclasses.host, - managedby=[dn1], ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn1], ), ], ), @@ -214,6 +221,7 @@ class test_host(Declarative): fqdn=[fqdn1], l=[u'Undisclosed location 1'], krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], + managedby_host=[u'%s' % fqdn1], usercertificate=[base64.b64decode(servercert)], valid_not_before=u'Mon Aug 09 15:02:27 2010 UTC', valid_not_after=u'Sun Aug 09 15:02:27 2020 UTC', @@ -240,6 +248,7 @@ class test_host(Declarative): l=[u'Undisclosed location 1'], krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], has_keytab=False, + managedby_host=[u'%s' % fqdn1], usercertificate=[base64.b64decode(servercert)], valid_not_before=u'Mon Aug 09 15:02:27 2010 UTC', valid_not_after=u'Sun Aug 09 15:02:27 2020 UTC', @@ -252,6 +261,101 @@ class test_host(Declarative): ), ), + dict( + desc='Create %r' % fqdn3, + command=('host_add', [fqdn3], + dict( + description=u'Test host 2', + l=u'Undisclosed location 2', + force=True, + ), + ), + expected=dict( + value=fqdn3, + summary=u'Added host "%s"' % fqdn3, + result=dict( + dn=dn3, + fqdn=[fqdn3], + description=[u'Test host 2'], + l=[u'Undisclosed location 2'], + krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)], + objectclass=objectclasses.host, + ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn3], + ), + ), + ), + + + dict( + desc='Add managedby_host %r to %r' % (fqdn1, fqdn3), + command=('host_add_managedby', [fqdn3], + dict( + host=u'%s' % fqdn1, + ), + ), + expected=dict( + completed=1, + failed=dict( + managedby = dict( + host=tuple(), + ), + ), + result=dict( + dn=dn3, + fqdn=[fqdn3], + description=[u'Test host 2'], + l=[u'Undisclosed location 2'], + krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)], + managedby_host=[u'%s' % fqdn3, u'%s' % fqdn1], + ), + ), + ), + + dict( + desc='Retrieve %r' % fqdn3, + command=('host_show', [fqdn3], {}), + expected=dict( + value=fqdn3, + summary=None, + result=dict( + dn=dn3, + fqdn=[fqdn3], + description=[u'Test host 2'], + l=[u'Undisclosed location 2'], + krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)], + has_keytab=False, + managedby_host=[u'%s' % fqdn3, u'%s' % fqdn1], + ), + ), + ), + + dict( + desc='Remove managedby_host %r from %r' % (fqdn1, fqdn3), + command=('host_remove_managedby', [fqdn3], + dict( + host=u'%s' % fqdn1, + ), + ), + expected=dict( + completed=1, + failed=dict( + managedby = dict( + host=tuple(), + ), + ), + result=dict( + dn=dn3, + fqdn=[fqdn3], + description=[u'Test host 2'], + l=[u'Undisclosed location 2'], + krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)], + managedby_host=[u'%s' % fqdn3], + ), + ), + ), + + dict( desc='Try to rename %r' % fqdn1, @@ -313,6 +417,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn1], ), ), ), @@ -383,6 +488,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn2, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn2], ), ), ), diff --git a/tests/test_xmlrpc/test_hostgroup_plugin.py b/tests/test_xmlrpc/test_hostgroup_plugin.py index 70cbe3d4..1d143f0c 100644 --- a/tests/test_xmlrpc/test_hostgroup_plugin.py +++ b/tests/test_xmlrpc/test_hostgroup_plugin.py @@ -113,6 +113,7 @@ class test_hostgroup(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[fqdn1], ), ), ), diff --git a/tests/test_xmlrpc/test_netgroup_plugin.py b/tests/test_xmlrpc/test_netgroup_plugin.py index 76874daa..4c3aeafc 100644 --- a/tests/test_xmlrpc/test_netgroup_plugin.py +++ b/tests/test_xmlrpc/test_netgroup_plugin.py @@ -164,6 +164,7 @@ class test_netgroup(Declarative): krbprincipalname=[u'host/%s@%s' % (host1, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[host1], ), ), ), diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py index fc8e08e9..5cd9cff9 100644 --- a/tests/test_xmlrpc/test_service_plugin.py +++ b/tests/test_xmlrpc/test_service_plugin.py @@ -88,6 +88,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn1], ), ), ), @@ -113,6 +114,7 @@ class test_host(Declarative): krbprincipalname=[u'host/%s@%s' % (fqdn2, api.env.realm)], objectclass=objectclasses.host, ipauniqueid=[fuzzy_uuid], + managedby_host=[u'%s' % fqdn2], ), ), ), |