Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Authors: # Rob Crittenden <rcritten@redhat.com> # # Copyright (C) 2009 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, either version 3 of the License, or # (at your option) any later version. # # 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, see <http://www.gnu.org/licenses/>. Test the `ipalib/plugins/cert.py` module against the selfsign plugin. """
# So we can save the cert from issuance and compare it later
# Test setup # # This test needs a configured CA behind it in order to work properly # It currently specifically tests for a self-signed CA but there is no # reason the test wouldn't work with a dogtag CA as well with some # additional work. This will change when selfsign is no longer the default CA. # # To set it up grab the 3 NSS db files from a self-signed CA from # /etc/httpd/alias to ~/.ipa/alias. Copy /etc/httpd/alias/pwdfile.txt to # ~/.ipa/alias/.pwd. Change ownership of these files too. That should do it.
raise nose.SkipTest('cert_request not registered') raise nose.SkipTest('developer self-signed CA not configured')
# Create an empty password file
# Create our temporary NSS database
"-o", self.reqfile, "-z", "/etc/group", "-f", self.pwname, "-a", ])
""" Test the `cert` plugin. """
""" Test the `xmlrpc.cert_request` method without --add.
This should fail because the service principal doesn't exist """ # First create the host that will use this policy
""" Test the `xmlrpc.cert_request` method with --add. """ # Our host should exist from previous test global cert
# save the cert for the service_show/find tests
""" Verify that service-show has the right certificate using service-show. """ global cert
""" Verify that service-find has the right certificate using service-find. """ global cert
# Assume there is only one service
""" Issue a new certificate for a service """ global newcert
# save the cert for the service_show/find tests
""" Verify the new certificate with service-show. """ global cert, newcert
# It should no longer match our old cert # And it should match the new one
""" Clean up cert test data """ # Now clean things up
# Verify that the service is gone |