Imported Debian patch 4.7.2-3
This commit is contained in:
committed by
Mario Fetka
parent
27edeba051
commit
8bc559c5a1
@@ -21,7 +21,6 @@
|
||||
Service tests
|
||||
"""
|
||||
|
||||
from ipatests.test_webui.crypto_utils import generate_certificate, generate_csr
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
@@ -148,17 +147,21 @@ class test_service(sevice_tasks):
|
||||
"""
|
||||
Test service certificate actions
|
||||
|
||||
Requires to have CA installed.
|
||||
Requires to have CA installed and 'service_csr_path' configuration
|
||||
option set.
|
||||
"""
|
||||
|
||||
if not self.has_ca():
|
||||
self.skip('CA is not configured')
|
||||
|
||||
csr_path = self.config.get('service_csr_path')
|
||||
if not csr_path:
|
||||
self.skip('CSR file is not configured')
|
||||
|
||||
self.init_app()
|
||||
data = self.prep_data()
|
||||
pkey = data.get('pkey')
|
||||
hostname = self.config.get('ipa_server')
|
||||
csr = generate_csr(hostname)
|
||||
csr = self.load_file(csr_path)
|
||||
cert_widget_sel = "div.certificate-widget"
|
||||
|
||||
self.add_record(ENTITY, data)
|
||||
@@ -175,8 +178,6 @@ class test_service(sevice_tasks):
|
||||
self.wait_for_request(n=2, d=3)
|
||||
self.assert_visible(cert_widget_sel)
|
||||
|
||||
widget = self.find(cert_widget_sel, By.CSS_SELECTOR)
|
||||
|
||||
# cert view
|
||||
self.action_list_action('view', confirm=False,
|
||||
parents_css_sel=cert_widget_sel)
|
||||
@@ -217,8 +218,7 @@ class test_service(sevice_tasks):
|
||||
self.wait()
|
||||
self.select('select', '6')
|
||||
self.dialog_button_click('ok')
|
||||
self.wait_while_working(widget)
|
||||
|
||||
self.wait_for_request(n=2, d=3)
|
||||
self.assert_visible(cert_widget_sel + " div.watermark")
|
||||
|
||||
# check that revoke action is not enabled
|
||||
@@ -241,7 +241,7 @@ class test_service(sevice_tasks):
|
||||
parents_css_sel=cert_widget_sel)
|
||||
self.wait()
|
||||
self.dialog_button_click('ok')
|
||||
self.wait_while_working(widget)
|
||||
self.wait_for_request(n=2)
|
||||
|
||||
# check that revoke action is enabled
|
||||
self.assert_action_list_action('revoke',
|
||||
@@ -266,8 +266,6 @@ class test_service(sevice_tasks):
|
||||
self.wait()
|
||||
self.select('select', '1')
|
||||
self.dialog_button_click('ok')
|
||||
self.close_notifications()
|
||||
self.wait_while_working(widget)
|
||||
|
||||
# check that revoke action is not enabled
|
||||
self.assert_action_list_action('revoke', enabled=False,
|
||||
@@ -287,12 +285,17 @@ class test_service(sevice_tasks):
|
||||
def test_arbitrary_certificates(self):
|
||||
"""
|
||||
Test managing service arbitrary certificate.
|
||||
|
||||
Requires to have 'arbitrary_cert_path' configuration set.
|
||||
"""
|
||||
cert_path = self.config.get('arbitrary_cert_path')
|
||||
if not cert_path:
|
||||
self.skip('Arbitrary certificate file is not configured')
|
||||
|
||||
self.init_app()
|
||||
data = self.prep_data()
|
||||
pkey = data.get('pkey')
|
||||
hostname = self.config.get('ipa_server')
|
||||
cert = generate_certificate(hostname)
|
||||
cert = self.load_file(cert_path)
|
||||
cert_widget_sel = "div.certificate-widget"
|
||||
|
||||
self.add_record(ENTITY, data)
|
||||
@@ -303,9 +306,9 @@ class test_service(sevice_tasks):
|
||||
|
||||
# add certificate
|
||||
self.button_click('add', parents_css_sel="div[name='certificate']")
|
||||
self.assert_dialog('cert-add-dialog')
|
||||
self.assert_dialog()
|
||||
self.fill_textarea('new_cert', cert)
|
||||
self.dialog_button_click('ok')
|
||||
self.dialog_button_click('add')
|
||||
|
||||
self.assert_visible(cert_widget_sel)
|
||||
|
||||
@@ -623,8 +626,11 @@ class test_service(sevice_tasks):
|
||||
if not self.has_ca():
|
||||
self.skip('CA is not configured')
|
||||
|
||||
hostname = self.config.get('ipa_server')
|
||||
csr = generate_csr(hostname)
|
||||
csr_path = self.config.get('service_csr_path')
|
||||
if not csr_path:
|
||||
self.skip('CSR file is not configured')
|
||||
|
||||
csr = self.load_file(csr_path)
|
||||
|
||||
self.init_app()
|
||||
pkey = self.get_service_pkey('cifs')
|
||||
|
||||
Reference in New Issue
Block a user