def test_discover_infra(providers_for_discover, start_ip, max_range):
    rhevm = False
    scvmm = False
    virtualcenter = False

    for i in providers_for_discover:
        if type(i) == RHEVMProvider:
            rhevm = True
        if type(i) == SCVMMProvider:
            scvmm = True
        if type(i) == VMwareProvider:
            virtualcenter = True

    discover(rhevm, virtualcenter, scvmm, False, start_ip, max_range)

    @wait_for_decorator(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            # When the provider is discovered, its name won't match what would be expected from
            # the crud objects generated from yaml data. The name in CFME will contain an IP
            # which should uniquely identify the resource
            if [
                    name for name in provider.appliance.managed_provider_names
                    if provider.ip_address in name
            ]:
                # provider IP matched an appliance provider
                continue
            else:
                return False
        else:
            # all provider IPs found in the provider names
            return True
Пример #2
0
def test_discover_infra(providers_for_discover, start_ip, max_range):
    rhevm = False
    scvmm = False
    virtualcenter = False

    for i in providers_for_discover:
        if type(i) == RHEVMProvider:
                rhevm = True
        if type(i) == SCVMMProvider:
                scvmm = True
        if type(i) == VMwareProvider:
                virtualcenter = True

    discover(rhevm, virtualcenter, scvmm, False, start_ip, max_range)

    @pytest.wait_for(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            # When the provider is discovered, its name won't match what would be expected from
            # the crud objects generated from yaml data. The name in CFME will contain an IP
            # which should uniquely identify the resource
            if [name for name in provider.appliance.managed_provider_names
                    if provider.ip_address in name]:
                # provider IP matched an appliance provider
                continue
            else:
                return False
        else:
            # all provider IPs found in the provider names
            return True
def test_discover_infra(providers_for_discover, start_ip, max_range):
    for provider in providers_for_discover:
        discover(provider, False, start_ip, max_range)

    @wait_for_decorator(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            # When the provider is discovered, its name won't match what would be expected from
            # the crud objects generated from yaml data. The name in CFME will contain an IP
            # which should uniquely identify the resource
            if [name for name in provider.appliance.managed_provider_names
                    if provider.ip_address in name]:
                # provider IP matched an appliance provider
                continue
            else:
                return False
        else:
            # all provider IPs found in the provider names
            return True
Пример #4
0
def test_discover_infra(providers_for_discover, start_ip, max_range):
    for provider in providers_for_discover:
        discover(provider, False, start_ip, max_range)

    @wait_for_decorator(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            provider.browser.refresh()
            # When the provider is discovered, its name won't match what would be expected from
            # the crud objects generated from yaml data. The name in CFME will contain an IP
            # which should uniquely identify the resource
            if [
                    name for name in provider.appliance.managed_provider_names
                    if provider.ip_address in name
            ]:
                # provider IP matched an appliance provider
                continue
            else:
                return False
        else:
            # all provider IPs found in the provider names
            return True
Пример #5
0
def test_discover_infra(providers_for_discover, start_ip, max_range):
    rhevm = False
    scvmm = False
    virtualcenter = False

    for i in providers_for_discover:
        if type(i) == RHEVMProvider:
                rhevm = True
        if type(i) == SCVMMProvider:
                scvmm = True
        if type(i) == VMwareProvider:
                virtualcenter = True

    discover(rhevm, virtualcenter, scvmm, False, start_ip, max_range)

    @pytest.wait_for(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            if provider.key not in pytest.store.current_appliance.managed_providers:
                return False
        if len(pytest.store.current_appliance.managed_providers) != len(providers_for_discover):
            return False
        return True
Пример #6
0
def test_discover_infra(providers_for_discover, start_ip, max_range):
    rhevm = False
    scvmm = False
    virtualcenter = False

    for i in providers_for_discover:
        if type(i) == RHEVMProvider:
            rhevm = True
        if type(i) == SCVMMProvider:
            scvmm = True
        if type(i) == VMwareProvider:
            virtualcenter = True

    discover(rhevm, virtualcenter, scvmm, False, start_ip, max_range)

    @pytest.wait_for(num_sec=count_timeout(start_ip, max_range), delay=5)
    def _wait_for_all_providers():
        for provider in providers_for_discover:
            if provider.key not in pytest.store.current_appliance.managed_providers:
                return False
        if len(pytest.store.current_appliance.managed_providers) != len(
                providers_for_discover):
            return False
        return True
Пример #7
0
def test_discovery_cancelled_validation():
    """ Tests that the flash message is correct when discovery is cancelled."""
    discover(None, cancel=True)
    flash.assert_message_match('Infrastructure Providers Discovery was cancelled by the user')
Пример #8
0
def test_empty_discovery_form_validation():
    """ Tests that the flash message is correct when discovery form is empty."""
    discover(None)
    flash.assert_message_match('At least 1 item must be selected for discovery')
def test_discovery_cancelled_validation_infra(appliance):
    """ Tests that the flash message is correct when discovery is cancelled."""
    discover(None, cancel=True)
    view = appliance.browser.create_view(InfraProvidersView)
    view.flash.assert_success_message('Infrastructure Providers '
                                      'Discovery was cancelled by the user')
def test_empty_discovery_form_validation_infra(appliance):
    """ Tests that the flash message is correct when discovery form is empty."""
    discover(None)
    view = appliance.browser.create_view(InfraProvidersDiscoverView)
    view.flash.assert_message('At least 1 item must be selected for discovery')
Пример #11
0
def test_discovery_cancelled_validation():
    """ Tests that the flash message is correct when discovery is cancelled."""
    discover(None, cancel=True)
    flash.assert_message_match(
        'Infrastructure Providers Discovery was cancelled by the user')
Пример #12
0
def test_empty_discovery_form_validation():
    """ Tests that the flash message is correct when discovery form is empty."""
    discover(None)
    flash.assert_message_match(
        'At least 1 item must be selected for discovery')
Пример #13
0
def test_discovery_cancelled_validation_infra(appliance):
    """ Tests that the flash message is correct when discovery is cancelled."""
    discover(None, cancel=True)
    view = appliance.browser.create_view(InfraProvidersView)
    view.flash.assert_success_message('Infrastructure Providers '
                                      'Discovery was cancelled by the user')
Пример #14
0
def test_empty_discovery_form_validation_infra(appliance):
    """ Tests that the flash message is correct when discovery form is empty."""
    discover(None)
    view = appliance.browser.create_view(InfraProvidersDiscoverView)
    view.flash.assert_message('At least 1 item must be selected for discovery')
Пример #15
0
def test_that_checks_flash_when_discovery_cancelled():
    """ Tests that the flash message is correct when discovery is cancelled."""
    provider.discover(None, cancel=True)
    flash.assert_message_match('Infrastructure Providers Discovery was cancelled by the user')
Пример #16
0
def test_that_checks_flash_with_empty_discovery_form():
    """ Tests that the flash message is correct when discovery form is empty."""
    provider.discover(None)
    flash.assert_message_match('At least 1 item must be selected for discovery')