summaryrefslogtreecommitdiffstats
path: root/install/static/test
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-10-15 23:40:38 -0500
committerAdam Young <ayoung@redhat.com>2010-10-20 09:33:44 -0400
commit2c5f3cfd60575d7c72e6be8124b34c88b90d9fb7 (patch)
tree7fcaf067b6a46e5c48a6df57b3af2435d39b3ac8 /install/static/test
parentdf97bce34904e2b135a4b98d5cd5d59c2bb6b9ac (diff)
downloadfreeipa.git-2c5f3cfd60575d7c72e6be8124b34c88b90d9fb7.tar.gz
freeipa.git-2c5f3cfd60575d7c72e6be8124b34c88b90d9fb7.tar.xz
freeipa.git-2c5f3cfd60575d7c72e6be8124b34c88b90d9fb7.zip
Host certificate management
The service certificate management UI has been generalized and moved into certificate.js. The host details page is now using the same code to manage certificates. The host.py has been modified to return host certificate info. The Get/Revoke/View buttons behavior has been modified such that they are visible only if there is a valid certificate. The Get dialog box has been fixed to show the correct certificate header and footer. The ipa.css has been modified to store the style of the status bullets. New unit tests for certificate has been added. The test data has been modified to include sample host certificate.
Diffstat (limited to 'install/static/test')
-rw-r--r--install/static/test/all_tests.html4
-rw-r--r--install/static/test/association_tests.html2
-rwxr-xr-xinstall/static/test/certificate_tests.html24
-rwxr-xr-xinstall/static/test/certificate_tests.js79
-rw-r--r--install/static/test/data/cert_show.json1
-rw-r--r--install/static/test/data/host_show.json14
-rw-r--r--install/static/test/details_tests.html2
-rw-r--r--install/static/test/entity_tests.html2
-rw-r--r--install/static/test/index.html1
-rw-r--r--install/static/test/ipa_tests.html2
-rw-r--r--install/static/test/navigation_tests.html2
11 files changed, 125 insertions, 8 deletions
diff --git a/install/static/test/all_tests.html b/install/static/test/all_tests.html
index aede08e7..50c5155d 100644
--- a/install/static/test/all_tests.html
+++ b/install/static/test/all_tests.html
@@ -14,11 +14,13 @@
<script type="text/javascript" src="../entity.js"></script>
<script type="text/javascript" src="../associate.js"></script>
<script type="text/javascript" src="../navigation.js"></script>
+ <script type="text/javascript" src="../certificate.js"></script>
<script type="text/javascript" src="ipa_tests.js"></script>
<script type="text/javascript" src="details_tests.js"></script>
<script type="text/javascript" src="entity_tests.js"></script>
<script type="text/javascript" src="association_tests.js"></script>
<script type="text/javascript" src="navigation_tests.js"></script>
+ <script type="text/javascript" src="certificate_tests.js"></script>
</head>
<body>
<h1 id="qunit-header">Complete Test Suite</h1>
@@ -26,6 +28,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>
diff --git a/install/static/test/association_tests.html b/install/static/test/association_tests.html
index 5b5fb717..40b3c208 100644
--- a/install/static/test/association_tests.html
+++ b/install/static/test/association_tests.html
@@ -18,6 +18,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>
diff --git a/install/static/test/certificate_tests.html b/install/static/test/certificate_tests.html
new file mode 100755
index 00000000..90f09b21
--- /dev/null
+++ b/install/static/test/certificate_tests.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Certificate Test Suite</title>
+ <link rel="stylesheet" href="qunit.css" type="text/css" media="screen">
+ <script type="text/javascript" src="qunit.js"></script>
+ <script type="text/javascript" src="../jquery.js"></script>
+ <script type="text/javascript" src="../ipa.js"></script>
+ <script type="text/javascript" src="../details.js"></script>
+ <script type="text/javascript" src="../search.js"></script>
+ <script type="text/javascript" src="../add.js"></script>
+ <script type="text/javascript" src="../navigation.js"></script>
+ <script type="text/javascript" src="../certificate.js"></script>
+ <script type="text/javascript" src="certificate_tests.js"></script>
+</head>
+<body>
+ <h1 id="qunit-header">Certificate Test Suite</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture"></div>
+</body>
+</html>
diff --git a/install/static/test/certificate_tests.js b/install/static/test/certificate_tests.js
new file mode 100755
index 00000000..6ada6e40
--- /dev/null
+++ b/install/static/test/certificate_tests.js
@@ -0,0 +1,79 @@
+/* Authors:
+ * Endi Sukma Dewata <edewata@redhat.com>
+ *
+ * Copyright (C) 2010 Red Hat
+ * see file 'COPYING' for use and warranty information
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 only
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+test("Testing certificate_parse_dn().", function() {
+
+ same(
+ certificate_parse_dn(), {},
+ "Checking certificate_parse_dn()"
+ );
+
+ same(
+ certificate_parse_dn(''), {},
+ "Checking certificate_parse_dn('')"
+ );
+
+ same(
+ certificate_parse_dn('c=US'), {'c': 'US'},
+ "Checking certificate_parse_dn('c=US')"
+ );
+
+ same(
+ certificate_parse_dn('st=TX,c=US'), {'st': 'TX','c': 'US'},
+ "Checking certificate_parse_dn('st=TX,c=US')"
+ );
+
+ same(
+ certificate_parse_dn('c=US,st=TX'), {'st': 'TX','c': 'US'},
+ "Checking certificate_parse_dn('c=US,st=TX')"
+ );
+
+ same(
+ certificate_parse_dn(' st = New Mexico , c = US '), {'st': 'New Mexico','c': 'US'},
+ "Checking certificate_parse_dn(' st = New Mexico , c = US ')"
+ );
+
+ same(
+ certificate_parse_dn('ST=TX,C=US'), {'st': 'TX','c': 'US'},
+ "Checking certificate_parse_dn('ST=TX,C=US')"
+ );
+
+ same(
+ certificate_parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US'),
+ { 'cn': 'dev.example.com',
+ 'ou': 'Engineering',
+ 'o': 'Example',
+ 'l': 'Austin',
+ 'st': 'TX',
+ 'c': 'US'
+ },
+ "Checking certificate_parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US')"
+ );
+
+ same(
+ certificate_parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com'),
+ {
+ 'cn': 'John Smith',
+ 'ou': ['Developers','Users'],
+ 'dc': ['example', 'com']
+ },
+ "Checking certificate_parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com')"
+ );
+});
diff --git a/install/static/test/data/cert_show.json b/install/static/test/data/cert_show.json
index f8996715..71d895f0 100644
--- a/install/static/test/data/cert_show.json
+++ b/install/static/test/data/cert_show.json
@@ -6,7 +6,6 @@
"certificate": "MIICAjCCAWugAwIBAgICBAswDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTAwNzIzMzk0NFoXDTE1MTAwNzIzMzk0NFowKDEMMAoGA1UECgwDSVBBMRgwFgYDVQQDDA9kZXYuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOTXyj8grVB7Rj95RFawgdwn9OYZ03LWHZ+HMYggu2/xCCrUrdThP14YBlVqZumjVJSclj6T4ACjjdPJq9JTTmx7gMizDTReus7IPlS6fCxb5v5whQJZsEksXL04OxUMl25euPRFkYcTK1rdW47+AkG10j1qeNW+B6CpdQGR6eM/AgMBAAGjOjA4MBEGCWCGSAGG+EIBAQQEAwIGQDATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEASIhq723VL5xP0q51MYXFlGU1boD7pPD1pIQspD/MjCIEupcbH2kAo4wf+EiKsXR0rs+WZkaSgvFqaM4OQ2kWSFTiqmFXFDBEi6EFr68yLg7IpQpNTzVBXERd8B4GwNL9wrRw60jPXlUK29DPBsdGq8fDgX18l39wKkWXv7p1to4=",
"issuer": "CN=Certificate Authority,O=IPA",
"md5_fingerprint": "08:86:a9:f9:87:af:0d:d7:42:01:e0:5f:12:9b:32:7f",
- "revocation_reason": 6,
"serial_number": "1",
"sha1_fingerprint": "b8:4c:4b:79:4f:13:03:79:47:08:fa:6b:52:63:3d:f9:15:8e:7e:dc",
"subject": "CN=dev.example.com,O=IPA",
diff --git a/install/static/test/data/host_show.json b/install/static/test/data/host_show.json
index 64a7fb31..b0916215 100644
--- a/install/static/test/data/host_show.json
+++ b/install/static/test/data/host_show.json
@@ -14,6 +14,7 @@
"ipauniqueid": [
"b54b73a8-8ba8-11df-80bc-00163e26b89e"
],
+ "issuer": "CN=IPA Test Certificate Authority",
"krbextradata": [
{
"__base64__": "AAKOoTdMYWRtaW4vYWRtaW5ASURNLkxBQi5CT1MuUkVESEFULkNPTQA="
@@ -34,6 +35,7 @@
"managedby": [
"fqdn=vm-121.idm.lab.bos.redhat.com,cn=computers,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com"
],
+ "md5_fingerprint": "08:86:a9:f9:87:af:0d:d7:42:01:e0:5f:12:9b:32:7f",
"memberof": [],
"objectclass": [
"top",
@@ -46,9 +48,19 @@
"krbprincipal",
"krbticketpolicyaux"
],
+ "serial_number": "1",
"serverhostname": [
"vm-121"
- ]
+ ],
+ "sha1_fingerprint": "b8:4c:4b:79:4f:13:03:79:47:08:fa:6b:52:63:3d:f9:15:8e:7e:dc",
+ "subject": "CN=dev.example.com,O=IPA",
+ "usercertificate": [
+ {
+ "__base64__": "MIICAjCCAWugAwIBAgICBAswDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTAwNzIzMzk0NFoXDTE1MTAwNzIzMzk0NFowKDEMMAoGA1UECgwDSVBBMRgwFgYDVQQDDA9kZXYuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOTXyj8grVB7Rj95RFawgdwn9OYZ03LWHZ+HMYggu2/xCCrUrdThP14YBlVqZumjVJSclj6T4ACjjdPJq9JTTmx7gMizDTReus7IPlS6fCxb5v5whQJZsEksXL04OxUMl25euPRFkYcTK1rdW47+AkG10j1qeNW+B6CpdQGR6eM/AgMBAAGjOjA4MBEGCWCGSAGG+EIBAQQEAwIGQDATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEASIhq723VL5xP0q51MYXFlGU1boD7pPD1pIQspD/MjCIEupcbH2kAo4wf+EiKsXR0rs+WZkaSgvFqaM4OQ2kWSFTiqmFXFDBEi6EFr68yLg7IpQpNTzVBXERd8B4GwNL9wrRw60jPXlUK29DPBsdGq8fDgX18l39wKkWXv7p1to4="
+ }
+ ],
+ "valid_not_after": "Tue Oct 13 01:59:32 2015 UTC",
+ "valid_not_before": "Wed Oct 13 01:59:32 2010 UTC"
},
"summary": null,
"value": "vm-121.idm.lab.bos.redhat.com"
diff --git a/install/static/test/details_tests.html b/install/static/test/details_tests.html
index 7c323610..e96fa4b7 100644
--- a/install/static/test/details_tests.html
+++ b/install/static/test/details_tests.html
@@ -19,6 +19,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>
diff --git a/install/static/test/entity_tests.html b/install/static/test/entity_tests.html
index a6d3f72f..b8da0f44 100644
--- a/install/static/test/entity_tests.html
+++ b/install/static/test/entity_tests.html
@@ -19,6 +19,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>
diff --git a/install/static/test/index.html b/install/static/test/index.html
index a71ee60f..5467a683 100644
--- a/install/static/test/index.html
+++ b/install/static/test/index.html
@@ -29,6 +29,7 @@
<li><a href="details_tests.html">Details Test Suite</a>
<li><a href="association_tests.html">Association Test Suite</a>
<li><a href="navigation_tests.html">Navigation Test Suite</a>
+ <li><a href="certificate_tests.html">Certificate Test Suite</a>
</ul>
</div>
diff --git a/install/static/test/ipa_tests.html b/install/static/test/ipa_tests.html
index dfe2720a..3f3c1686 100644
--- a/install/static/test/ipa_tests.html
+++ b/install/static/test/ipa_tests.html
@@ -17,6 +17,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>
diff --git a/install/static/test/navigation_tests.html b/install/static/test/navigation_tests.html
index dbb562f1..fa911d6e 100644
--- a/install/static/test/navigation_tests.html
+++ b/install/static/test/navigation_tests.html
@@ -16,6 +16,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
+ <div id="qunit-fixture"></div>
</body>
</html>