Ejemplo n.º 1
0
    def test_validation_ui(self, setup_ui):
        """
        Validate User Interface

        Args:
            setup_ui: login function on conftest file

        """
        validation_ui_obj = ValidationUI(setup_ui)
        validation_ui_obj.verification_ui()
Ejemplo n.º 2
0
    def test_odf_storagesystems_ui(self, setup_ui):
        """
        Validate User Interface for ODF Storage Systems Tab for ODF 4.9

        Args:
            setup_ui: login function on conftest file

        """
        validation_ui_obj = ValidationUI(setup_ui)
        validation_ui_obj.odf_storagesystems_ui()
Ejemplo n.º 3
0
    def test_capacity_breakdown_ui(
        self, setup_ui_class, project_name, pod_name, sc_type, teardown_project_factory
    ):
        """
        Test Capacity Breakdown UI

        project_name (str): the project name
        pod_name (str): pod name
        sc_type (str): storage class [fs, block]

        """
        project_obj = helpers.create_project(project_name=project_name)
        teardown_project_factory(project_obj)
        logger.info(
            f"Created new pvc sc_name={sc_type} namespace={project_name}, "
            f"size=6Gi, access_mode={constants.ACCESS_MODE_RWO}"
        )
        pvc_obj = helpers.create_pvc(
            sc_name=sc_type,
            namespace=project_name,
            size="6Gi",
            do_reload=False,
            access_mode=constants.ACCESS_MODE_RWO,
        )
        logger.info(
            f"Create new pod. Pod name={pod_name},"
            f"interface_type={constants.CEPHBLOCKPOOL}"
        )
        pod_obj = helpers.create_pod(
            pvc_name=pvc_obj.name,
            namespace=project_obj.namespace,
            interface_type=constants.CEPHBLOCKPOOL,
            pod_name=pod_name,
        )
        logger.info(f"Wait for pod {pod_name} move to Running state")
        helpers.wait_for_resource_state(
            pod_obj, state=constants.STATUS_RUNNING, timeout=300
        )
        logger.info("Run fio workload")
        pod_obj.run_io(
            storage_type=constants.WORKLOAD_STORAGE_TYPE_FS,
            size="4GB",
        )
        fio_result = pod_obj.get_fio_results()
        logger.info("IOPs after FIO:")
        reads = fio_result.get("jobs")[0].get("read").get("iops")
        writes = fio_result.get("jobs")[0].get("write").get("iops")
        logger.info(f"Read: {reads}")
        logger.info(f"Write: {writes}")

        validation_ui_obj = ValidationUI(setup_ui_class)
        assert validation_ui_obj.check_capacity_breakdown(
            project_name=project_name, pod_name=pod_name
        ), "The Project/Pod not created on Capacity Breakdown"
Ejemplo n.º 4
0
    def test_dashboard_validation_ui(self, setup_ui):
        """
        Validate User Interface

        Args:
            setup_ui: login function on conftest file

        """
        validation_ui_obj = ValidationUI(setup_ui)
        ocs_version = version.get_semantic_ocs_version_from_config()
        if ocs_version >= version.VERSION_4_9:
            validation_ui_obj.odf_overview_ui()
        else:
            validation_ui_obj.verification_ui()
Ejemplo n.º 5
0
def ocs_odf_upgrade_ui():
    """
    Function to upgrade OCS 4.8 to ODF 4.9 via UI on OCP 4.9
    Pass proper versions and upgrade_ui.yaml while running this function for validation to pass

    """

    setup_ui = login_ui()
    val_obj = ValidationUI(setup_ui)
    pagenav_obj = ValidationUI(setup_ui)
    dep_obj = DeploymentUI(setup_ui)
    dep_obj.operator = ODF_OPERATOR
    dep_obj.install_ocs_operator()
    original_ocs_version = config.ENV_DATA.get("ocs_version")
    upgrade_in_current_source = config.UPGRADE.get("upgrade_in_current_source", False)
    upgrade_ocs = OCSUpgrade(
        namespace=config.ENV_DATA["cluster_namespace"],
        version_before_upgrade=original_ocs_version,
        ocs_registry_image=config.UPGRADE.get("upgrade_ocs_registry_image"),
        upgrade_in_current_source=upgrade_in_current_source,
    )
    logger.info(
        "Click on Storage System under Provided APIs on Installed Operators Page"
    )
    val_obj.do_click(
        upgrade_ocs.validation_loc["storage-system-on-installed-operators"]
    )
    logger.info("Click on 'ocs-storagecluster-storagesystem' on Operator details page")
    val_obj.do_click(
        upgrade_ocs.validation_loc["ocs-storagecluster-storgesystem"],
        enable_screenshot=True,
    )
    logger.info("Click on Resources")
    val_obj.do_click(
        upgrade_ocs.validation_loc["resources-tab"], enable_screenshot=True
    )
    logger.info("Storage Cluster Status Check")
    storage_cluster_status_check = val_obj.wait_until_expected_text_is_found(
        locator=("//*[text()= 'Ready']", By.XPATH), expected_text="Ready", timeout=1200
    )
    assert (
        storage_cluster_status_check
    ), "Storage Cluster Status reported on UI is not 'Ready', Timeout 1200 seconds exceeded"
    logger.info(
        "Storage Cluster Status reported on UI is 'Ready', verification successful"
    )
    logger.info("Click on 'ocs-storagecluster")
    val_obj.do_click(upgrade_ocs.validation_loc["ocs-storagecluster"])
    val_obj.take_screenshot()
    pagenav_obj.odf_overview_ui()
    pagenav_obj.odf_storagesystems_ui()