Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -21,18 +21,19 @@
|
||||
Test the `ipalib.x509` module.
|
||||
"""
|
||||
|
||||
import os
|
||||
from os import path
|
||||
import sys
|
||||
from ipatests.util import raises, setitem, delitem, ClassChecker
|
||||
from ipatests.util import getitem, setitem, delitem
|
||||
from ipatests.util import TempDir, TempHome
|
||||
from ipalib.constants import TYPE_ERROR, OVERRIDE_ERROR, SET_ERROR, DEL_ERROR
|
||||
from ipalib.constants import NAME_REGEX, NAME_ERROR
|
||||
import base64
|
||||
|
||||
import pytest
|
||||
from nss.error import NSPRError
|
||||
|
||||
from ipalib import x509
|
||||
from nss.error import NSPRError
|
||||
from ipapython.dn import DN
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.tier0
|
||||
|
||||
# certutil -
|
||||
|
||||
# certificate for CN=ipa.example.com,O=IPA
|
||||
@@ -65,12 +66,16 @@ class test_x509(object):
|
||||
|
||||
# Load a good cert with bad headers
|
||||
newcert = '-----BEGIN CERTIFICATE-----' + goodcert
|
||||
with pytest.raises((TypeError, ValueError)):
|
||||
try:
|
||||
cert = x509.load_certificate(newcert)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
# Load a bad cert
|
||||
with pytest.raises(NSPRError):
|
||||
try:
|
||||
cert = x509.load_certificate(badcert)
|
||||
except NSPRError:
|
||||
pass
|
||||
|
||||
def test_1_load_der_cert(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user