Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEN-1431/24.10.0/pipeline fix RO Datasets, RO and Share Admin Boot tests #388

Merged
merged 3 commits into from
Jun 25, 2024
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
18 changes: 0 additions & 18 deletions keywords/webui/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@

class Boot:

@classmethod
def assert_boot_disk_actions_is_restricted(cls, boot_disk: str, action: str) -> bool:
"""
This method returns True or False whether the Boot disk actions button is locked and not clickable.

:param boot_disk: The name of the data disks
:param action: The name of the action. Options [attach, detach, replace].
:return: True if the Boot disk actions button is locked and not clickable otherwise it returns False.


Example:
- Boot.assert_boot_disk_actions_is_restricted('sda3')
"""
COM.click_button(f'{COM.convert_to_tag_format(boot_disk)}-actions')
result = COM.assert_button_is_restricted(action)
WebUI.send_key('esc')
return result

@classmethod
def assert_boot_environment_element_restricted(cls, be_name: str, action: str) -> bool:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@ def test_read_only_admin_cannot_replace_or_attach_disks_in_the_boot_pool(self):
"""
COM.click_button('bootenv-status')
assert COM.assert_page_header('Boot Pool Status') is True
assert Boot.assert_boot_disk_actions_is_restricted(shared_config['BOOT_DISK'], 'attach') is True
assert Boot.assert_boot_disk_actions_is_restricted(shared_config['BOOT_DISK'], 'replace') is True
COM.click_button(f'{COM.convert_to_tag_format(shared_config["BOOT_DISK"])}-actions')
assert COM.assert_button_is_restricted('attach') is True
assert COM.assert_button_is_restricted('replace') is True
COM.click_on_element('//*')
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import allure
import pytest
from helper.data_config import get_data_list
from helper.global_config import shared_config
from keywords.api.post import API_POST
from keywords.api.delete import API_DELETE
from keywords.webui.common import Common
Expand All @@ -26,7 +27,7 @@ def setup_test(self, data):
API_POST.create_dataset(f'{data["pool"]}/{data["acl_parent_dataset"]}/{data["acl_child_dataset"]}', 'SMB')
API_POST.create_dataset(f'{data["pool"]}/{data["generic_parent_dataset"]}', 'GENERIC')
API_POST.create_dataset(f'{data["pool"]}/{data["generic_parent_dataset"]}/{data["generic_child_dataset"]}', 'GENERIC')
API_POST.create_snapshot(f'{data["pool"]}/{data["acl_parent_dataset"]}', data['snapshot_name'])
shared_config['snapshot_name'] = API_POST.create_snapshot(f'{data["pool"]}/{data["acl_parent_dataset"]}', data['snapshot_name']).json()['snapshot_name']

@pytest.fixture(autouse=True, scope='class')
def tear_down_test(self, data):
Expand All @@ -36,7 +37,7 @@ def tear_down_test(self, data):
yield
# Return to dataset page or there will be an error when deleting the dataset.
Navigation.navigate_to_datasets()
API_DELETE.delete_snapshot(f'{data["pool"]}/{data["acl_parent_dataset"]}@{data["snapshot_name"]}', recursive=True)
API_DELETE.delete_snapshot(f'{data["pool"]}/{data["acl_parent_dataset"]}@{shared_config["snapshot_name"]}', recursive=True)
API_DELETE.delete_dataset(f'{data["pool"]}/{data["acl_parent_dataset"]}', recursive=True, force=True)
API_DELETE.delete_dataset(f'{data["pool"]}/{data["generic_parent_dataset"]}', recursive=True, force=True)

Expand Down Expand Up @@ -268,17 +269,17 @@ def test_read_only_admin_is_not_able_to_delete_clone_rollback_and_hold_a_snapsho
Datasets.click_manage_snapshots_link()

assert Snapshots.assert_dataset_snapshot_page_header(f'{data["pool"]}/{data["acl_parent_dataset"]}') is True
assert Snapshots.assert_snapshot_is_visible(data['snapshot_name']) is True
Snapshots.expand_snapshot_by_name(data['snapshot_name'])
assert Snapshots.assert_snapshot_is_visible(shared_config['snapshot_name']) is True
Snapshots.expand_snapshot_by_name(shared_config['snapshot_name'])

# verify the read-only admin is not able to delete snapshots
assert Snapshots.assert_delete_button_is_restricted(data['snapshot_name']) is True
assert Snapshots.assert_delete_button_is_restricted(shared_config['snapshot_name']) is True

# verify the read-only admin is not able to clone a snapshots
assert Snapshots.assert_clone_to_new_snapshot_button_is_restricted(data['snapshot_name']) is True
assert Snapshots.assert_clone_to_new_snapshot_button_is_restricted(shared_config['snapshot_name']) is True

# verify the read-only admin is not able to roll back a snapshots
assert Snapshots.assert_rollback_button_is_restricted(data['snapshot_name']) is True
assert Snapshots.assert_rollback_button_is_restricted(shared_config['snapshot_name']) is True

# verify the read-only admin is not able to change the hold checkbox
assert Snapshots.assert_hold_checkbox_is_restricted(data['snapshot_name']) is True
assert Snapshots.assert_hold_checkbox_is_restricted(shared_config['snapshot_name']) is True
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@ def test_share_admin_cannot_replace_or_attach_disks_in_the_boot_pool(self):
"""
COM.click_button('bootenv-status')
assert COM.assert_page_header('Boot Pool Status') is True
assert Boot.assert_boot_disk_actions_is_restricted(shared_config['BOOT_DISK'], 'attach') is True
assert Boot.assert_boot_disk_actions_is_restricted(shared_config['BOOT_DISK'], 'replace') is True
COM.click_button(f'{COM.convert_to_tag_format(shared_config["BOOT_DISK"])}-actions')
assert COM.assert_button_is_restricted('attach') is True
assert COM.assert_button_is_restricted('replace') is True
COM.click_on_element('//*')
2 changes: 1 addition & 1 deletion test_data/read_only_admin_dataset.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pool,acl_parent_dataset,acl_child_dataset,generic_parent_dataset,generic_child_dataset,snapshot_name
tank,smb-parent,smb-child,generic-parent,generic-child,test-snapshot
tank,smb-parent,smb-child,generic-parent,generic-child,test-snapshot-%Y-%m-%d_%H-%M
Loading