UI tests for "ID Range": check creating ID Range with overlapping of primary and secondary RID base

https://pagure.io/freeipa/issue/7709

Reviewed-By: Mohammad Rizwan Yusuf <myusuf@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk
2018-10-01 10:55:44 +02:00
parent dd590e7ea7
commit 6595949e1d
2 changed files with 22 additions and 0 deletions

View File

@@ -46,6 +46,11 @@ class range_tasks(UI_driver):
'New secondary rid range overlaps with existing secondary rid range.'
)
PRIMARY_AND_SECONDARY_RID_OVERLAP_ERROR = (
"invalid 'ID Range setup': "
"Primary RID range and secondary RID range cannot overlap"
)
def get_shifts(self):
result = self.execute_api_from_ui('idrange_find', [], {})
idranges = result['result']['result']

View File

@@ -214,6 +214,23 @@ class test_range(range_tasks):
finally:
self.delete_record(pkey)
@screenshot
def test_add_range_with_overlapping_primary_and_secondary_rid(self):
"""
Test creating ID Range with overlapping of primary and secondary RID
"""
form_data = self.get_add_form_data(PKEY)
form_data.secondary_base_rid = form_data.base_rid
data = self.get_data(PKEY, form_data=form_data)
self.add_record(ENTITY, data, negative=True)
dialog = self.get_last_error_dialog()
try:
assert self.PRIMARY_AND_SECONDARY_RID_OVERLAP_ERROR in dialog.text
finally:
self.delete_record(PKEY)
@screenshot
def test_add_range_with_existing_base_rid(self):
"""