ocs_ci.ocs.ui package
Subpackages
- ocs_ci.ocs.ui.page_objects package
- Submodules
- ocs_ci.ocs.ui.page_objects.alerting module
- ocs_ci.ocs.ui.page_objects.backing_store_tab module
- ocs_ci.ocs.ui.page_objects.block_and_file module
- ocs_ci.ocs.ui.page_objects.block_pools module
- ocs_ci.ocs.ui.page_objects.bucket_class_tab module
- ocs_ci.ocs.ui.page_objects.data_foundation_tabs_common module
- ocs_ci.ocs.ui.page_objects.edit_label_form module
- ocs_ci.ocs.ui.page_objects.namespace_store_tab module
- ocs_ci.ocs.ui.page_objects.object_bucket_claims_tab module
- ocs_ci.ocs.ui.page_objects.object_buckets_tab module
- ocs_ci.ocs.ui.page_objects.object_storage module
- ocs_ci.ocs.ui.page_objects.odf_topology_tab module
AbstractTopologyView
AbstractTopologyView.check_entity_selected()
AbstractTopologyView.expand_to_full_screen()
AbstractTopologyView.get_entity_name_from_df()
AbstractTopologyView.get_nested_deployment_names_of_node_from_df_ui()
AbstractTopologyView.get_nested_deployments_of_node_from_df_ui()
AbstractTopologyView.initiate_topology_df()
AbstractTopologyView.is_cluster_in_danger()
AbstractTopologyView.is_entity_present()
AbstractTopologyView.nav_back_main_topology_view()
AbstractTopologyView.nodes_view
AbstractTopologyView.read_presented_topology()
AbstractTopologyView.reset_search_bar()
AbstractTopologyView.reset_view()
AbstractTopologyView.select_entity_with_search_bar()
AbstractTopologyView.update_topology_status()
AbstractTopologyView.zoom_in_view()
AbstractTopologyView.zoom_out_view()
OdfTopologyDeploymentsView
OdfTopologyNodesView
TopologySidebar
TopologySidebar.close_sidebar()
TopologySidebar.get_number_of_alerts()
TopologySidebar.is_alert_tab_present()
TopologySidebar.is_node_down_alert_in_alerts_ui()
TopologySidebar.open_alerts_tab()
TopologySidebar.open_details_tab()
TopologySidebar.open_observe_tab()
TopologySidebar.open_resources_tab()
TopologySidebar.open_side_bar_of_entity()
TopologySidebar.read_alerts()
TopologySidebar.read_alerts_procedure()
TopologyTab
- ocs_ci.ocs.ui.page_objects.overview_tab module
OverviewTab
OverviewTab.nav_storage_system_details_from_storage_status_popup()
OverviewTab.nav_storage_system_details_via_system_capacity_card()
OverviewTab.nav_storage_systems_details_via_performance_card()
OverviewTab.open_quickstarts_page()
OverviewTab.open_storage_popup_from_status_card()
OverviewTab.validate_block_and_file_ready()
OverviewTab.validate_overview_tab_active()
OverviewTab.validate_performance_card_header_present()
OverviewTab.validate_system_capacity_card_present()
OverviewTab.wait_storagesystem_popup()
- ocs_ci.ocs.ui.page_objects.page_navigator module
PageNavigator
PageNavigator.nav_object_storage()
PageNavigator.nav_object_storage_page()
PageNavigator.nav_odf_default_page()
PageNavigator.navigate_OCP_home_page()
PageNavigator.navigate_alerting_page()
PageNavigator.navigate_block_pool_page()
PageNavigator.navigate_cluster_overview_page()
PageNavigator.navigate_dashboards_page()
PageNavigator.navigate_events_page()
PageNavigator.navigate_explore_page()
PageNavigator.navigate_installed_operators_page()
PageNavigator.navigate_metrics_page()
PageNavigator.navigate_object_bucket_claims_page()
PageNavigator.navigate_object_buckets_page()
PageNavigator.navigate_operatorhub_page()
PageNavigator.navigate_persistentvolumeclaims_page()
PageNavigator.navigate_persistentvolumes_page()
PageNavigator.navigate_pods_page()
PageNavigator.navigate_projects_page()
PageNavigator.navigate_quickstarts_page()
PageNavigator.navigate_search_page()
PageNavigator.navigate_storage()
PageNavigator.navigate_storageclasses_page()
PageNavigator.navigate_to_ocs_operator_page()
PageNavigator.navigate_volumesnapshotclasses_page()
PageNavigator.navigate_volumesnapshotcontents_page()
PageNavigator.navigate_volumesnapshots_page()
PageNavigator.select_administrator_user()
PageNavigator.select_namespace()
PageNavigator.verify_current_page_resource_status()
- ocs_ci.ocs.ui.page_objects.resource_list module
- ocs_ci.ocs.ui.page_objects.resource_page module
- ocs_ci.ocs.ui.page_objects.searchbar module
- ocs_ci.ocs.ui.page_objects.storage_system_details module
StorageSystemDetails
StorageSystemDetails.check_only_one_block_pools_tab()
StorageSystemDetails.get_blockpools_compression_status_from_storagesystem()
StorageSystemDetails.is_storage_system_details_breadcrumb_present()
StorageSystemDetails.nav_block_and_file()
StorageSystemDetails.nav_ceph_blockpool()
StorageSystemDetails.nav_cephblockpool_verify_statusready()
StorageSystemDetails.nav_details_object()
StorageSystemDetails.nav_details_overview()
StorageSystemDetails.nav_storage_systems_via_breadcrumb()
StorageSystemDetails.navigate_backward()
- ocs_ci.ocs.ui.page_objects.storage_system_tab module
- Module contents
Submodules
ocs_ci.ocs.ui.acm_ui module
- class ocs_ci.ocs.ui.acm_ui.ACMOCPClusterDeployment(platform, cluster_conf)
Bases:
AcmPageNavigator
Everything related to cluster creation through ACM goes here
- acm_bailout_if_failed()
- acm_cluster_status_creating(timeout=120)
- acm_cluster_status_failed(timeout=5)
- acm_cluster_status_ready(timeout=120)
- click_next_button()
- click_platform_and_credentials()
- create_cluster(cluster_config=None)
Create cluster using ACM UI
- Parameters:
cluster_config (Config) – framework.Config object of complete configuration required for deployment
- create_cluster_prereq()
- destroy_cluster()
ACM UI based destroy cluster, select the cluster from UI, click on destroy
- download_cluster_conf_files()
Download install-config and kubeconfig to cluster dir
- download_kubeconfig(authdir)
- fill_multiple_textbox(key_val)
In a page if we want to fill multiple text boxes we can use this function which iteratively fills in values from the dictionary parameter
- key_val (dict): keys corresponds to the xpath of text box, value corresponds
to the value to be filled in
- get_deployment_status()
- get_destroy_status()
Return the current status of destroy operation
- goto_cluster_details_page()
- post_destroy_ops()
Post destroy ops should be implemented by child classes because post destroy ops are mostly specific to the platform
- wait_for_cluster_create()
- class ocs_ci.ocs.ui.acm_ui.ACMOCPDeploymentFactory
Bases:
object
- get_platform_instance(cluster_config)
- Parameters:
cluster_config (dict) – Cluster Config object
- class ocs_ci.ocs.ui.acm_ui.ACMOCPPlatformVsphereIPI(cluster_conf=None)
Bases:
ACMOCPClusterDeployment
This class handles all behind the scene activities for cluster creation through ACM for vsphere platform
- add_different_pod_network()
Edit online cluster yaml to add network info
- create_cluster()
This function navigates through following pages in the UI 1. Cluster details 2. Node poools 3. Networks 4. Proxy 5. Automation 6. Review
- Raises:
ACMClusterDeployException – If deployment failed for the cluster
- create_cluster_prereq(timeout=600)
Perform all prereqs before vsphere cluster creation from ACM
- Parameters:
timeout (int) – Timeout for any UI operations
- fill_cluster_details_page()
Fill in following details in “Cluster details” page 1. Cluster name 2. Base DNS domain 3. Release image
- fill_network_info()
We need to fill following network info 1. vSphere network name 2. API VIP 3. Ingress VIP
- get_ocp_release_img()
- post_destroy_ops()
Post destroy ops includes 1. Deleting DNS entries 2. Freeing the ips assigned
Bases:
BaseUI
ACM Page Navigator Class
Navigate to ACM Applications Page
Navigate to ACM Automation Page
Navigate to ACM Bare Metal Assets Page
Navigate to ACM Clusters Page
Navigate to ACM Credentials Page
Navigate to Data Services page on ACM UI, supported for ACM version 2.7 and above
For ACM version 2.7 and above we need to navigate from OCP console to ACM multicluster page
Navigate to ACM Governance Page
Navigate to ACM Infrastructure Environments Page
Navigate to ACM Overview Page
Navigate to ACM Welcome Page
ocs_ci.ocs.ui.add_replace_device_ui module
- class ocs_ci.ocs.ui.add_replace_device_ui.AddReplaceDeviceUI
Bases:
PageNavigator
InfraUI class for add capacity, device replacement, node replacement
- add_capacity_ui()
Add Capacity via UI
- verify_pod_status(pod_names, pod_state='Running')
Verify pod status
- Parameters:
pod_names (list) – list of pod names
pod_state (string) – the desired pod state
ocs_ci.ocs.ui.base_ui module
- class ocs_ci.ocs.ui.base_ui.BaseUI
Bases:
object
Base Class for UI Tests
- check_element_presence(locator, timeout=5)
Check if an web element is present on the web console or not.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) occurs
- Returns:
True if the element is found, returns False otherwise and raises NoSuchElementException
- Return type:
bool
- check_element_text(expected_text, element='*')
Check if the text matches the expected text.
- Parameters:
expected_text (string) – The expected text.
- Returns:
True if the text matches the expected text, False otherwise
- Return type:
bool
- check_number_occurrences_text(expected_text, number, element='*')
The number of times the string appears on the web page
- Parameters:
expected_text (string) – The expected text.
number (int) – The number of times the string appears on the web page
- Returns:
True if the text matches the expected text, False otherwise
- Return type:
bool
- choose_expanded_mode(mode, locator)
Select the element mode (expanded or collapsed)
mode (bool): True if element expended, False otherwise locator (tuple): (GUI element needs to operate on (str), type (By))
- clear_input_gradually(locator)
Clean input field by gradually deleting characters one by one. This way we avoid common automation issue when input field is not cleared.
- Returns:
True if the input element is successfully cleared, False otherwise.
- Return type:
bool
- clear_with_ctrl_a_del(locator, timeout=30)
Clear the existing text using CTRL + a and then Del keys, as on some elements .clear() function doesn’t always work correctly.
- copy_dom(name_suffix: str = '')
Get page source of the webpage
- classmethod deep_get(dictionary, *keys)
- do_clear(locator, timeout=30)
Clear the existing text from UI
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element until timeout (sec) occurs
- do_click(locator, timeout=30, enable_screenshot=False, copy_dom=False, avoid_stale=False)
Click on Button/link on OpenShift Console
locator (tuple): (GUI element needs to operate on (str), type (By)) timeout (int): Looks for a web element repeatedly until timeout (sec) happens. enable_screenshot (bool): take screenshot copy_dom (bool): copy page source of the webpage avoid_stale (bool): if got StaleElementReferenceException, caused by reference to stale, cached element, refresh the page once and try click again * don’t use when refreshed page expected to be different from initial page, or loose input values
- do_click_by_id(id, timeout=30)
- do_click_by_xpath(xpath, timeout=30)
Function to click on a web element using XPATH :param xpath: xpath to interact with web element :type xpath: str :param timeout: timeout until which an exception won’t be raised :type timeout: int
- Returns:
Clicks on the web element found
- do_send_keys(locator, text, timeout=30)
Send text to element on OpenShift Console
locator (tuple): (GUI element needs to operate on (str), type (By)) text (str): Send text to element timeout (int): Looks for a web element repeatedly until timeout (sec) happens.
- find_an_element_by_xpath(locator)
Function to find an element using xpath
- Parameters:
locator (str) – locator of the element to be found
- Returns:
an object of the type WebElement
- get_checkbox_status(locator, timeout=30)
Checkbox Status
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) happens.
- Returns:
True if element is Enabled, False otherwise
- Return type:
bool
- get_element_attribute(locator, attribute, safe: bool = False)
Get attribute from WebElement
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
attribute (str) – the value of this attribute will be extracted from WebElement
safe (bool) – if True exception will not raise when element not found. Default option - not safe
- Returns:
value of the attribute of requested and found WebElement
- Return type:
str
- get_element_text(locator)
Get the inner text of an element in locator.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
- Returns:
The text captured.
- Return type:
str
- get_elements(locator)
Get an elements list. Useful to count number of elements presented on page, etc.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
- Returns:
The list of WebElements
- Return type:
list
- is_expanded(locator, timeout=30)
Check whether an element is in an expanded or collapsed state
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) happens.
- Returns:
True if element expended, False otherwise
- Return type:
bool
Navigate to a previous Web Page
- page_has_loaded(retries=5, sleep_time=2, module_loc=('html', 'tag name'))
Waits for page to completely load by comparing current page hash values. Not suitable for pages that use frequent dynamically content (less than sleep_time)
- Parameters:
retries (int) – How much time in sleep_time to wait for page to load
sleep_time (int) – Time to wait between every pool of dom hash
module_loc (tuple) – locator of the module of the page awaited to be loaded
- refresh_page()
Refresh Web Page
- scroll_into_view(locator)
Scroll element into view
- select_checkbox_status(status, locator)
Select checkbox status (enable or disable)
status (bool): True if checkbox enable, False otherwise locator (tuple): (GUI element needs to operate on (str), type (By))
- take_screenshot(name_suffix: str = '')
Take screenshot using python code
- wait_for_element_attribute(locator, attribute, attribute_value, timeout, sleep)
Method to wait attribute have specific value. Fails the test if attribure value not equal to expected :param locator: (GUI element needs to operate on (str), type (By)). :type locator: tuple :param attribute: the value of this attribute will be extracted from WebElement :type attribute: str :param attribute_value: the value attribute (can be None as well) :type attribute_value: str :param timeout: timeout in seconds :type timeout: int :param sleep: sleep interval in seconds :type sleep: int
- wait_for_element_to_be_present(locator, timeout=30)
Wait for element to be present. Use when Web element should be present, but may be placed above another element on the z-layer Method does not fail when Web element not found
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
timeout (int) – Looks for a web element until timeout (sec) occurs
- wait_for_element_to_be_visible(locator, timeout=30)
Wait for element to be visible. Use when Web element is not have to be clickable (icons, disabled btns, etc.) Method does not fail when Web element not found
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
timeout (int) – Looks for a web element until timeout (sec) occurs
- wait_for_endswith_url(endswith, timeout=60)
Wait for endswith url to load
- Parameters:
endswith (string) – url endswith string for which we need to wait
timeout (int) – Timeout in seconds
- wait_until_expected_text_is_found(locator, expected_text, timeout=60)
Method to wait for a expected text to appear on the UI (use of explicit wait type), this method is helpful in working with elements which appear on completion of certain action and ignores all the listed exceptions for the given timeout.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
expected_text (str) – Text which needs to be searched on UI
timeout (int) – Looks for a web element repeatedly until timeout (sec) occurs
- Returns:
Returns True if the expected element text is found, False otherwise
- Return type:
bool
- ocs_ci.ocs.ui.base_ui.close_browser()
Close Selenium WebDriver
- ocs_ci.ocs.ui.base_ui.copy_dom(name_suffix: str = '', dom_folder=None)
Copy DOM using python code
- Parameters:
name_suffix (str) – name suffix, will be added before extension. Optional argument
dom_folder (str) – path to folder where dom text file will be saved
- ocs_ci.ocs.ui.base_ui.garbage_collector_webdriver()
Garbage Collector for webdriver objs
- ocs_ci.ocs.ui.base_ui.login_ui(console_url=None, username=None, password=None, **kwargs)
Login to OpenShift Console
- Parameters:
console_url (str) – ocp console url
username (str) – User which is other than admin user,
password (str) – Password of user other than admin user
- Returns:
driver (Selenium WebDriver)
Navigate to All Clusters page, if not already there :param kwargs: acm_page locators dict, timeout
- Raises:
TimeoutException – if timeout occurs, and All clusters acm page is not loaded
Navigate to Local Cluster page, if not already there :param kwargs: acm_page locators dict, timeout
- Raises:
TimeoutException – if timeout occurs, and local clusters page is not loaded
- ocs_ci.ocs.ui.base_ui.proceed_to_login_console()
Proceed to the login console, if needed to confirm this action in a page that appears before. This is required to be as a solo function, because the driver initializes in the login_ui function. Function needs to be called just before login
- Returns:
None
- ocs_ci.ocs.ui.base_ui.screenshot_dom_location(type_loc='screenshot')
Get the location for copy DOM/screenshot
- Parameters:
type_loc (str) – if type_loc is “screenshot” the location for copy screeenshot else DOM
- ocs_ci.ocs.ui.base_ui.take_screenshot(name_suffix: str = '', screenshots_folder=None)
Take screenshot using python code
- Parameters:
name_suffix (str) – name suffix, will be added before extension. Optional argument
screenshots_folder (str) – path to folder where screenshot will be saved
- ocs_ci.ocs.ui.base_ui.wait_for_element_to_be_clickable(locator, timeout=30)
Wait for an element to be clickable.
- Parameters:
locator (tuple) – A tuple containing the locator strategy (e.g., By.ID, By.XPATH) and the locator value.
timeout (int) – Maximum time (in seconds) to wait for the element to be clickable. Defaults to 30 seconds.
- Returns:
The clickable web element.
- Return type:
selenium.webdriver.remote.webelement.WebElement
- ocs_ci.ocs.ui.base_ui.wait_for_element_to_be_visible(locator, timeout=30)
Wait for element to be visible. Use when Web element is not have to be clickable (icons, disabled btns, etc.) Method does not fail when Web element not found
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
timeout (int) – Looks for a web element until timeout (sec) occurs
- Returns:
Visible web element.
- Return type:
selenium.webdriver.remote.webelement.WebElement
ocs_ci.ocs.ui.block_pool module
- class ocs_ci.ocs.ui.block_pool.BlockPoolUI
Bases:
PageNavigator
User Interface Selenium for Block Pools page
- check_pool_avail_capacity(pool_name)
Check the available capacity of the blockpool
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
The total available capacity of blockpool
- Return type:
str
- check_pool_compression_eligibility(pool_name)
Check the pool the percentage of incoming data that is compressible
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
percentage of incoming compressible data
- Return type:
str
- check_pool_compression_ratio(pool_name)
Check the blockpool compression ratio
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
Compression ratio of blockpool
- Return type:
str
- check_pool_compression_savings(pool_name)
Check the total savings gained from compression for this pool, including replicas
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
The total savings gained from compression for this pool, including replicas
- Return type:
str
- check_pool_compression_status(pool_name)
Check what is the status of pool compression
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
True if pool is in the Enabled, otherwise False
- Return type:
bool
- check_pool_existence(pool_name)
Check if pool appears in the block pool list
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
True if pool is in the list of pools page, otherwise False
- Return type:
bool
- check_pool_replicas(pool_name)
Check the number of replicas for the pool
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
Number of replicas for the pool
- Return type:
int
- check_pool_status(pool_name)
Check the status of the pool
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
status of the pool
- Return type:
str
- check_pool_used_capacity(pool_name)
Check the total used capacity of the blockpool
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
The total used capacity of the blockpool
- Return type:
str
- check_pool_volume_type(pool_name)
Check the volume type of the pool
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
Volume type of pool if set otherwise
- Return type:
str
- check_storage_class_attached(pool_name)
Checks the number of storage class attached to the pool.
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
The total number of storage classes attached to the pool.
- Return type:
int
- create_pool(replica, compression)
Create block pool via UI
- Parameters:
replica (int) – replica size usually 2,3
compression (bool) – True to enable compression otherwise False
- Returns:
pool name (str) pool status (bool) #pool can be created with failure status
- Return type:
array
- delete_pool(pool_name)
Delete pool from pool page
- Parameters:
pool_name (str) – The name of the pool to be deleted
- Returns:
True if pool is not found in pool list, otherwise false
- Return type:
bool
- edit_pool_parameters(pool_name, replica=3, compression=True)
Edit an already existing pool
- Parameters:
pool_name (str) – The name of the pool to change.
replica (int) – size of replica. Available in OCS now 2,3.
compression (bool) – True if enable compression. False otherwise.
- reach_pool_limit(replica, compression)
Add pools till pool fails because of pg limit.
- Parameters:
replica (int) – size of pool.
compression (bool) – True for enabling compression. Otherwise False.
ocs_ci.ocs.ui.deployment_ui module
- class ocs_ci.ocs.ui.deployment_ui.DeploymentUI
Bases:
PageNavigator
Deployment OCS/ODF Operator via User Interface
- configure_data_protection()
Configure Data Protection
- configure_encryption()
Configure Encryption
- configure_in_transit_encryption()
Configure in_transit_encryption
- configure_osd_size()
Configure OSD Size
- configure_performance()
Configure performance mode
- create_storage_cluster()
Review and Create StorageCluster/StorageSystem
- enable_taint_nodes()
Enable taint Nodes
- install_internal_cluster()
Install Internal Cluster
- install_local_storage_operator()
Install local storage operator
- install_lso_cluster()
Install LSO cluster via UI
- install_mcg_only_cluster()
Install MCG ONLY cluster via UI
- install_ocs_operator()
Install OCS/ODF Opeartor
- install_ocs_ui()
Install OCS/ODF via UI
- install_storage_cluster()
Install StorageCluster/StorageSystem
- refresh_popup(timeout=30)
Refresh PopUp
- search_operator_installed_operators_page(operator='OpenShift Container Storage')
Search Operator on Installed Operators Page
- Parameters:
operator (str) – type of operator
- verify_disks_lso_attached(timeout=600, sleep=20)
Verify Disks Attached
- Parameters:
timeout (int) – Time in seconds to wait
sleep (int) – Sampling time in seconds
- verify_operator_succeeded(operator='OpenShift Container Storage', timeout_install=300, sleep=20)
Verify Operator Installation
- Parameters:
operator (str) – type of operator
timeout_install (int) – Time in seconds to wait
sleep (int) – Sampling time in seconds
ocs_ci.ocs.ui.helpers_ui module
- ocs_ci.ocs.ui.helpers_ui.format_locator(locator, *args)
Use this function format_locator when working with dynamic locators.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
*args (str) – Name of the variable (string) which contains the dynamic web element when generated on certain action
- Returns:
formats the locator using .format() function which takes string to be inserted as an argument
- ocs_ci.ocs.ui.helpers_ui.get_element_by_text(text)
This function accepts a text as an argument and returns the element type by creating XPATH for it. This is helpful when we are creating dynamic names for PVC’s, Pod’s, Namespaces’s etc. and want to interact with the same on UI.
- ocs_ci.ocs.ui.helpers_ui.get_element_type(element_name)
This function accepts an element name as a argument and returns the element type by creating XPATH for it. This is helpful when we are creating dynamic names for PVC’s, Pod’s, Namespaces’s etc. and want to interact with the same on UI.
- ocs_ci.ocs.ui.helpers_ui.ui_add_capacity(osd_size_capacity_requested)
Add Capacity via UI
- Parameters:
osd_size_capacity_requested (int) – Requested osd size capacity
- Returns:
Returns True if all OSDs are in Running state
- Return type:
new_storage_devices_sets_count (int)
- ocs_ci.ocs.ui.helpers_ui.ui_add_capacity_conditions()
Conditions for add capacity via UI
- Returns:
True if support UI add capacity, False otherwise
- Return type:
bool
- ocs_ci.ocs.ui.helpers_ui.ui_deployment_conditions()
Conditions for installing the OCS operator via UI
- Returns:
True if support UI deployment, False otherwise
- Return type:
bool
ocs_ci.ocs.ui.mcg_ui module
- class ocs_ci.ocs.ui.mcg_ui.BucketClassUI
Bases:
PageNavigator
A class representation for abstraction of BC-related OpenShift UI actions
- create_namespace_bucketclass_ui(bc_name, policy, nss_name_lst, bs_name_lst)
Create a namespace BC via the UI
- Parameters:
bc_name (str) – The name to grant the BC
policy (str) – The policy type to use. Single/Multi/Cache
nss_name_lst (list[str]) – A list of namespacestore names to be used by the bucketclass
bs_name_lst (list[str]) – A list of backingstore names to be used by the bucketclass
- create_standard_bucketclass_ui(bc_name, policy, store_list)
Create a standard BC via the UI
- Parameters:
bc_name (str) – The name to grant the BC
policy (str) – The policy type to use. Spread/Mirror
store_list (list[str]) – A list of backingstore names to be used by the bucketclass
- delete_bucketclass_ui(bc_name)
Delete a BC via the UI
bc_name (str): Name of the BC to be deleted
- set_cache_namespacestore_policy(nss_name_lst, bs_name_lst)
- set_multi_namespacestore_policy(nss_name_lst)
- set_namespacestore_policy = {'cache': <function BucketClassUI.set_cache_namespacestore_policy>, 'multi': <function BucketClassUI.set_multi_namespacestore_policy>, 'single': <function BucketClassUI.set_single_namespacestore_policy>}
- set_single_namespacestore_policy(nss_name_lst)
- class ocs_ci.ocs.ui.mcg_ui.NamespaceStoreUI
Bases:
ObjectStorage
- create_namespace_store(namespace_store_name, namespace_store_provider, namespace_store_pvc_name, namespace_store_folder)
- Parameters:
namespace_store_name (str) – the namespace store
namespace_store_provider (str) – the provider [aws, filesystem, azure]
namespace_store_pvc_name (str) – pvc name for file system mode
namespace_store_folder (str) – the folder name for mount point to fs.
ocs_ci.ocs.ui.odf_topology module
- class ocs_ci.ocs.ui.odf_topology.OdfTopologyHelper
Bases:
object
Helper class to automate procedures necessary for ODF Topology related tests
- busy_box_depl = {'apiVersion': 'apps/v1', 'kind': 'Deployment', 'metadata': {'annotations': {'deployment.kubernetes.io/revision': '1'}, 'name': 'busybox-ui-test', 'namespace': {}}, 'spec': {'selector': {'matchLabels': {'app': 'test-deployment-busybox'}}, 'template': {'metadata': {'labels': {'app': 'test-deployment-busybox'}}, 'spec': {'containers': [{'name': 'busybox', 'image': 'quay.io/quay/busybox', 'command': ['sleep', '360000']}], 'nodeName': {}}}}}
- delete_busybox(force: bool = False)
Deletes the BusyBox deployment from cluster.
- Parameters:
force (bool, optional) – If True, force deletion even if the deployment is not found. Defaults to False.
- Returns:
- The deletion result if the BusyBox deployment exists and is successfully deleted.
Returns None otherwise.
- Return type:
dict
- deploy_busybox() str
Deploys a busybox container to a randomly selected worker node.
- Returns:
The name of the node where the busybox container is deployed, if deployed, otherwise None.
- Return type:
str
- file_stream = <_io.TextIOWrapper name='/home/docs/checkouts/readthedocs.org/user_builds/ocs-ci/checkouts/latest/ocs_ci/templates/ocp-deployment/busybox.yaml' mode='r' encoding='UTF-8'>
- get_busybox_depl_name()
Retrieves the name of the BusyBox deployment.
- Returns:
Name of the BusyBox deployment.
- Return type:
str
- get_deployment_names_from_node_df_cli(node_name) list
Retrieves the deployment names associated with a node from the CLI-based topology DataFrame.
- Parameters:
node_name (str) – Name of the node.
- Returns:
List of deployment names associated with the given node.
- Return type:
list
- get_deployment_obj_from_node_df_cli(node_name, deployment_name)
Retrieves the deployment OCP object associated with a specific node and deployment name from the dataframe taken from CLI.
- Parameters:
node_name (str) – Name of the node.
deployment_name (str) – Name of the deployment.
- Returns:
Deployment object associated with the specified node and deployment.
- Return type:
- Raises:
ValueError – If no deployment with the specified name is found in the given node.
ValueError – If an incorrect object is requested (invalid node name or deployment name).
- get_node_names_df_cli() list
Retrieves a list of node names from the CLI topology DataFrame.
- Returns:
A list of node names extracted from the CLI topology DataFrame.
- Return type:
list
- get_pod_obj_from_node_and_depl_df_cli(node_name, deployment_name, pod_name)
Retrieves the Pod object from the CLI based on the node name, deployment name, and pod name.
- Parameters:
node_name (str) – Name of the node.
deployment_name (str) – Name of the deployment.
pod_name (str) – Name of the pod.
- Returns:
The pod object matching the specified node, deployment, and pod names.
- Return type:
Example
get_pod_obj_from_node_and_depl_df_cli(“node-1”, “my-deployment”, “my-pod”) # Returns the Pod object for the specified node, deployment, and pod names.
- get_pod_status_df_cli(node_name, deployment_name, pod_name)
Retrieves the status of a pod from the CLI and returns it as a dictionary.
- Parameters:
node_name (str) – Name of the node.
deployment_name (str) – Name of the deployment.
pod_name (str) – Name of the pod.
- Returns:
Dictionary containing the status of the pod.
- Return type:
dict
- get_topology_cli_str()
Retrieves the topology CLI string representation.
- Returns:
Object representing the topology CLI string.
- Return type:
- read_topology_cli_all()
Gather data about cluster in form of table where columns are node names and rows are deployments. If node has a deployment the table will have a reference to OCP object
Returns: pd.DataFrame similar to: # +————————+—————————+—————————+——————–+ # | | compute-2 | compute-1 | compute-0 | # +========================+===========================+===========================+====================+ # | csi-addo…manager | [<ocs_ci.ocs.OCP object>, | nan | nan | # +————————+—————————+—————————+——————–+ # | csi-rbd…provisioner | [<ocs_ci.ocs.OCP object>, | [<ocs_ci.ocs.OCP object>, | nan | # +————————+—————————+—————————+——————–+ # | rook-rgw-ocs-storagecl.| [<ocs_ci.ocs.OCP object>, | nan | nan | # +————————+—————————+—————————+——————–+ # | csi-…plugin-prov | nan | [<ocs_ci.ocs.OCP object>, | [<ocs_ci.ocs.OCP>, | # +————————+—————————+—————————+——————–+
- reload_depl_data_obj_from_node_df_cli(node_name, deployment_name)
Reloads the data object for a deployment from the CLI.
This method retrieves the deployment object associated with the provided node and deployment names, and then reloads its data to have DataFrame objects updated
- Parameters:
node_name (str) – Name of the node.
deployment_name (str) – Name of the deployment.
- reload_pod_obj_from_node_and_depl_df_cli(node_name, deployment_name, pod_name)
Reloads the data of a pod object from the CLI using node, deployment, and pod names to have DataFrame objects updated
- Parameters:
node_name (str) – Name of the node associated with the pod.
deployment_name (str) – Name of the deployment associated with the pod.
pod_name (str) – Name of the pod.
- set_busybox_depl_name(name)
Sets the name of the BusyBox deployment.
- Parameters:
name (str) – New name for the BusyBox deployment.
- set_resource_obj_of_node_df_cli(node_name, deployment_name, obj_new)
Sets a new resource OCP object in the node dataframe for a given node and deployment.
- Parameters:
node_name (str) – Name of the node.
deployment_name (str) – Name of the deployment.
obj_new (ocs_ci.ocs.ocp.OCP or Pod) – New resource object to be set.
- Returns:
The newly set resource object.
Example
set_resource_obj_of_node_df_cli(“node-1”, “my-deployment”, new_pod_object) # Returns the new_pod_object that has been set in the node dataframe.
Note
The method assumes the availability of the OCP and Pod classes.
- topology_cli_df = Empty DataFrame Columns: [] Index: []
- wait_busy_box_scaled_up(timeout) bool
Waits for the ‘busybox’ deployment to be scaled up within the specified timeout.
- Parameters:
timeout (int) – The maximum time to wait for the deployment to be scaled up, in seconds.
- Returns:
True if the deployment is successfully scaled up within the timeout, False otherwise.
- Return type:
bool
- class ocs_ci.ocs.ui.odf_topology.TopologyCliStr(topology_df)
Bases:
object
Class-helper to visualize Topology configuration saved in dataframe gathered with cli output.
- class ocs_ci.ocs.ui.odf_topology.TopologyUiStr(topology_df)
Bases:
object
Class-helper to visualize Topology configuration saved in dataframe gathered with Selenium driver.
- ocs_ci.ocs.ui.odf_topology.get_creation_ts_with_offset(node_metadata) str
Retrieves the creation timestamp of a node with offset similar to what we see on ODF Management console.
- Parameters:
node_metadata (dict) – Node metadata containing the ‘creationTimestamp’ value.
- Returns:
Formatted creation timestamp with offset.
- Return type:
str
Example
get_creation_ts_with_offset({‘creationTimestamp’: ‘2022-01-01T12:34:56Z’}) # Returns ‘Jan 1, 2022, 12:34 PM’.
Note
Assumes ‘creationTimestamp’ is in the format ‘%Y-%m-%dT%H:%M:%SZ’.
- ocs_ci.ocs.ui.odf_topology.get_deployment_details_cli(deployment_name) dict
Retrieves detailed information about a deployment from the CLI.
- Parameters:
deployment_name (str) – Name of the deployment.
- Returns:
- Dictionary containing the deployment details, including its name, namespace, labels,
number of annotations, owner, and creation timestamp.
- Return type:
dict
Example
get_deployment_details_cli(“my-deployment”) # Returns {‘name’: ‘my-deployment’, ‘namespace’: ‘my-namespace’, ‘labels’: {‘app’: ‘my-app’}, # ‘annotation’: ‘3 annotations’, ‘owner’: ‘my-owner’, ‘created_at’: ‘Jun 1, 2023, 10:00 AM’}
- ocs_ci.ocs.ui.odf_topology.get_node_details_cli(node_name) dict
Retrieves detailed information about a node from the CLI.
- Parameters:
node_name (str) – Name of the node.
- Returns:
- Dictionary containing the node details, including its name, status, role, operating system,
kernel version, instance type, OS image, architecture, addresses, kubelet version, provider ID, number of annotations, external ID, and creation timestamp.
- Return type:
dict
Example
get_node_details_cli(“node-1”) # Returns {‘name’: ‘node-1’, ‘status’: ‘Ready’, ‘role’: ‘worker’, ‘operating_system’: ‘linux’, # ‘kernel_version’: ‘4.18.0-305.12.1.el8_4.x86_64’, ‘instance_type’: ‘m5.large’, # ‘OS_image’: ‘CentOS Linux 8 (Core)’, ‘architecture’: ‘amd64’, # ‘addresses’: ‘External IP: 203.0.113.10; Hostname: node-1; Internal IP: 192.168.0.1’, # ‘kubelet_version’: ‘v1.21.2’, ‘provider_ID’: ‘aws’, ‘annotations_number’: ‘5 annotations’, # ‘external_id’: ‘-’, ‘created’: ‘Jun 1, 2023, 10:00 AM’}
- ocs_ci.ocs.ui.odf_topology.get_node_names_of_the_pods_by_pattern(pattern)
Get the node names of the pods matching the given pattern.
- Parameters:
pattern (str) – The pattern to match the pod names.
- Returns:
A dictionary mapping pod names to their corresponding node names.
- Return type:
dict
ocs_ci.ocs.ui.pvc_ui module
- class ocs_ci.ocs.ui.pvc_ui.PvcUI
Bases:
PageNavigator
User Interface Selenium
- create_pvc_ui(project_name, sc_name, pvc_name, access_mode, pvc_size, vol_mode)
Create PVC via UI. :param project_name: name of test project :type project_name: str :param sc_name: storage class name :type sc_name: str :param pvc_name: the name of pvc :type pvc_name: str :param access_mode: access mode :type access_mode: str :param pvc_size: the size of pvc (GB) :type pvc_size: str :param vol_mode: volume mode type :type vol_mode: str
- delete_pvc_ui(pvc_name, project_name)
Delete pvc via UI :param pvc_name: Name of the pvc :type pvc_name: str :param project_name: name of test project :type project_name: str
- pvc_clone_ui(project_name, pvc_name, cloned_pvc_access_mode='ReadWriteOnce', cloned_pvc_name=None)
Clone PVC via UI
- Parameters:
project_name (str) – The name of project
pvc_name (str) – The name of PVC
cloned_pvc_access_mode (str) – Access mode for cloned PVC
cloned_pvc_name (str) – The name for cloned PVC
- pvc_resize_ui(project_name, pvc_name, new_size)
Resizing pvc via UI :param project_name: name of test project :type project_name: str :param pvc_name: the name of pvc :type pvc_name: str :param new_size: the new size of pvc (GB) :type new_size: int
- verify_pvc_resize_ui(project_name, pvc_name, expected_capacity)
Verifying PVC resize via UI :param project_name: name of test project :type project_name: str :param pvc_name: the name of pvc :type pvc_name: str :param expected_capacity: the new size of pvc (GiB) :type expected_capacity: str
- verify_pvc_ui(pvc_size, access_mode, vol_mode, sc_name, pvc_name, project_name)
Verifying PVC details via UI
- Parameters:
pvc_size (str) – the size of pvc (GB)
access_mode (str) – access mode
vol_mode (str) – volume mode type
sc_name (str) – storage class name
pvc_name (str) – the name of pvc
project_name (str) – name of test project
ocs_ci.ocs.ui.storageclass module
- class ocs_ci.ocs.ui.storageclass.StorageClassUI
Bases:
PageNavigator
User Interface Selenium
- create_encrypted_storage_class_ui(backend_path=None, reclaim_policy='Delete', provisioner='openshift-storage.rbd.csi.ceph.com', vol_binding_mode='Immediate', service_name=None, kms_address=None, tls_server_name=None)
Test for creation of storage class with encryption via UI :param backend_path: name of the vault backend path :type backend_path: str :param reclaim_policy: value of the reclaim policy, it could be ‘Delete’ or ‘Retain’ :type reclaim_policy: str :param provisioner: type of provisioner used, it could be ‘rbd’ or ‘cephfs’ :type provisioner: str :param vol_binding_mode: value of the volume binding mode, it could be ‘WaitForFirstConsumer’ or ‘Immediate’ :type vol_binding_mode: str :param service_name: the default value is None which can be changed in the function call :type service_name: str :param kms_address: the default value is None which can be changed in the function call :type kms_address: str :param tls_server_name: the default value is None which can be changed in the function call :type tls_server_name: str
- Returns:
sc_name (str) if the storage class creation is successful, returns False otherwise
- create_storageclass(pool_name)
Basic function to create RBD based storageclass
- Parameters:
pool_name (str) – The pool to choose in the storageclass.
- Returns:
the name of the storageclass created, otherwise return None.
- Return type:
sc_name (str)
- delete_rbd_storage_class(sc_name)
Delete RBD storageclass
- Parameters:
sc_name (str) – Name of the storageclass to delete.
- Returns:
True if deletion succeeded otherwise False.
- Return type:
(bool)
- verify_storageclass_existence(sc_name)
Check if storageclass is existing in the storageclass list page
- Parameters:
sc_name (str) – The name of storageclass to verify.
- Returns:
True is it exist otherwise False.
ocs_ci.ocs.ui.validation_ui module
- class ocs_ci.ocs.ui.validation_ui.ValidationUI
Bases:
PageNavigator
User Interface Validation Selenium
- check_capacity_breakdown(project_name, pod_name)
Check Capacity Breakdown
- Parameters:
project_name (str) – The name of the project
pod_name (str) – The name of pod
- Returns:
True if project_name and pod_name exist on capacity_breakdown, False otherwise
- Return type:
bool
- odf_console_plugin_check()
Function to verify if console plugin is enabled on UI or not, if not, this function will enable it so as to see ODF tab under Storage section
- odf_overview_ui()
Method to verify changes and validate elements on ODF Overview tab for ODF 4.9
Steps: 1. Validate ODF console plugin is enabled, if not enable it 2. Navigate to ODF Default first tab 3. Verify if Overview tab is active 4. Verify if Storage System popup works 5. Ensure that Block and File status, on Storage System popup is Ready 6. Navigate to Storage System details via Storage System popup 7. Verify only one Block Pool present on Storage System details page - optional. No BlockPools in External mode 8. Navigate Storage System via breadcrumb 9. Verify if Overview tab is active 10. Verify if System Capacity Card is present 11. Navigate to Storage System details via System Capacity Card - optional. Card not presented in External mode 12. Verify if Storage System details breadcrumb is present - optional. If step 11 was performed 13. Navigate to ODF Overview tab via tab bar - optional. If step 11 was performed 14. Verify if Performance Card is present and link works 15. Navigate to Storage System details via Performance Card 16. Verify if Storage System details breadcrumb is present and link works 17. Navigate ODF Backing store tab via Object Storage tab or PageNavigator 18. Verify if Backing Store is present and link to Backing Store resource works 19. Navigate to Backing Store tab via breadcrumb 20. Navigate to Bucket class tab 21. Navigate to the default Bucket Class details via Bucket Class tab 22. Verify the status of a default Bucket Class 23. Navigate to Bucket class via breadcrumb 24. Navigate to Namespace Store tab via Bucket Class tab 25. Navigate to ODF Overview tab via tab bar
- odf_storagesystems_ui()
Function to verify changes and validate elements on ODF Storage Systems tab for ODF 4.9
- refresh_web_console()
- validate_storage_cluster_ui()
Function to validate Storage Cluster on UI for ODF 4.9 and above
- validate_unprivileged_access()
Function to verify the unprivileged users can’t access ODF dashbaord
- verification_ui()
Verification UI
- verify_object_service_page()
Verify Object Service Page UI
- verify_ocs_operator_tabs()
Verify OCS Operator Tabs
- verify_odf_without_ocs_in_installed_operator() tuple
Function to validate ODF operator is present post ODF installation, expectation is only ODF operator should be present in Installed operators tab and OCS operator shouldn’t be present. This function is only written for 4.9+ versions
Returns: tuple: odf_operator_presence, ocs_operator_presence
- verify_page_contain_strings(strings_on_page, page_name)
Verify Page Contain Strings
- Parameters:
strings_on_page (list) – list of strings on page
page_name (str) – the name of the page
- verify_persistent_storage_page()
Verify Persistent Storage Page
ocs_ci.ocs.ui.views module
ocs_ci.ocs.ui.workload_ui module
- class ocs_ci.ocs.ui.workload_ui.PvcCapacityDeployment(pvc_obj: PVC, capacity_float: float, deployment: str | None = None)
Bases:
object
Class to store PVC capacity and deployment name to avoid unnecessary queries to a cluster and speed-up the test
- class ocs_ci.ocs.ui.workload_ui.PvcCapacityDeploymentList(*args, **kwargs)
Bases:
list
Subclass of list to store a list of PvcCapacityDeployment objects and provide additional methods.
- add_instance(pvc_obj: PVC, capacity_float: float, deployment: str | None = None)
Add a PvcCapacityDeployment object to the list.
- Parameters:
pvc_obj (PVC) – The PVC object.
capacity_float (float) – The capacity in float.
deployment (str, optional) – The deployment name. Defaults to None.
- delete_deployment(deployment: Deployment)
Deletes the deployment from the cluster and from the list. :param deployment:
- delete_pvc(pvc: PVC)
Delete the PVC with or without data and remove the PvcCapacityDeployment object from list, make sure that PV is deleted as well.
It is designed to delete mounted PVC with mounted PV as we want to test the behavior of management-console :param pvc: PVC object
- get_deployment_names_list()
Get the list of deployments.
- Returns:
The list of deployments.
- Return type:
list
- get_pvc_capacity_deployment(index: int) PvcCapacityDeployment
Get the PvcCapacityDeployment object at the specified index.
- Parameters:
index (int) – The index of the PvcCapacityDeployment object to retrieve.
- Returns:
The PvcCapacityDeployment object at the specified index.
- Return type:
- get_pvc_capacity_deployment_by_deployment(deployment: str)
Get the PvcCapacityDeployment object by deployment.
- Parameters:
deployment (str) – The deployment name.
- Returns:
The PvcCapacityDeployment object that matches the pvc_obj and deployment.
- Return type:
- get_pvc_names_list()
Get the list of pvcs.
- Returns:
The list of pvcs.
- Return type:
list
- set_pvc_capacity_deployment(index: int, pvc_obj: PVC, capacity_float: float, deployment: str | None = None)
Set the PvcCapacityDeployment object at the specified index.
- Parameters:
index (int) – The index of the PvcCapacityDeployment object to set.
pvc_obj (PVC) – The PVC object.
capacity_float (float) – The capacity in float.
deployment (str, optional) – The deployment name. Defaults to None.
- class ocs_ci.ocs.ui.workload_ui.SingletonMeta
Bases:
type
Singleton class to ensure only one instance of WorkloadUi is created.
- class ocs_ci.ocs.ui.workload_ui.WorkloadUi(*args, **kwargs)
Bases:
object
Class to handle workload UI related operations
- busy_box_depl = {'apiVersion': 'apps/v1', 'kind': 'Deployment', 'metadata': {'annotations': {'deployment.kubernetes.io/revision': '1'}, 'name': 'busybox-ui-test', 'namespace': {}}, 'spec': {'selector': {'matchLabels': {'app': 'test-deployment-busybox'}}, 'template': {'metadata': {'labels': {'app': 'test-deployment-busybox'}}, 'spec': {'containers': [{'name': 'busybox', 'image': 'quay.io/quay/busybox', 'command': ['sleep', '360000']}], 'nodeName': {}}}}}
- delete_all_busy_box_deployments()
Deletes all BusyBox deployments from cluster.
- delete_busybox(depl_name: str, force: bool = False)
Deletes the BusyBox deployment from cluster.
- Parameters:
force (bool, optional) – If True, force deletion even if the deployment is not found. Defaults to False.
depl_name (str) – Name of the deployment to be deleted. Defaults to None.
- Returns:
- The deletion result if the BusyBox deployment exists and is successfully deleted.
Returns None otherwise.
- Return type:
dict
- deploy_busybox(node: str | None = None, namespace='openshift-storage', depl_name='busybox-ui-test', pvc_name: str | None = None) tuple
Deploys a busybox container to a randomly selected worker node.
node (str): Name of the node where the busybox container is to be deployed. If not specified, a random worker node is selected. namespace (str): Namespace where the busybox container is to be deployed. depl_name (str): Name of the deployment to be created. Defaults to None. pvc_name (str): Name of the PVC to be attached by the busybox container. Defaults to None.
- Returns:
The name of the node where the busybox container is deployed, and a deployment name if deployed, otherwise None.
- Return type:
tuple
- deployment_list = []
- file_stream = <_io.TextIOWrapper name='/home/docs/checkouts/readthedocs.org/user_builds/ocs-ci/checkouts/latest/ocs_ci/templates/ocp-deployment/busybox.yaml' mode='r' encoding='UTF-8'>
- get_busybox_depl_name()
Retrieves the name of the BusyBox deployment.
- Returns:
Name of the BusyBox deployment.
- Return type:
str
- set_busybox_depl_name(name)
Sets the name of the BusyBox deployment in the original YAML.
- Parameters:
name (str) – New name for the BusyBox deployment.
- wait_busy_box_scaled_up(timeout: int, depl_name: str, namespace: str) bool
Waits for the ‘busybox’ deployment to be scaled up within the specified timeout.
- Parameters:
timeout (int) – The maximum time to wait for the deployment to be scaled up, in seconds.
depl_name (str) – Name of the deployment to be scaled up.
namespace (str) – Namespace where the deployment is located.
- Returns:
True if the deployment is successfully scaled up within the timeout, False otherwise.
- Return type:
bool
- ocs_ci.ocs.ui.workload_ui.compare_mem_usage(mem_float: float, mem_str: str, deviation_accepted: int = 10) bool
Compare memory usage in bytes and in string format :param mem_float: memory in float format :param mem_str: memory in string format such as “1.5 GiB” or “1.5 GB” :param deviation_accepted: deviation accepted in percentage
- Returns:
True if the deviation is within the acceptable range, False otherwise
- ocs_ci.ocs.ui.workload_ui.divide_capacity(total, num)
Get n random numbers that sum up to a total. For example: 10 = 3 + 4 + 3
- Parameters:
total – number to divide
num – number of parts
- Returns:
list of numbers
- ocs_ci.ocs.ui.workload_ui.fill_attached_pv(data_struct: PvcCapacityDeployment, pod: Pod) bool
Fill the attached PV with data until it is full or disc quota is exceeded. A PvcCapacityDeployment object will be updated with capacity of copied data if the disc quota is exceeded.
- Parameters:
data_struct – a PvcCapacityDeployment object consisting of a PVC and a capacity and a Deployment
pod – a Pod object to fill the PV attached to it
- Returns:
True if the PV is filled, False otherwise