def test_manageiq_ansible_add_provider(ansible_providers, provider): """This test checks adding a Containers Provider using Ansible script via Manage IQ module Steps: 1. 'add_provider.yaml script runs against the appliance and adds a new provider 2. Test navigates to Containers Providers page and verifies the provider was added """ setup_ansible_script(provider, script_type='providers', script='add_provider') run_ansible('add_provider') assert get_yml_value('add_provider', 'name') in provider.summary.properties.name.value
def test_manageiq_ansible_add_provider(ansible_providers, provider): """This test checks adding a Containers Provider using Ansible script via Manage IQ module Steps: 1. 'add_provider.yaml script runs against the appliance and adds a new provider 2. Test navigates to Containers Providers page and verifies the provider was added """ script_name = 'add_provider' setup_ansible_script(provider, script_type='providers', script=script_name) run_ansible(script_name) view = navigate_to(ContainersProvider, 'All', use_resetter=True) assert get_yml_value(script_name, 'name') in view.entities.entity_names
def test_manageiq_ansible_update_provider(ansible_providers, provider): """This test checks updating a Containers Provider using Ansible script via Manage IQ module Steps: 1. 'update_provider.yaml script runs against the appliance and updates the previously added provider 2. Test navigates to Containers Providers page and verifies the provider was updated """ setup_ansible_script(provider, script_type='providers', values_to_update=providers_values_to_update, script='update_provider') run_ansible('update_provider') assert get_yml_value('update_provider', 'provider_api_hostname') in \ provider.summary.properties.host_name.value
def test_manageiq_ansible_remove_non_existing_provider(ansible_providers, provider): """This test checks removing a non-existing Containers Provider using Ansible script via Manage IQ module Steps: 1. 'remove_provider.yaml script runs against the appliance and removes the provider 2. Test navigates to Containers Providers page and verifies no provider was removed """ # Add provider script is added to verify against it in the end setup_ansible_script(provider, script_type='providers', script='add_provider') setup_ansible_script(provider, script_type='providers', script='remove_non_existing_provider') run_ansible('remove_non_existing_provider') assert get_yml_value('add_provider', 'name') in provider.summary.properties.name.value
def test_manageiq_ansible_add_provider_incorrect_user(ansible_providers, provider, soft_assert): """This test checks adding a Containers Provider with a wrong user using Ansible script via Manage IQ module Steps: 1. 'add_provider_bad_user.yaml script runs against the appliance and tries to add a new provider with a wrong user. 2. Test navigates to Containers Providers page and verifies the provider was not added. """ script_name = 'add_provider_bad_user' setup_ansible_script(provider, script_type='providers', script=script_name) run_status = run_ansible(script_name) assert 'Authentication failed' in run_status view = navigate_to(ContainersProvider, 'All', use_resetter=True) assert not get_yml_value(script_name, 'name') in view.entities.entity_names
def test_manageiq_ansible_update_provider_incorrect_user(ansible_providers, provider): """This test checks updating a Containers Provider with a wrong user using Ansible script via Manage IQ module Steps: 1. 'add_provider_bad_user.yaml script runs against the appliance and tries to add a new provider with a wrong user. 2. Test navigates to Containers Providers page and verifies the provider was not updated. """ # Add provider script is added to verify against it in the end setup_ansible_script(provider, script_type='providers', script='add_provider') setup_ansible_script(provider, script_type='providers', values_to_update=providers_values_to_update, script='update_provider_bad_user') run_status = run_ansible('update_provider_bad_user') assert 'Authentication failed' in run_status assert get_yml_value('add_provider', 'name') in provider.summary.properties.name.value
def test_manageiq_ansible_remove_non_existing_provider(ansible_providers, provider): """This test checks removing a non-existing Containers Provider using Ansible script via Manage IQ module Steps: 1. 'remove_provider.yaml script runs against the appliance and removes the provider 2. Test navigates to Containers Providers page and verifies no provider was removed """ # Add provider script is added to verify against it in the end script_name = 'remove_non_existing_provider' setup_ansible_script(provider, script_type='providers', script='add_provider') setup_ansible_script(provider, script_type='providers', script=script_name) run_ansible(script_name) view = navigate_to(ContainersProvider, 'All', use_resetter=True) assert get_yml_value('add_provider', 'name') in view.entities.entity_names
def test_manageiq_ansible_remove_provider(ansible_providers, provider, soft_assert): """This test checks removing a Containers Provider using Ansible script via Manage IQ module Steps: 1. 'remove_provider.yaml script runs against the appliance and removes the provider 2. Test navigates to Containers Providers page and verifies the provider was removed """ script_name = 'remove_provider' setup_ansible_script(provider, script_type='providers', script=script_name) run_ansible(script_name) view = navigate_to(ContainersProvider, 'All', use_resetter=True) soft_assert( wait_for(lambda: not get_yml_value(script_name, 'name') in view. entities.entity_names, num_sec=180, delay=10, fail_func=view.browser.refresh, message='Provider was not deleted successfully', silent_failure=True))
def test_manageiq_ansible_update_provider(ansible_providers, provider, soft_assert): """This test checks updating a Containers Provider using Ansible script via Manage IQ module Steps: 1. 'update_provider.yaml script runs against the appliance and updates the previously added provider 2. Test navigates to Containers Providers page and verifies the provider was updated """ script_name = 'update_provider' setup_ansible_script(provider, script_type='providers', values_to_update=providers_values_to_update, script=script_name) run_ansible(script_name) soft_assert( wait_for(lambda: get_yml_value(script_name, 'provider_api_hostname') in provider.summary.properties.host_name.text_value, num_sec=180, delay=10, fail_func=provider.browser.refresh, message='Provider was not updated successfully', silent_failure=True))
def test_manageiq_ansible_update_provider_incorrect_user( ansible_providers, provider): """This test checks updating a Containers Provider with a wrong user using Ansible script via Manage IQ module Steps: 1. 'add_provider_bad_user.yaml script runs against the appliance and tries to add a new provider with a wrong user. 2. Test navigates to Containers Providers page and verifies the provider was not updated. """ # Add provider script is added to verify against it in the end setup_ansible_script(provider, script_type='providers', script='add_provider') setup_ansible_script(provider, script_type='providers', values_to_update=providers_values_to_update, script='update_provider_bad_user') run_status = run_ansible('update_provider_bad_user') assert 'Authentication failed' in run_status assert get_yml_value('add_provider', 'name') in provider.summary.properties.name.value