Skip to content

Commit

Permalink
Add test for quota utilization
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Bondarenko <[email protected]>
  • Loading branch information
ebondare committed Jan 9, 2025
1 parent cd3b61b commit e01d243
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ocs_ci/ocs/ui/page_objects/storage_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,18 @@ def get_available_storage_from_quota_edit_popup(self):
# Text is expected to be 'Available capacity (ocs-storagecluster): N TiB'
split_capacity_text = av_capacity_text.split(" ")
return f"{split_capacity_text[-2]} {split_capacity_text[-1]}"

def validate_unlimited_quota_utilization_info(self):
"""
Verify that for every client with unlimited quota
utilization column only shows "-"
"""
quota_elements = self.get_elements(self.storage_clients_loc["client_quota"])
utilization_elements = self.get_elements(
self.storage_clients_loc["quota_utilization"]
)
for i in len(quota_elements):
if quota_elements[i].text == "Unlimited":
assert (
utilization_elements[i].text == "-"
), f"Quota utilization is shown as {utilization_elements[i].text}"
8 changes: 8 additions & 0 deletions tests/functional/ui/test_provider_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,11 @@ def test_quota_values_in_ui(self, setup_ui_class):
quota_cli = storageconsumer.get_storageconsumer_quota(client)
assert quota_ui == quota_cli, f"Quota in the UI: {quota_ui}, "
"quota in the CLI: {quota_cli}"

def test_usage_for_unlimited_quota_clients(self, setup_ui_class):
"""
Test that clients with unlimited storage don't have
quota usage shown on Clients page
"""
storage_clients_page = PageNavigator().nav_to_storageclients_page()
storage_clients_page.validate_unlimited_quota_utilization_info()

0 comments on commit e01d243

Please sign in to comment.