Example #1
0
def assign_compute_custom_rate(new_compute_rate, provider):
    # Assign custom Compute rate to the Enterprise and then queue the Chargeback report.
    description = new_compute_rate
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": description})
    enterprise.computeassign()
    logger.info('ASSIGNING CUSTOM COMPUTE RATE')

    yield

    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "Default"})
    enterprise.computeassign()
def assign_compute_custom_rate(new_chargeback_fixed_rate, provider):
    # Assign custom Compute rate to the Selected Containers Provider
    asignment = cb.Assign(
        assign_to="Selected Containers Providers",
        selections={provider.name: new_chargeback_fixed_rate.description})
    asignment.computeassign()
    logger.info('ASSIGNING CUSTOM COMPUTE RATE')

    yield new_chargeback_fixed_rate.description

    asignment = cb.Assign(assign_to="Selected Containers Providers",
                          selections={provider.name: "Default"})
    asignment.computeassign()
def assign_compute_custom_rate(new_chargeback_fixed_rate, provider):
    # Assign custom Compute rate to the Selected Containers Provider
    asignment = cb.Assign(
        assign_to="Labeled Container Images",
        docker_labels="Architecture",
        selections={'x86_64': new_chargeback_fixed_rate.description})
    asignment.computeassign()
    logger.info('ASSIGNING COMPUTE RATE FOR LABELED CONTAINER IMAGES')

    yield new_chargeback_fixed_rate.description

    asignment = cb.Assign(assign_to="Selected Containers Providers",
                          selections={provider.name: "Default"})
    asignment.computeassign()
Example #4
0
def assign_default_rate(provider):
    # Assign default Compute rate to the Enterprise and then queue the Chargeback report.
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "Default"})
    enterprise.computeassign()
    enterprise.storageassign()
    logger.info('Assigning DEFAULT Compute rate')

    yield

    # Resetting the Chargeback rate assignment
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "<Nothing>"})
    enterprise.computeassign()
    enterprise.storageassign()
Example #5
0
def assign_custom_rate(new_compute_rate, provider):
    # Assign custom Compute rate to the Enterprise and then queue the Chargeback report.
    description = new_compute_rate
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": description})
    enterprise.computeassign()
    enterprise.storageassign()
    logger.info('Assigning CUSTOM Compute rate')

    yield

    # Resetting the Chargeback rate assignment
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "<Nothing>"})
    enterprise.computeassign()
    enterprise.storageassign()
Example #6
0
def test_assign_storage_enterprise(provider):
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "Default"})

    enterprise.storageassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            "Enterprise").first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
Example #7
0
def test_assign_compute_taggedvm(provider):
    tagged_vm = cb.Assign(assign_to="Tagged VMs and Instances",
                          tag_category="Location",
                          selections={"Chicago": "Default"})
    tagged_vm.computeassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            "Chicago").first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
Example #8
0
def test_assign_compute_provider(provider):
    compute_provider = cb.Assign(
        assign_to="Selected Cloud/Infrastructure Providers",
        selections={provider.name: "Default"})
    compute_provider.computeassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            provider.name).first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
Example #9
0
def test_assign_compute_enterprise(provider):
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "Default"})
    enterprise.computeassign()

    flash.assert_message_match('Rate Assignments saved')
    # Assert that the selection made is listed on the UI
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            "Enterprise").first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
Example #10
0
def test_assign_storage_tagged_datastores(provider):
    tagged_datastore = cb.Assign(assign_to="Tagged Datastores",
                                 tag_category="Location",
                                 selections={"Chicago": "Default"})
    tagged_datastore.storageassign()

    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            "Chicago").first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
    flash.assert_message_match('Rate Assignments saved')
Example #11
0
def test_assign_storage_datastores(provider):
    datastore = random.choice(provider.get_yaml_data()["datastores"])["name"]

    sel_datastore = cb.Assign(assign_to="Selected Datastores",
                              selections={datastore: "Default"})
    sel_datastore.storageassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(
            datastore).first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
def test_assign_compute_provider(virtualcenter_provider):
    compute_provider = cb.Assign(
        assign_to=version.pick({version.LOWEST: 'Selected Cloud/Infrastructure Providers',
                            '5.7': 'Selected Providers'}),
        selections={
            virtualcenter_provider.name: "Default"
        })
    compute_provider.computeassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(virtualcenter_provider.name).first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
def test_assign_compute_cluster(virtualcenter_provider):
    cluster_name = random.choice(virtualcenter_provider.get_yaml_data()["clusters"])

    cluster = cb.Assign(
        assign_to=version.pick({version.LOWEST: 'Selected Clusters',
                            '5.4': 'Selected Cluster / Deployment Roles'}),
        selections={
            cluster_name: "Default"
        })
    cluster.computeassign()

    flash.assert_message_match('Rate Assignments saved')
    selected_option = sel.text(
        cb.assign_form.selections.select_by_name(cluster_name).first_selected_option)
    assert selected_option == "Default", 'Selection does not match'
Example #14
0
def assign_compute_default_rate(provider):
    # Assign default Compute rate to the Enterprise and then queue the Chargeback report.
    enterprise = cb.Assign(assign_to="The Enterprise",
                           selections={"Enterprise": "Default"})
    enterprise.computeassign()
    logger.info('ASSIGNING DEFAULT COMPUTE RATE')