예제 #1
0
def test_sdn_port_net_prov(provider, appliance):
    """ Test functionality of quadicon and detail network providers

    Metadata:
        test_flag: sdn

    Polarion:
        assignee: mmojzis
        initialEstimate: 1/4h
    """
    prov_collection = NetworkProviderCollection(appliance)

    for net_provider in prov_collection.all():
        for port in net_provider.ports.all():
            try:
                view = navigate_to(port, 'Details')
                prov_name = view.entities.relationships.get_text_of(
                    'Network Manager')
                assert prov_name == net_provider.name
            except (ManyEntitiesFound, ItemNotFound):  # BZ
                pass
            except NameError:  # does not contain this information in ui, BZ
                pass

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
예제 #2
0
def test_sdn_crud(provider, appliance):
    """ Test for functional addition of network manager with cloud provider
        and functional references to components on detail page
    Prerequisites: Cloud provider in cfme
    """

    view = navigate_to(provider, 'Details')
    net_prov_name = view.contents.relationships.get_text_of("Network Manager")
    collection = NetworkProviderCollection(appliance)
    network_provider = collection.instantiate(name=net_prov_name)

    view = navigate_to(network_provider, 'Details')
    parent_name = view.entities.relationships.get_text_of(
        "Parent Cloud Provider")

    assert parent_name == provider.name

    testing_list = [
        "Cloud Networks", "Cloud Subnets", "Network Routers",
        "Security Groups", "Floating IPs", "Network Ports", "Load Balancers"
    ]
    for testing_name in testing_list:
        view = navigate_to(network_provider, 'Details')
        view.entities.relationships.click_at(testing_name)

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()

    assert not network_provider.exists
예제 #3
0
def test_sdn_crud(provider, appliance):
    """ Test for functional addition of network manager with cloud provider
        and functional references to components on detail page
    Prerequisites: Cloud provider in cfme
    """

    view = navigate_to(provider, 'Details')
    net_prov_name = view.entities.relationships.get_text_of("Network Manager")
    collection = NetworkProviderCollection(appliance)
    network_provider = collection.instantiate(name=net_prov_name)

    view = navigate_to(network_provider, 'Details')
    parent_name = view.entities.relationships.get_text_of("Parent Cloud Provider")

    assert parent_name == provider.name

    testing_list = ["Cloud Networks", "Cloud Subnets", "Network Routers",
                    "Security Groups", "Floating IPs", "Network Ports", "Load Balancers"]
    for testing_name in testing_list:
        view = navigate_to(network_provider, 'Details')
        view.entities.relationships.click_at(testing_name)

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()

    assert not network_provider.exists
예제 #4
0
def test_sdn_port_net_prov(provider, appliance):
    """ Test functionality of quadicon and detail network providers

    Metadata:
        test_flag: sdn

    Polarion:
        assignee: mmojzis
        casecomponent: WebUI
        initialEstimate: 1/4h
    """
    prov_collection = NetworkProviderCollection(appliance)

    for net_provider in prov_collection.all():
        for port in net_provider.ports.all():
            try:
                view = navigate_to(port, 'Details')
                prov_name = view.entities.relationships.get_text_of('Network Manager')
                assert prov_name == net_provider.name
            except (ManyEntitiesFound, ItemNotFound):  # BZ
                pass
            except NameError:  # does not contain this information in ui, BZ
                pass

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
예제 #5
0
def test_balances_detail(provider):
    """ Test of getting attribute from balancer object """
    collection = NetworkProviderCollection()
    providers = collection.all()
    for prov in providers:
        for balancer in prov.balancers.all():
            check = balancer.health_checks
            assert check is not None

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
예제 #6
0
def test_provider_topology_navigation(provider, appliance):
    view = navigate_to(provider, 'Details')
    net_prov_name = view.entities.summary("Relationships").get_text_of("Network Manager")

    collection = NetworkProviderCollection(appliance)
    network_provider = collection.instantiate(name=net_prov_name)

    navigate_to(network_provider, "TopologyFromDetails")

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
예제 #7
0
def test_sdn_provider_relationships_navigation(provider, tested_part, appliance):
    view = navigate_to(provider, 'Details')
    net_prov_name = view.entities.summary("Relationships").get_text_of("Network Manager")

    collection = NetworkProviderCollection(appliance)
    network_provider = collection.instantiate(name=net_prov_name)

    view = navigate_to(network_provider, 'Details')
    value = view.entities.relationships.get_text_of(tested_part)
    if value != "0":
        navigate_to(network_provider, tested_part.replace(' ', ''))
예제 #8
0
def test_provider_topology_navigation(provider):
    view = navigate_to(provider, 'Details')
    net_prov_name = view.contents.relationships.get_text_of('Network Manager')

    collection = NetworkProviderCollection()
    network_provider = collection.instantiate(name=net_prov_name)

    navigate_to(network_provider, "TopologyFromDetails")

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
예제 #9
0
def test_provider_relationships_navigation(provider, tested_part):
    view = navigate_to(provider, 'Details')
    net_prov_name = view.contents.relationships.get_text_of('Network Manager')

    collection = NetworkProviderCollection()
    network_provider = collection.instantiate(name=net_prov_name)

    view = navigate_to(network_provider, 'Details')
    value = view.entities.relationships.get_text_of(tested_part)
    if value != "0":
        navigate_to(network_provider, tested_part.replace(' ', ''))
def test_balances_detail(provider, appliance):
    """ Test of getting attribute from balancer object """
    collection = NetworkProviderCollection(appliance)
    providers = collection.all()
    for prov in providers:
        for balancer in prov.balancers.all():
            check = balancer.health_checks
            assert check is not None

    provider.delete_if_exists(cancel=False)
    provider.wait_for_delete()
def test_prov_balances_number(provider, appliance):
    """
    Test number of balancers on 1 provider
    Prerequisites:
        Only one refreshed cloud provider in cfme database
    """
    prov_collection = NetworkProviderCollection(appliance)
    providers = prov_collection.all()
    for prov in providers:
        view = navigate_to(prov, 'Details')
        balancers_number = view.entities.relationships.get_text_of('Load Balancers')
        sum_all = len(prov.balancers.all())
        assert int(balancers_number) == sum_all
예제 #12
0
 def network_provider(self):
     """ Returns network provider """
     from cfme.networks.provider import NetworkProviderCollection
     # security group collection contains reference to provider
     if self.collection.parent:
         return self.collection.parent
     # otherwise get provider name from ui
     view = navigate_to(self, 'Details')
     try:
         prov_name = view.entities.relationships.get_text_of("Network Manager")
         collection = NetworkProviderCollection(appliance=self.appliance)
         return collection.instantiate(name=prov_name)
     except ItemNotFound:  # BZ 1480577
         return None