def gen_undeploy_events(provider):
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = gen_deploy_events(provider)
    check_deployment_appears(provider, server, runtime_name)
    undeploy(provider, server, runtime_name)
    check_deployment_not_listed(provider, server, runtime_name)
    return runtime_name
def test_disable_enable(provider, archive_name):
    """Tests Starting of stopped archive into EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Deploys some deployment archive into server.
        * Select that deployment from deployments list.
        * Performs "Disable" toolbar operation on it.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently disabled archive's status is Disabled.
        * Selects that archive from the list to load details.
        * Verifies that properties of deplyment's summary page and the status is Disabled.
        * Performs "Enable" toolbar operation on it.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently enabled archive's status is Enabled.
        * Selects that archive from the list to load details.
        * Verifies that properties of deplyment's summary page and the status is Enabled.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, archive_name)
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.disable()
    check_deployment_disabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.validate_properties()
    deployment.enable()
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.validate_properties()
def test_hawkular_fail(provider):
    """Tests Hawkular server itself reload operation message on UI

    Steps:
        * Chooses Hawkular server.
        * Invokes all 'Power' toolbar operation
        * Checks that notification message is shown
        * Checks that server status is running in UI, in DB and in MGMT.
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    server.reload_server()
    flash.assert_success_message('Not reloading the provider')
    check_server_running(server)
    server.stop_server()
    flash.assert_success_message('Not stopping the provider')
    check_server_running(server)
    server.shutdown_server()
    flash.assert_success_message('Not shutting down the provider')
    check_server_running(server)
    server.restart_server()
    flash.assert_success_message('Not restarting the provider')
    check_server_running(server)
    server.suspend_server()
    flash.assert_success_message('Not suspending the provider')
    check_server_running(server)
    server.resume_server()
    flash.assert_success_message('Not resuming the provider')
    check_server_running(server)
def test_disable_upgrade_enable(provider):
    """Tests Starting of stopped archive into EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Deploys some deployment archive into server.
        * Disable that archive.
        * Verified the recently disabled archive's status is Disabled.
        * Deploys newer version of the same deployment archive into server as Disabled.
        * Enables that archive.
        * Verified the recently enabled archive's status is Enabled.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, RESOURCE_WAR_NAME)
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.disable()
    check_deployment_disabled(provider, server, runtime_name)
    deploy(provider, server, RESOURCE_WAR_NAME_NEW,
        runtime_name=runtime_name, enabled=False)
    check_deployment_disabled(provider, server, runtime_name)
    deployment.enable()
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.validate_properties()
def test_create_delete_datasource(provider, datasource_params):
    """Tests datasource creation and deletion on EAP server
    Method is executed for all database types

    Steps:
        * Allocates Database via DBAllocator tool.
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add Datasource' toolbar operation
        * Selects Datasource type.
        * Click Next.
        * Input Datasource Name.
        * Input Datasource JNDI Name.
        * Click Next.
        * Input Driver Name.
        * Input Module Name.
        * Input Driver Name.
        * Input Driver Class.
        * Click Next.
        * Input Database Connection URL.
        * Input Database username.
        * Input Database password.
        * Submits the form.
        * Checks if newly created datasource is listed. Selects it.
        * Deletes that Datasource via UI operation.
        * Checks whether resource is deleted.
        * Deallocated allocated Database in DBAllocator tool.
    """
    with db_allocate(datasource_params[9]) as db_metadata:
        server = get_server(provider, EAP_PRODUCT_NAME)
        server.add_datasource(datasource_params[0], datasource_params[1], datasource_params[2],
                    datasource_params[3], datasource_params[4], datasource_params[5],
                    db_metadata[DS_URL_PROP].replace("\\", ""),
                    db_metadata[DS_USERNAME_PROP],
                    db_metadata[DS_PASSWORD_PROP])
def gen_ds_creation_events(provider, datasource_params):
    server = get_server(provider, EAP_PRODUCT_NAME)
    ds_name = generate_ds_name(datasource_params[1])
    jndi_name = generate_ds_name(datasource_params[2])
    server.add_datasource(datasource_params[0], ds_name, jndi_name,
                          datasource_params[3], datasource_params[4], datasource_params[5],
                          datasource_params[6], datasource_params[7], datasource_params[8])
    return ds_name
def gen_deploy_fail_events(provider):
    server = get_server(provider, EAP_PRODUCT_NAME)
    file_path = get_resource_path(RESOURCE_WAR_NAME)
    runtime_name = generate_runtime_name(file_path)
    deploy_archive(provider, server, file_path, runtime_name)
    check_deployment_appears(provider, server, runtime_name)
    with error.expected('Deployment "{}" already exists on this server.'
                     .format(runtime_name)):
            deploy_archive(provider, server, file_path, runtime_name)
    check_deployment_appears(provider, server, runtime_name)
    return runtime_name
def test_list_server_deployments(provider):
    """Tests deployments list for Hawkular Local server

    Steps:
        * Get Hawkular Local server
        * Get deployments list from UI of server
        * Get deployments list from Database of server
        * Compares both lists [UI, Database]
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(server=server))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(server=server))
    assert ui_deps == db_deps, "Lists of deployments mismatch! UI:{}, DB:{}".format(ui_deps, db_deps)
def test_list_server_datasources(provider):
    """Gets servers list and tests datasources list for each server
    Steps:
        * Get Hawkular Local server
        * Get datasources list from UI of server
        * Get datasources list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_dses = get_datasources_set(MiddlewareDatasource.datasources(server=server))
    db_dses = get_datasources_set(MiddlewareDatasource.datasources_in_db(server=server))
    assert ui_dses == db_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}".format(ui_dses, db_dses))
def test_list_server_messagings(provider):
    """Gets servers list and tests messagings list for each server
    Steps:
        * Get Local server from UI of provider
        * Get messagings list from UI of server
        * Get messagings list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_msges = _get_messagings_set(MiddlewareMessaging.messagings(server=server))
    db_msges = _get_messagings_set(MiddlewareMessaging.messagings_in_db(server=server))
    assert ui_msges == db_msges, \
        ("Lists of messagings mismatch! UI:{}, DB:{}".format(ui_msges, db_msges))
def test_deployment(provider):
    """Tests deployment details on UI

    Steps:
        * Get deployments list from UI
        * Select up to `ITEMS_LIMIT` deployments randomly
        * Compare selected deployment details with CFME database
    """
    ui_deps = MiddlewareDeployment.deployments(provider=provider, server=get_server(provider, HAWKULAR_PRODUCT_NAME))
    assert len(ui_deps) > 0, "There is no deployment(s) available in UI"
    for dep_ui in get_random_list(ui_deps, ITEMS_LIMIT):
        dep_db = dep_ui.deployment(method="db")
        assert dep_ui.name == dep_db.name, "deployment name does not match between UI and DB"
        assert dep_ui.server.name == dep_db.server.name, "deployment server name does not match between UI and DB"
        dep_ui.validate_properties()
def test_undeploy(provider, archive_name):
    """Tests Undeployment of archive from EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Deploys some deployment archive into server.
        * Select that deployment from deployments list.
        * Performs "Undeploy" toolbar operation on it.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently undeployed archive is not listed anymore.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, archive_name)
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.undeploy()
    check_deployment_not_listed(provider, server, runtime_name)
def test_deploy(provider, archive_name):
    """Tests Deployment of provided archive into EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add Deployment' toolbar operation
        * Selects "war" file to upload.
        * Chose random Runtime Name.
        * Checks that notification message is shown.
        * Refreshes the provider.
        * Verifies that deployment is shown in list and is Enabled.
        * Selects deployment to show the details.
        * Verified details properties.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, archive_name)
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.validate_properties()
def test_list_provider_deployments(provider):
    """Tests deployments list from current Provider between UI, DB and Management system

    Steps:
        * Get deployments list from UI of provider
        * Get deployments list from Database for Hawkular Local server
        * Get deployments list from Management system(Hawkular) for Hawkular Local server
        * Verifies that UI list contains all DB entities
        * Verifies that UI list contains all MGMT entities
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(provider=provider))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(provider=provider, server=server))
    mgmt_deps = get_deployments_set(MiddlewareDeployment.deployments_in_mgmt(provider=provider, server=server))
    assert ui_deps >= db_deps, "Lists of deployments in UI does not contain the list in DB! UI:{}, DB:{}".format(
        ui_deps, db_deps
    )
    assert ui_deps >= mgmt_deps, "Lists of deployments in MGMT does not contain the list in DB! UI:{}, MGMT:{}".format(
        ui_deps, mgmt_deps
    )
def test_redeploy_enable_disabled(provider):
    """Tests Redeployment and enabling of already deployed and disabled archive into EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Deploys some deployment archive into server as Disabled.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently deployed archive's status is Disabled.
        * Deploys newer version of the same deployment archive into server as Enabled.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently deployed archive's status is Enabled.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, RESOURCE_WAR_NAME, enabled=False)
    check_deployment_disabled(provider, server, runtime_name)
    deploy(provider, server, RESOURCE_WAR_NAME_NEW, runtime_name=runtime_name)
    check_deployment_enabled(provider, server, runtime_name)
def test_list_provider_server_deployments(provider):
    """Tests deployments list from current Provider for each server
    between UI, DB and Management system

    Steps:
        * Get Local server from UI of provider
        * Get deployments list for the server
        * Get deployments list from UI of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(provider=provider, server=server))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(provider=provider, server=server))
    mgmt_deps = get_deployments_set(MiddlewareDeployment.deployments_in_mgmt(provider=provider, server=server))
    assert ui_deps == db_deps == mgmt_deps, "Lists of deployments mismatch! UI:{}, DB:{}, MGMT:{}".format(
        ui_deps, db_deps, mgmt_deps
    )
def test_restart(provider, archive_name):
    """Tests Restart of archive from EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Deploys some deployment archive into server.
        * Select that deployment from deployments list.
        * Performs "Restart" toolbar operation on it.
        * Refreshes the provider.
        * Lists all deployments on EAP server.
        * Verified the recently restarted archive is listed and is Enabled.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    runtime_name = deploy(provider, server, archive_name)
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.restart()
    check_deployment_enabled(provider, server, runtime_name)
    deployment = get_deployment_from_list(provider, server, runtime_name)
    deployment.validate_properties()
def test_deploy_driver(provider, database_params):
    """Tests Deployment of provided JDBC Driver into EAP7 server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add JDBC Driver' toolbar operation
        * Selects JDBC driver file to upload.
        * Input Driver Name.
        * Input Module Name.
        * Input Driver Name.
        * Input Driver Class.
        * Input Major Version.
        * Input Minor Version.
        * Submits the form.
        * Checks that notification message is shown.
    """
    server = get_server(provider, EAP_PRODUCT_NAME)
    file_path = download_jdbc_driver(database_params[0])
    deploy_jdbc_driver(provider, server, file_path, driver_name=database_params[1],
                       module_name=database_params[2], driver_class=database_params[3],
                       major_version=database_params[4], minor_version=database_params[5])
def server(provider):
    server = get_server(provider, EAP_PRODUCT_NAME)
    yield server
    server.restart_server()
Esempio n. 20
0
def gen_deploy_events(provider):
    server = get_server(provider, EAP_PRODUCT_NAME)
    file_path = get_resource_path(RESOURCE_WAR_NAME)
    runtime_name = generate_runtime_name(file_path)
    deploy_archive(provider, server, file_path, runtime_name)
    return