diff --git a/conf/supportability.yaml b/conf/supportability.yaml index 5e6c6680895..4efff78d986 100644 --- a/conf/supportability.yaml +++ b/conf/supportability.yaml @@ -1,4 +1,4 @@ supportability: content_hosts: rhel: - versions: [6, 7,'7_fips', 8, '8_fips', 9, '9_fips'] + versions: [7,'7_fips', 8, '8_fips', 9, '9_fips'] diff --git a/pytest_fixtures/component/http_proxy.py b/pytest_fixtures/component/http_proxy.py index a98e7409699..fcf81c09eff 100644 --- a/pytest_fixtures/component/http_proxy.py +++ b/pytest_fixtures/component/http_proxy.py @@ -29,3 +29,4 @@ def setup_http_proxy(request, module_manifest_org, target_sat): yield http_proxy, request.param target_sat.update_setting('content_default_http_proxy', content_proxy_value) target_sat.update_setting('http_proxy', general_proxy_value) + http_proxy.delete() diff --git a/pytest_fixtures/component/repository.py b/pytest_fixtures/component/repository.py index ce49a1d7f88..b9d302774c3 100644 --- a/pytest_fixtures/component/repository.py +++ b/pytest_fixtures/component/repository.py @@ -131,7 +131,7 @@ class constructor arguments. It can create multiple repos with distro. ] Then the fixtures loop over it to create multiple repositories. - :returns: The tuple of distro of repositories(if given) and simplified repos + :return: The tuple of distro of repositories(if given) and simplified repos """ _repos = [] repo_distro = None diff --git a/requirements-optional.txt b/requirements-optional.txt index 25cfc489cdf..7684169a550 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -5,8 +5,8 @@ redis==5.0.4 pre-commit==3.7.1 # For generating documentation. -sphinx==7.3.6 -sphinx-autoapi==3.0.0 +sphinx==7.3.7 +sphinx-autoapi==3.1.0 # For 'manage' interactive shell manage==0.1.15 diff --git a/requirements.txt b/requirements.txt index 5f2871132b7..8584c25c33c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ navmazing==1.2.2 productmd==1.38 pyotp==2.9.0 python-box==7.1.1 -pytest==8.2.0 +pytest==8.2.1 pytest-order==1.2.1 pytest-services==2.2.1 pytest-mock==3.14.0 @@ -21,7 +21,7 @@ pytest-xdist==3.5.0 pytest-fixturecollection==0.1.2 pytest-ibutsu==2.2.4 PyYAML==6.0.1 -requests==2.31.0 +requests==2.32.2 tenacity==8.3.0 testimony==2.4.0 wait-for==1.2.0 diff --git a/robottelo/cli/base.py b/robottelo/cli/base.py index 2827fdba5e5..c30231a4ea1 100644 --- a/robottelo/cli/base.py +++ b/robottelo/cli/base.py @@ -36,7 +36,7 @@ def _handle_response(cls, response, ignore_stderr=None): :param response: a result object, returned by :mod:`robottelo.utils.ssh.command`. :param ignore_stderr: indicates whether to throw a warning in logs if ``stderr`` is not empty. - :returns: contents of ``stdout``. + :return: contents of ``stdout``. :raises robottelo.exceptions.CLIReturnCodeError: If return code is different from zero. """ diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index f46d4c690f2..5dc08075074 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -153,7 +153,7 @@ 'Norway East', ] AZURERM_RHEL7_FT_IMG_URN = 'marketplace://RedHat:RHEL:7-RAW:latest' -AZURERM_RHEL7_UD_IMG_URN = 'marketplace://RedHat:RHEL:7-RAW-CI:7.6.2019072418' +AZURERM_RHEL7_UD_IMG_URN = 'marketplace://RedHat:rhel-byos:rhel-raw-ci76:7.6.20190814' AZURERM_RHEL7_FT_BYOS_IMG_URN = 'marketplace://RedHat:rhel-byos:rhel-lvm78:7.8.20200410' AZURERM_RHEL7_FT_CUSTOM_IMG_URN = 'custom://imageVM1-RHEL7-image-20220617150105' AZURERM_RHEL7_FT_GALLERY_IMG_URN = 'gallery://RHEL77img' diff --git a/robottelo/host_helpers/api_factory.py b/robottelo/host_helpers/api_factory.py index d0591770888..7488faf1ead 100644 --- a/robottelo/host_helpers/api_factory.py +++ b/robottelo/host_helpers/api_factory.py @@ -168,7 +168,7 @@ def one_to_one_names(self, name): True :param name: A field name. - :returns: A set including both ``name`` and variations on ``name``. + :return: A set including both ``name`` and variations on ``name``. """ return {f'{name}_name', f'{name}_id'} diff --git a/robottelo/host_helpers/repository_mixins.py b/robottelo/host_helpers/repository_mixins.py index d8dbc9b9798..0be8dda7299 100644 --- a/robottelo/host_helpers/repository_mixins.py +++ b/robottelo/host_helpers/repository_mixins.py @@ -588,7 +588,7 @@ def add_item(self, item) -> None: Add repository to collection :param BaseRepository item: Item to add - :returns: None + :return: None """ if self._repos_info: raise RepositoryAlreadyCreated('Repositories already created can not add more') @@ -605,7 +605,7 @@ def add_items(self, items): Add multiple repositories to collection :param List[BaseRepository] items: Items to add - :returns: None + :return: None """ for item in items: self.add_item(item) diff --git a/robottelo/host_helpers/satellite_mixins.py b/robottelo/host_helpers/satellite_mixins.py index 58fe5b5d237..60083dc0b7c 100644 --- a/robottelo/host_helpers/satellite_mixins.py +++ b/robottelo/host_helpers/satellite_mixins.py @@ -142,7 +142,7 @@ def upload_manifest(self, org_id, manifest=None, interface='API', timeout=None): :type interface: str :type timeout: int - :returns: the manifest upload result + :return: the manifest upload result """ if not isinstance(manifest, bytes | io.BytesIO) and ( @@ -176,7 +176,7 @@ def is_sca_mode_enabled(self, org_id): given organization. :param str org_id: The unique identifier of the organization to check for SCA mode. - :returns: A boolean value indicating whether SCA mode is enabled or not. + :return: A boolean value indicating whether SCA mode is enabled or not. :rtype: bool """ return self.api.Organization(id=org_id).read().simple_content_access @@ -187,7 +187,7 @@ def publish_content_view(self, org, repo_list): :param str org: The name of the organization to which the content view belongs :param list or str repo_list: A list of repositories or a single repository - :returns: A dictionary containing the details of the published content view. + :return: A dictionary containing the details of the published content view. """ repo = repo_list if isinstance(repo_list, list) else [repo_list] content_view = self.api.ContentView(organization=org, repository=repo).create() diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 93cc4f62f08..ff81f43f799 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -339,7 +339,7 @@ def os_distro(self): def os_version(self): """Get host's OS version information - :returns: A ``packaging.version.Version`` instance + :return: A ``packaging.version.Version`` instance """ return Version(self._os_release['VERSION_ID']) @@ -472,7 +472,7 @@ def download_file(self, file_url, local_path=None, file_name=None): provided file will be saved in /tmp/ directory. :param str file_name: New name of the Downloaded file else its given from file_url - :returns: Returns list containing complete file path and name of downloaded file. + :return: Returns list containing complete file path and name of downloaded file. """ file_name = PurePath(file_name or file_url).name local_path = PurePath(local_path or '/tmp') / file_name @@ -1497,7 +1497,7 @@ def ping_host(self, host): """Check the provisioned host status by pinging the ip of host :param host: IP address or hostname of the provisioned host - :returns: None + :return: None :raises: : `HostPingFailed` if the host is not pingable """ result = self.execute( diff --git a/robottelo/utils/datafactory.py b/robottelo/utils/datafactory.py index 6f571986a56..8a5677b38df 100644 --- a/robottelo/utils/datafactory.py +++ b/robottelo/utils/datafactory.py @@ -82,7 +82,7 @@ def generate_strings_list(length=None, exclude_types=None, min_length=3, max_len generated list. example: exclude_types=['html', 'cjk'] :param int min_length: Minimum length to be used in integer generator :param int max_length: Maximum length to be used in integer generator - :returns: A list of various string types. + :return: A list of various string types. """ if length is None: diff --git a/robottelo/utils/report_portal/portal.py b/robottelo/utils/report_portal/portal.py index c7e0df5d54e..b3b32cbd7e8 100644 --- a/robottelo/utils/report_portal/portal.py +++ b/robottelo/utils/report_portal/portal.py @@ -43,16 +43,12 @@ def __init__(self, rp_url=None, rp_api_key=None, rp_project=None): @property def api_url(self): - """Super url of report portal - :returns: Base url for API request - """ + """Super url of report portal API.""" return f'{self.rp_url}/api/v1/{self.rp_project}' @property def headers(self): - """The headers for Report Portal Requests. - :returns: header for API request - """ + """The headers for Report Portal Requests.""" return {'Authorization': f'Bearer {self.rp_api_key}'} def get_launches( diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index 71d47b860d2..b637d4328b1 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -470,3 +470,134 @@ def test_positive_ansible_job_on_multiple_host( assert result.succeeded == 2 # SELECTED_ROLE working on rhel8/rhel9 clients assert result.failed == 1 # SELECTED_ROLE failing on rhel7 client assert result.status_label == 'failed' + + @pytest.mark.no_containers + @pytest.mark.rhel_ver_match('[^6]') + def test_positive_ansible_localhost_job_on_host( + self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost + ): + """Test successful execution of Ansible Job with "hosts: localhost" on host. + + :id: c8dcdc54-cb98-4b24-bff9-049a6cc36acd + + :steps: + 1. Register a content host with satellite + 2. Run the Ansible playbook with "hosts: localhost" on registered host + 3. Check if the job is executed and verify job output + + :expectedresults: + 1. Ansible playbook with "hosts: localhost" job execution must be successful. + + :BZ: 1982698 + + :customerscenario: true + """ + playbook = ''' + --- + - name: Simple Ansible Playbook for Localhost + hosts: localhost + gather_facts: no + tasks: + - name: Print a message + debug: + msg: "Hello, localhost!" + ''' + result = rhel_contenthost.register( + module_org, module_location, module_ak_with_synced_repo.name, target_sat + ) + assert result.status == 0, f'Failed to register host: {result.stderr}' + + template_id = ( + target_sat.api.JobTemplate() + .search(query={'search': 'name="Ansible - Run playbook"'})[0] + .id + ) + job = target_sat.api.JobInvocation().run( + synchronous=False, + data={ + 'job_template_id': template_id, + 'targeting_type': 'static_query', + 'search_query': f'name = {rhel_contenthost.hostname}', + 'inputs': {'playbook': playbook}, + }, + ) + target_sat.wait_for_tasks( + f'resource_type = JobInvocation and resource_id = {job["id"]}', poll_timeout=1000 + ) + result = target_sat.api.JobInvocation(id=job['id']).read() + assert result.pending == 0 + assert result.succeeded == 1 + assert result.status_label == 'succeeded' + + result = target_sat.api.JobInvocation(id=job['id']).outputs()['outputs'][0]['output'] + assert [i['output'] for i in result if '"msg": "Hello, localhost!"' in i['output']] + assert [i['output'] for i in result if i['output'] == 'Exit status: 0'] + + @pytest.mark.no_containers + @pytest.mark.rhel_ver_list('8') + def test_negative_ansible_job_timeout_to_kill( + self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost + ): + """when running ansible-playbook, timeout to kill/execution_timeout_interval setting + is honored for registered host + + :id: a082f599-fbf7-4779-aa18-5139e2bce777 + + :steps: + 1. Register a content host with satellite + 2. Run Ansible playbook to pause execution for a while, along with + timeout to kill/execution_timeout_interval setting on the registered host + 3. Verify job is terminated honoring timeout to kill setting and verify job output. + + :expectedresults: Timeout to kill terminates the job if playbook doesn't finish in time + + :BZ: 1931489 + + :customerscenario: true + """ + playbook = ''' + --- + - name: Sample Ansible Playbook to pause + hosts: all + gather_facts: no + tasks: + - name: Pause for 5 minutes + pause: + minutes: 5 + ''' + result = rhel_contenthost.register( + module_org, module_location, module_ak_with_synced_repo.name, target_sat + ) + assert result.status == 0, f'Failed to register host: {result.stderr}' + + template_id = ( + target_sat.api.JobTemplate() + .search(query={'search': 'name="Ansible - Run playbook"'})[0] + .id + ) + # run ansible-playbook with execution_timeout_interval/timeout_to_kill + job = target_sat.api.JobInvocation().run( + synchronous=False, + data={ + 'job_template_id': template_id, + 'targeting_type': 'static_query', + 'search_query': f'name = {rhel_contenthost.hostname}', + 'inputs': {'playbook': playbook}, + 'execution_timeout_interval': '30', + }, + ) + target_sat.wait_for_tasks( + f'resource_type = JobInvocation and resource_id = {job["id"]}', + poll_timeout=1000, + must_succeed=False, + ) + result = target_sat.api.JobInvocation(id=job['id']).read() + assert result.pending == 0 + assert result.failed == 1 + assert result.status_label == 'failed' + + result = target_sat.api.JobInvocation(id=job['id']).outputs()['outputs'][0]['output'] + termination_msg = 'Timeout for execution passed, stopping the job' + assert [i['output'] for i in result if i['output'] == termination_msg] + assert [i['output'] for i in result if i['output'] == 'StandardError: Job execution failed'] + assert [i['output'] for i in result if i['output'] == 'Exit status: 120'] diff --git a/tests/foreman/api/test_notifications.py b/tests/foreman/api/test_notifications.py index 5eeb0e60127..e1561db06f5 100644 --- a/tests/foreman/api/test_notifications.py +++ b/tests/foreman/api/test_notifications.py @@ -156,7 +156,7 @@ def wait_for_no_long_running_task_mail(target_sat, clean_root_mailbox, long_runn def root_mailbox_copy(target_sat, clean_root_mailbox): """Parsed local system copy of the Satellite's root user mailbox. - :returns: :class:`mailbox.mbox` instance + :return: :class:`mailbox.mbox` instance """ result = target_sat.execute(f'cat {clean_root_mailbox}') assert result.status == 0, f'Could not read mailbox {clean_root_mailbox} on Satellite host.' diff --git a/tests/foreman/api/test_permission.py b/tests/foreman/api/test_permission.py index b40349215c9..80eba410319 100644 --- a/tests/foreman/api/test_permission.py +++ b/tests/foreman/api/test_permission.py @@ -218,7 +218,7 @@ def give_user_permission(self, perm_name, target_sat): searching for the permission with name ``perm_name``. :raises: ``requests.exceptions.HTTPError`` if an error occurs when updating ``self.user``'s roles. - :returns: Nothing. + :return: Nothing. """ role = target_sat.api.Role().create() permissions = target_sat.api.Permission().search(query={'search': f'name="{perm_name}"'}) diff --git a/tests/foreman/cli/test_http_proxy.py b/tests/foreman/cli/test_http_proxy.py index bc7e07b0cd1..7f37fd88c9d 100644 --- a/tests/foreman/cli/test_http_proxy.py +++ b/tests/foreman/cli/test_http_proxy.py @@ -86,33 +86,55 @@ def test_positive_create_update_delete(module_org, module_location, target_sat): @pytest.mark.tier3 -@pytest.mark.run_in_one_thread -@pytest.mark.stubbed -def test_insights_client_registration_with_http_proxy(): +@pytest.mark.no_containers +@pytest.mark.rhel_ver_match(r'^(?!6$)\d+$') +@pytest.mark.parametrize( + 'setup_http_proxy', + [True, False], + indirect=True, + ids=['auth_http_proxy', 'unauth_http_proxy'], +) +def test_insights_client_registration_with_http_proxy( + module_target_sat, + setup_http_proxy, + rhel_contenthost, + rhcloud_activation_key, + rhcloud_manifest_org, +): """Verify that insights-client registration work with http proxy. :id: 5158d5c1-2b88-4c05-914b-f1c53656ffc2 - :customerscenario: true + :parametrized: yes - :steps: - 1. Create HTTP Proxy. - 2. Set created proxy as "Default HTTP Proxy" in settings. - 3. Edit /etc/resolv.conf and comment out all entries so that - satellite can not directly communicate outside. Ensure that - NetworkManger won't change it. - 4. Register a host with satellite. - 5. Register host with insights. - 6. Try insights-client register/unregister/test-connection/status + :setup: + 1. Satellite with Default HTTP Proxy set. - :BZ: 1959932 + :steps: + 1. Register a host with satellite. + 2. Register host with insights. + 3. Try insights-client register/unregister/test-connection/status :expectedresults: - 1. insights-client register/unregister/test-connection/status - works with http proxy set. + 1. insights-client register/unregister/test-connection/status works with http proxy set. - :CaseAutomation: NotAutomated + :BZ: 1959932 + + :customerscenario: true """ + rhel_contenthost.configure_rex( + satellite=module_target_sat, org=rhcloud_manifest_org, register=False + ) + rhel_contenthost.configure_rhai_client( + satellite=module_target_sat, + activation_key=rhcloud_activation_key.name, + org=rhcloud_manifest_org.label, + rhel_distro=f"rhel{rhel_contenthost.os_version.major}", + ) + assert rhel_contenthost.execute('insights-client --register').status == 0 + assert rhel_contenthost.execute('insights-client --test-connection').status == 0 + assert rhel_contenthost.execute('insights-client --status').status == 0 + assert rhel_contenthost.execute('insights-client --unregister').status == 0 @pytest.mark.tier2 @@ -164,29 +186,6 @@ def test_positive_set_content_default_http_proxy(block_fake_repo_access, target_ assert rpm_repo.read().content_counts['rpm'] >= 1 -@pytest.mark.stubbed -@pytest.mark.tier3 -def test_positive_environment_variable_unset_set(): - """Verify that satellite installer unsets and then sets back the environment variables - - :id: 596d753b-660b-49cb-b663-ff3cec439564 - - :BZ: 1886040 - - :customerscenario: true - - :steps: - 1. Export any environment variable from - [http_proxy, https_proxy, ssl_cert_file, HTTP_PROXY, HTTPS_PROXY, SSL_CERT_FILE] - 2. satellite-installer - - :expectedresults: satellite-installer unsets system proxy and SSL environment variables - only for the duration of install and sets back those in the end. - - :CaseAutomation: NotAutomated - """ - - @pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') diff --git a/tests/foreman/cli/test_oscap.py b/tests/foreman/cli/test_oscap.py index ea0f15318a1..248f4d4ee3f 100644 --- a/tests/foreman/cli/test_oscap.py +++ b/tests/foreman/cli/test_oscap.py @@ -35,7 +35,7 @@ def fetch_scap_and_profile_id(cls, scap_name, sat): :param scap_name: Scap title - :returns: scap_id and scap_profile_id + :return: scap_id and scap_profile_id """ default_content = sat.cli.Scapcontent.info({'title': scap_name}, output_format='json') scap_id = default_content['id'] diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index 364315ba197..fc773ea78d7 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -1729,7 +1729,7 @@ def test_positive_upload_remove_srpm_content(self, repo, target_sat): 'content-type': 'srpm', } ) - assert f"Successfully uploaded file '{SRPM_TO_UPLOAD}'" in result[0]['message'] + assert f'Successfully uploaded file {SRPM_TO_UPLOAD}' in result[0]['message'] assert ( int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms']) == 1 @@ -2569,7 +2569,7 @@ def test_positive_upload_file_to_file_repo(self, repo_options, repo, target_sat) 'product-id': repo['product']['id'], } ) - assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message'] + assert f'Successfully uploaded file {RPM_TO_UPLOAD}' in result[0]['message'] repo = target_sat.cli.Repository.info({'id': repo['id']}) assert repo['content-counts']['files'] == '1' filesearch = entities.File().search( @@ -2614,7 +2614,7 @@ def test_positive_remove_file(self, repo, target_sat): 'product-id': repo['product']['id'], } ) - assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message'] + assert f'Successfully uploaded file {RPM_TO_UPLOAD}' in result[0]['message'] repo = target_sat.cli.Repository.info({'id': repo['id']}) assert int(repo['content-counts']['files']) > 0 files = target_sat.cli.File.list({'repository-id': repo['id']}) @@ -2779,7 +2779,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat 'product-id': repo['product']['id'], } ) - assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message'] + assert f"Successfully uploaded file {text_file_name}" in result[0]['message'] repo = target_sat.cli.Repository.info({'id': repo['id']}) # Assert there is only one file assert repo['content-counts']['files'] == '1' @@ -2797,7 +2797,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat 'product-id': repo['product']['id'], } ) - assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message'] + assert f"Successfully uploaded file {text_file_name}" in result[0]['message'] repo = target_sat.cli.Repository.info({'id': repo['id']}) # Assert there is still only one file assert repo['content-counts']['files'] == '1' diff --git a/tests/foreman/cli/test_subnet.py b/tests/foreman/cli/test_subnet.py index c7daca3bb27..cf5ec10d697 100644 --- a/tests/foreman/cli/test_subnet.py +++ b/tests/foreman/cli/test_subnet.py @@ -15,7 +15,7 @@ import random import re -from fauxfactory import gen_choice, gen_integer, gen_ipaddr, gen_netmask +from fauxfactory import gen_choice, gen_integer, gen_ipaddr import pytest from robottelo.constants import SUBNET_IPAM_TYPES @@ -77,7 +77,7 @@ def test_positive_CRUD(module_target_sat): """ name = gen_choice(list(valid_data_list().values())) pool = sorted(valid_addr_pools()[0]) - mask = gen_netmask() + mask = '255.255.255.0' # generate pool range from network address network = gen_ipaddr() from_ip = re.sub(r'\d+$', str(pool[0]), network) @@ -115,7 +115,7 @@ def test_positive_CRUD(module_target_sat): pool = sorted(valid_addr_pools()[0]) # generate pool range from network address new_network = gen_ipaddr() - new_mask = gen_netmask() + new_mask = '255.255.192.0' ip_from = re.sub(r'\d+$', str(pool[0]), new_network) ip_to = re.sub(r'\d+$', str(pool[1]), new_network) ipam_type = SUBNET_IPAM_TYPES['internal'] @@ -176,7 +176,7 @@ def test_negative_create_with_address_pool(pool, module_target_sat): :CaseImportance: Medium """ - mask = gen_netmask() + mask = '255.255.255.0' network = gen_ipaddr() options = {'mask': mask, 'network': network} # generate pool range from network address diff --git a/tests/foreman/endtoend/test_api_endtoend.py b/tests/foreman/endtoend/test_api_endtoend.py index 277feff85ce..63de69e6301 100644 --- a/tests/foreman/endtoend/test_api_endtoend.py +++ b/tests/foreman/endtoend/test_api_endtoend.py @@ -18,7 +18,7 @@ from deepdiff import DeepDiff from fauxfactory import gen_string -from nailgun import client, entities +from nailgun import client import pytest from robottelo import constants @@ -1011,39 +1011,41 @@ class TestEndToEnd: def fake_manifest_is_set(self): return setting_is_set('fake_manifest') - def test_positive_find_default_org(self): + def test_positive_find_default_org(self, class_target_sat): """Check if 'Default Organization' is present :id: c6e45b36-d8b6-4507-8dcd-0645668496b9 :expectedresults: 'Default Organization' is found """ - results = entities.Organization().search( + results = class_target_sat.api.Organization().search( query={'search': f'name="{constants.DEFAULT_ORG}"'} ) assert len(results) == 1 assert results[0].name == constants.DEFAULT_ORG - def test_positive_find_default_loc(self): + def test_positive_find_default_loc(self, class_target_sat): """Check if 'Default Location' is present :id: 1f40b3c6-488d-4037-a7ab-250a02bf919a :expectedresults: 'Default Location' is found """ - results = entities.Location().search(query={'search': f'name="{constants.DEFAULT_LOC}"'}) + results = class_target_sat.api.Location().search( + query={'search': f'name="{constants.DEFAULT_LOC}"'} + ) assert len(results) == 1 assert results[0].name == constants.DEFAULT_LOC @pytest.mark.build_sanity - def test_positive_find_admin_user(self): + def test_positive_find_admin_user(self, class_target_sat): """Check if Admin User is present :id: 892fdfcd-18c0-42ef-988b-f13a04097f5c :expectedresults: Admin User is found and has Admin role """ - results = entities.User().search(query={'search': 'login=admin'}) + results = class_target_sat.api.User().search(query={'search': 'login=admin'}) assert len(results) == 1 assert results[0].login == 'admin' diff --git a/tests/foreman/longrun/test_oscap.py b/tests/foreman/longrun/test_oscap.py index 86711368439..b12c8f0c100 100644 --- a/tests/foreman/longrun/test_oscap.py +++ b/tests/foreman/longrun/test_oscap.py @@ -43,7 +43,7 @@ def fetch_scap_and_profile_id(sat, scap_name, scap_profile): :param scap_name: Scap title :param scap_profile: Scap profile you want to select - :returns: scap_id and scap_profile_id + :return: scap_id and scap_profile_id """ default_content = sat.cli.Scapcontent.info({'title': scap_name}, output_format='json') diff --git a/tests/foreman/sys/test_pulp3_filesystem.py b/tests/foreman/sys/test_pulp3_filesystem.py index a0ab51630af..d4c04798c35 100644 --- a/tests/foreman/sys/test_pulp3_filesystem.py +++ b/tests/foreman/sys/test_pulp3_filesystem.py @@ -43,7 +43,6 @@ def test_selinux_status(target_sat): @pytest.mark.parametrize( 'directory', [ - '/var/lib/pulp', '/var/lib/pulp/assets', '/var/lib/pulp/media', '/var/lib/pulp/tmp',