diff options
Diffstat (limited to 'install/static/test')
-rw-r--r-- | install/static/test/data/group_member_user.json | 150 | ||||
-rw-r--r-- | install/static/test/data/hbacsvcgroup_member_hbacsvc.json | 57 | ||||
-rw-r--r-- | install/static/test/data/host_show.json | 77 | ||||
-rw-r--r-- | install/static/test/data/hostgroup_member_host.json | 70 | ||||
-rw-r--r-- | install/static/test/data/service_managedby_host.json | 110 | ||||
-rw-r--r-- | install/static/test/data/sudocmdgroup_member_sudocmd.json | 57 | ||||
-rw-r--r-- | install/static/test/data/user_memberof_group.json | 64 | ||||
-rw-r--r-- | install/static/test/entity_tests.js | 47 |
8 files changed, 610 insertions, 22 deletions
diff --git a/install/static/test/data/group_member_user.json b/install/static/test/data/group_member_user.json new file mode 100644 index 00000000..636e7f0e --- /dev/null +++ b/install/static/test/data/group_member_user.json @@ -0,0 +1,150 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "results": [ + { + "error": null, + "result": { + "cn": [ + "Administrator" + ], + "dn": "uid=admin,cn=users,cn=accounts,dc=dev,dc=example,dc=com", + "gecos": [ + "Administrator" + ], + "gidnumber": [ + "1662072955" + ], + "homedirectory": [ + "/home/admin" + ], + "ipauniqueid": [ + "ffb8d002-f46c-11df-8cc1-00163e72f2d9" + ], + "krblastpwdchange": [ + "20101120061333Z" + ], + "krbpasswordexpiration": [ + "20110218061333Z" + ], + "krbprincipalname": [ + "admin@DEV.EXAMPLE.COM" + ], + "loginshell": [ + "/bin/bash" + ], + "memberof_group": [ + "admins", + "ipausers" + ], + "memberof_rolegroup": [ + "replicaadmin" + ], + "memberof_taskgroup": [ + "managereplica", + "deletereplica" + ], + "mepmanagedentry": [ + "cn=admin,cn=groups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "nsaccountlock": [ + "False" + ], + "objectclass": [ + "top", + "person", + "posixaccount", + "krbprincipalaux", + "krbticketpolicyaux", + "inetuser", + "ipaobject", + "mepOriginEntry" + ], + "sn": [ + "Administrator" + ], + "uid": [ + "admin" + ], + "uidnumber": [ + "1662072955" + ] + }, + "summary": null, + "value": "admin" + }, + { + "error": null, + "result": { + "cn": [ + "Test User" + ], + "dn": "uid=test,cn=users,cn=accounts,dc=dev,dc=example,dc=com", + "gecos": [ + "test" + ], + "gidnumber": [ + "1662072958" + ], + "givenname": [ + "Test" + ], + "homedirectory": [ + "/home/test" + ], + "ipauniqueid": [ + "c0724e5e-f472-11df-8186-00163e72f2d9" + ], + "krbprincipalname": [ + "test@DEV.EXAMPLE.COM" + ], + "krbpwdpolicyreference": [ + "cn=global_policy,cn=DEV.EXAMPLE.COM,cn=kerberos,dc=dev,dc=example,dc=com" + ], + "loginshell": [ + "/bin/sh" + ], + "mail": [ + "test" + ], + "memberof_group": [ + "ipausers", + "editors" + ], + "mepmanagedentry": [ + "cn=test,cn=groups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "nsaccountlock": [ + "False" + ], + "objectclass": [ + "top", + "person", + "organizationalperson", + "inetorgperson", + "inetuser", + "posixaccount", + "krbprincipalaux", + "krbticketpolicyaux", + "radiusprofile", + "ipaobject", + "mepOriginEntry" + ], + "sn": [ + "User" + ], + "uid": [ + "test" + ], + "uidnumber": [ + "1662072958" + ] + }, + "summary": null, + "value": "test" + } + ] + } +} diff --git a/install/static/test/data/hbacsvcgroup_member_hbacsvc.json b/install/static/test/data/hbacsvcgroup_member_hbacsvc.json new file mode 100644 index 00000000..9819a2f2 --- /dev/null +++ b/install/static/test/data/hbacsvcgroup_member_hbacsvc.json @@ -0,0 +1,57 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "results": [ + { + "error": null, + "result": { + "cn": [ + "sudo" + ], + "description": [ + "sudo" + ], + "dn": "cn=sudo,cn=hbacservices,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "42927a86-f46d-11df-8cc1-00163e72f2d9" + ], + "memberof": [ + "cn=SUDO,cn=hbacservicegroups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "objectclass": [ + "ipahbacservice", + "ipaobject" + ] + }, + "summary": null, + "value": "sudo" + }, + { + "error": null, + "result": { + "cn": [ + "sudo-i" + ], + "description": [ + "sudo-i" + ], + "dn": "cn=sudo-i,cn=hbacservices,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "42970a6a-f46d-11df-8cc1-00163e72f2d9" + ], + "memberof": [ + "cn=SUDO,cn=hbacservicegroups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "objectclass": [ + "ipahbacservice", + "ipaobject" + ] + }, + "summary": null, + "value": "sudo-i" + } + ] + } +} diff --git a/install/static/test/data/host_show.json b/install/static/test/data/host_show.json new file mode 100644 index 00000000..b858970e --- /dev/null +++ b/install/static/test/data/host_show.json @@ -0,0 +1,77 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "attributelevelrights": { + "aci": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "enrolledby": "rsc", + "fqdn": "rscwo", + "ipaclientversion": "rscwo", + "ipauniqueid": "rsc", + "krbcanonicalname": "rscwo", + "krbextradata": "rscwo", + "krblastfailedauth": "rscwo", + "krblastpwdchange": "rscwo", + "krblastsuccessfulauth": "rscwo", + "krbloginfailedcount": "rscwo", + "krbobjectreferences": "rscwo", + "krbpasswordexpiration": "rscwo", + "krbprincipalaliases": "rscwo", + "krbprincipalexpiration": "rscwo", + "krbprincipalkey": "wo", + "krbprincipalname": "rscwo", + "krbprincipaltype": "rscwo", + "krbpwdhistory": "rscwo", + "krbpwdpolicyreference": "rscwo", + "krbticketpolicyreference": "rscwo", + "krbupenabled": "rscwo", + "l": "rscwo", + "managedby": "rscwo", + "memberof": "rsc", + "nsaccountlock": "rscwo", + "nshardwareplatform": "rscwo", + "nshostlocation": "rscwo", + "nsosversion": "rscwo", + "objectclass": "rscwo", + "serverhostname": "rsc", + "usercertificate": "rscwo", + "userpassword": "wo" + }, + "cn": [ + "test.example.com" + ], + "dn": "fqdn=test.example.com,cn=computers,cn=accounts,dc=dev,dc=example,dc=com", + "fqdn": [ + "test.example.com" + ], + "has_keytab": false, + "ipauniqueid": [ + "ac28dca0-f3b5-11df-879f-00163e72f2d9" + ], + "krbprincipalname": [ + "host/test.example.com@DEV.EXAMPLE.COM" + ], + "managedby": [ + "fqdn=test.example.com,cn=computers,cn=accounts,dc=dev,dc=example,dc=com" + ], + "objectclass": [ + "ipaobject", + "nshost", + "ipahost", + "pkiuser", + "ipaservice", + "krbprincipalaux", + "krbprincipal", + "top" + ], + "serverhostname": [ + "test" + ] + }, + "summary": null, + "value": "test.example.com" + } +} diff --git a/install/static/test/data/hostgroup_member_host.json b/install/static/test/data/hostgroup_member_host.json new file mode 100644 index 00000000..c4c7dfa9 --- /dev/null +++ b/install/static/test/data/hostgroup_member_host.json @@ -0,0 +1,70 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 1, + "results": [ + { + "error": null, + "result": { + "cn": [ + "dev.example.com" + ], + "description": [ + "Development" + ], + "dn": "fqdn=dev.example.com,cn=computers,cn=accounts,dc=dev,dc=example,dc=com", + "fqdn": [ + "dev.example.com" + ], + "has_keytab": true, + "ipauniqueid": [ + "0568a298-f46d-11df-9ef8-00163e72f2d9" + ], + "krbextradata": [ + { + "__base64__": "AAKTZudMYWRtaW4vYWRtaW5AREVWLkVYQU1QTEUuQ09NAA==" + }, + { + "__base64__": "AAgBAA==" + } + ], + "krblastpwdchange": [ + "20101120061131Z" + ], + "krbpasswordexpiration": [ + "19700101000000Z" + ], + "krbprincipalname": [ + "host/dev.example.com@DEV.EXAMPLE.COM" + ], + "krbticketflags": [ + "0" + ], + "managedby_host": [ + "dev.example.com" + ], + "memberof_hostgroup": [ + "test" + ], + "objectclass": [ + "top", + "ipaobject", + "nshost", + "ipahost", + "ipaservice", + "pkiuser", + "krbprincipalaux", + "krbprincipal", + "krbticketpolicyaux" + ], + "serverhostname": [ + "dev" + ] + }, + "summary": null, + "value": "dev.example.com" + } + ] + } +} diff --git a/install/static/test/data/service_managedby_host.json b/install/static/test/data/service_managedby_host.json new file mode 100644 index 00000000..181fc5b9 --- /dev/null +++ b/install/static/test/data/service_managedby_host.json @@ -0,0 +1,110 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 1, + "results": [ + { + "error": null, + "result": { + "attributelevelrights": { + "aci": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "enrolledby": "rsc", + "fqdn": "rscwo", + "ipaclientversion": "rscwo", + "ipauniqueid": "rscwo", + "krbcanonicalname": "rscwo", + "krbextradata": "rscwo", + "krblastfailedauth": "rscwo", + "krblastpwdchange": "rscwo", + "krblastsuccessfulauth": "rscwo", + "krbloginfailedcount": "rscwo", + "krbmaxrenewableage": "rscwo", + "krbmaxticketlife": "rscwo", + "krbobjectreferences": "rscwo", + "krbpasswordexpiration": "rscwo", + "krbprincipalaliases": "rscwo", + "krbprincipalexpiration": "rscwo", + "krbprincipalkey": "wo", + "krbprincipalname": "rscwo", + "krbprincipaltype": "rscwo", + "krbpwdhistory": "rscwo", + "krbpwdpolicyreference": "rscwo", + "krbticketflags": "rscwo", + "krbticketpolicyreference": "rscwo", + "krbupenabled": "rscwo", + "l": "rscwo", + "managedby": "rscwo", + "memberof": "rsc", + "nsaccountlock": "rscwo", + "nshardwareplatform": "rscwo", + "nshostlocation": "rscwo", + "nsosversion": "rscwo", + "objectclass": "rscwo", + "serverhostname": "rsc", + "usercertificate": "rscwo", + "userpassword": "wo" + }, + "cn": [ + "dev.example.com" + ], + "description": [ + "Development" + ], + "dn": "fqdn=dev.example.com,cn=computers,cn=accounts,dc=dev,dc=example,dc=com", + "fqdn": [ + "dev.example.com" + ], + "has_keytab": true, + "ipauniqueid": [ + "0568a298-f46d-11df-9ef8-00163e72f2d9" + ], + "krbextradata": [ + { + "__base64__": "AAKTZudMYWRtaW4vYWRtaW5AREVWLkVYQU1QTEUuQ09NAA==" + }, + { + "__base64__": "AAgBAA==" + } + ], + "krblastpwdchange": [ + "20101120061131Z" + ], + "krbpasswordexpiration": [ + "19700101000000Z" + ], + "krbprincipalname": [ + "host/dev.example.com@DEV.EXAMPLE.COM" + ], + "krbticketflags": [ + "0" + ], + "managedby_host": [ + "dev.example.com" + ], + "memberof_hostgroup": [ + "test" + ], + "objectclass": [ + "top", + "ipaobject", + "nshost", + "ipahost", + "ipaservice", + "pkiuser", + "krbprincipalaux", + "krbprincipal", + "krbticketpolicyaux" + ], + "serverhostname": [ + "dev" + ] + }, + "summary": null, + "value": "dev.example.com" + } + ] + } +} diff --git a/install/static/test/data/sudocmdgroup_member_sudocmd.json b/install/static/test/data/sudocmdgroup_member_sudocmd.json new file mode 100644 index 00000000..5f017f9c --- /dev/null +++ b/install/static/test/data/sudocmdgroup_member_sudocmd.json @@ -0,0 +1,57 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "results": [ + { + "error": null, + "result": { + "description": [ + "more" + ], + "dn": "sudocmd=/usr/bin/more,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "a9138c9a-fc0c-11df-8584-00163e72f2d9" + ], + "memberof": [ + "cn=test,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "objectclass": [ + "ipaobject", + "ipasudocmd" + ], + "sudocmd": [ + "/usr/bin/more" + ] + }, + "summary": null, + "value": "/usr/bin/more" + }, + { + "error": null, + "result": { + "description": [ + "less" + ], + "dn": "sudocmd=/usr/bin/less,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "44ce29ee-fc38-11df-b995-00163e72f2d9" + ], + "memberof": [ + "cn=test,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com" + ], + "objectclass": [ + "ipaobject", + "ipasudocmd" + ], + "sudocmd": [ + "/usr/bin/less" + ] + }, + "summary": null, + "value": "/usr/bin/less" + } + ] + } +} diff --git a/install/static/test/data/user_memberof_group.json b/install/static/test/data/user_memberof_group.json new file mode 100644 index 00000000..e8f7a8fa --- /dev/null +++ b/install/static/test/data/user_memberof_group.json @@ -0,0 +1,64 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "results": [ + { + "error": null, + "result": { + "cn": [ + "ipausers" + ], + "description": [ + "Default group for all users" + ], + "dn": "cn=ipausers,cn=groups,cn=accounts,dc=dev,dc=example,dc=com", + "gidnumber": [ + "1662072956" + ], + "member_user": [ + "test", + "admin" + ], + "objectclass": [ + "top", + "groupofnames", + "nestedgroup", + "ipausergroup", + "posixgroup" + ] + }, + "summary": null, + "value": "ipausers" + }, + { + "error": null, + "result": { + "cn": [ + "editors" + ], + "description": [ + "Limited admins who can edit other users" + ], + "dn": "cn=editors,cn=groups,cn=accounts,dc=dev,dc=example,dc=com", + "gidnumber": [ + "1662072957" + ], + "member_user": [ + "test" + ], + "objectclass": [ + "top", + "groupofnames", + "posixgroup", + "ipausergroup", + "nestedGroup" + ] + }, + "summary": null, + "value": "editors" + } + ] + } +} diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js index 8f016efe..504775eb 100644 --- a/install/static/test/entity_tests.js +++ b/install/static/test/entity_tests.js @@ -83,57 +83,60 @@ test('Testing ipa_facet_setup_views().', function() { IPA.add_entity(entity); - entity.add_facet(ipa_search_facet({ + var facet = ipa_search_facet({ 'name': 'search', 'label': 'Search' - })); - - - var facet = ipa_association_facet({ - 'name': 'associate' }); entity.add_facet(facet); + entity.create_association_facets(); + var container = $('<div/>'); + entity.init(); + entity.setup(container); + var counter = 0; - IPA.switch_and_show_page = function(entity_name, facet_name, other_entity) { + IPA.switch_and_show_page = function(entity_name, facet_name, pkey) { counter++; }; - facet.create_action_panel(container); - //Container now has two divs, one for the action panel one for content - var list = container.children().last().children(); - var views = list.children(); + var action_panel = facet.get_action_panel(); + ok(action_panel.length, 'action panel exists'); + + var ul = $('ul', action_panel); + + var views = ul.children(); equals( - views.length, 5, + views.length, 6, 'Checking number of views' ); - facet = views.first(); - ok( facet.hasClass('entity-search', + var li = views.first(); + ok( li.hasClass('search-facet'), 'Checking the search facet' ); - facet = facet.next(); + li = li.next(); // skip action controls var attribute_members = IPA.metadata['user'].attribute_members; - for (attribute_member in attribute_members) { + for (var attribute_member in attribute_members) { var objects = attribute_members[attribute_member]; for (var i = 0; i < objects.length; i++) { var object = objects[i]; + var title = attribute_member+'_'+object; + + li = li.next(); + var value = li.attr('title'); equals( - facet.attr('title'), object, - 'Checking the '+object+' facet' + value, title, + 'Checking the '+title+' facet' ); - facet = facet.next(); } } - var action_panel = $('.action-panel', container); - ok(action_panel.length, 'action panel exists'); var pkey_input = $('input[name=pkey]', action_panel); ok(pkey_input.length,'pkey input exists'); var search_facets = $('li.search-facet', action_panel); @@ -148,7 +151,7 @@ test('Testing ipa_facet_setup_views().', function() { entity_facet.click(); } -// equals(4, counter,'four clicks'); + equals(counter, 0, 'links are disabled'); IPA.switch_and_show_page = orig_switch_and_show_page; }); |