Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions cfme/configure/configuration/region_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ class ReplicationGlobalView(ReplicationView):
subscription_table = VanillaTable(
'//form[@id="form_div"]//table[contains(@class, "table")]',
column_widgets={
"Actions": Button("Update"),
8: Button("Update"),
10: Kebab(locator='//td[10]/div[contains(@class, "dropdown-kebab-pf")]')
}
)
Expand All @@ -1004,17 +1004,12 @@ class ReplicationKebab(Kebab):

class ReplicationGlobalAddView(ReplicationView):
database = Input(locator='//input[contains(@ng-model, "dbname")]')
port = Input(name='port')
host = Input(locator='//input[contains(@ng-model, "host")]')
username = Input(name='userid')
username = Input(locator='//input[contains(@ng-model, "user")]')
password = Input(name='password')
port = Input(name='port')
accept_button = Button('Accept')
action_dropdown = ReplicationKebab(
locator=(
'//tr[contains(@ng-if, "pglogicalReplicationModel.addEnabled")]'
'//div[contains(@class, "dropdown-kebab-pf")]'
)
)
action_dropdown = ReplicationKebab(locator='//div[contains(@class, "dropdown-kebab-pf")]')

@property
def is_displayed(self):
Expand Down Expand Up @@ -1082,16 +1077,17 @@ def set_replication(self, updates=None, replication_type=None, reset=False, vali
def _global_replication_row(self, host=None):
""" Get replication row from table

Args:
host: host values
Kwargs:
host: :py:class`str` to match on the Host column in the table
Returns:
host row object, of is host is not passed first table row is returned
:py:class:`TableRow` of matching row.
If host is not specified, then the first table row is returned.
"""
view = navigate_to(self, 'Global')
if host:
return view.subscription_table.row(host=host)
else:
return view.subscription_table.row[0]
return view.subscription_table[0]

def get_replication_status(self, replication_type='global', host=None):
""" Get replication status, if replication is active
Expand Down
36 changes: 0 additions & 36 deletions cfme/tests/configure/test_config_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,6 @@ def test_configure_icons_roles_by_server():
pass


@pytest.mark.manual
@test_requirements.settings
@test_requirements.multi_region
@pytest.mark.tier(3)
def test_replication_subscription_crud():
"""
Add/Edit/Remove replication subscription

Polarion:
assignee: tpapaioa
casecomponent: Configuration
caseimportance: critical
initialEstimate: 1/4h
testSteps:
1. Set up two appliances where first appliance resides in global region (99) and
second one resides in remote region (10). Those should use the same security key
2. Add a provider to second appliance
3. Set replication subscription type to Remote in second appliance
4. Set replication subscription type to Global in first appliance
5. Try adding subscription to second appliance with wrong password in first appliance
6. Update not working subscription to use correct password
7. Delete subscription
expectedResults:
1.
2.
3.
4.
5. Subscription was added. User was prewarned that subscription wasn't established.
Provider didn't show up in global appliance.
6. Provider and its data showed up in global region appliance
7. Subscription was deleted. Provider and its data disappeared from global region
appliance.
"""
pass


@pytest.mark.manual
@test_requirements.settings
@test_requirements.multi_region
Expand Down
37 changes: 37 additions & 0 deletions cfme/tests/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from cfme import test_requirements
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.configure.configuration.region_settings import ReplicationGlobalAddView
from cfme.configure.configuration.region_settings import ReplicationGlobalView
from cfme.fixtures.cli import provider_app_crud
from cfme.infrastructure.provider import InfraProvider
Expand Down Expand Up @@ -466,3 +467,39 @@ def test_replication_subscription_revalidation_pglogical(configured_appliance,
region.replication.set_replication(replication_type="global",
updates={"host": remote_app.hostname},
validate=True)


@test_requirements.settings
@test_requirements.multi_region
@pytest.mark.tier(3)
def test_replication_subscription_update(multi_region_cluster, setup_multi_region_cluster):
"""
Edit replication subscription

Polarion:
assignee: dgaikwad
casecomponent: Configuration
caseimportance: critical
initialEstimate: 1/4h
"""
global_appliance = multi_region_cluster.global_appliance

region = global_appliance.collections.regions.instantiate(number=99)

# Update with bad password and verify that error flash message appears
row = region.replication._global_replication_row()

row[8].widget.click(handle_alert=True)

view = region.replication.create_view(ReplicationGlobalAddView)
view.fill({'username': 'bad_user'})
view.accept_button.click()
view.action_dropdown.item_select('Validate')
view.flash.assert_message("FATAL: password authentication failed", partial=True, t='error')

row[8].widget.click(handle_alert=True)

view.fill({'username': credentials.database.username})
view.accept_button.click()
view.action_dropdown.item_select('Validate')
view.flash.assert_success_message("Subscription Credentials validated successfully")