From 7bbefa15d21b06cf1104218876b7b6a45cf630e8 Mon Sep 17 00:00:00 2001 From: david-ns Date: Wed, 8 May 2024 17:53:07 +0200 Subject: [PATCH 1/2] Avoid loops when a process has its ppid as some of its child pid --- CHANGELOG.md | 6 ++++++ galaxy.yml | 2 +- plugins/action/software_facts.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6472c78..2a22185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.10.1 + +## Fixed + +- Avoid loops when a pid has it's ppid as pid on its child at any depth. + # 1.10.0 ## Features diff --git a/galaxy.yml b/galaxy.yml index 249961b..ce48496 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: datadope name: discovery # The version of the collection. Must be compatible with semantic versioning -version: 1.10.0 +version: 1.10.1 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/plugins/action/software_facts.py b/plugins/action/software_facts.py index d7297b2..fdd0afa 100644 --- a/plugins/action/software_facts.py +++ b/plugins/action/software_facts.py @@ -83,11 +83,11 @@ def _check_process_hierarchy(self, hierarchical_processes_by_pid, process, softw ppid = process['ppid'] if int(ppid) > 0 and ppid not in tested_pids and ppid not in used_pids \ and ppid in hierarchical_processes_by_pid: + tested_pids.append(ppid) found = self._check_process_hierarchy(hierarchical_processes_by_pid, hierarchical_processes_by_pid[ppid], software_processes, tested_pids, used_pids) if not found: found = self._check_process_is_sw(hierarchical_processes_by_pid, process, software_processes, used_pids) - tested_pids.append(ppid) return found def _children_pids(self, process, pids): From c6dd6e6b19d1c7763c5832abb2e1bc8cffeabc7e Mon Sep 17 00:00:00 2001 From: david-ns Date: Wed, 8 May 2024 18:10:52 +0200 Subject: [PATCH 2/2] Fix CI --- .github/workflows/repo-integration.yml | 2 + .github/workflows/repo-sanity.yml | 1 + .github/workflows/repo-units.yml | 2 + tests/sanity/ignore-2.18.txt | 84 +++++++++++++++++++ .../plugins/action/software/test_mariadb.py | 11 +-- .../plugins/action/software/test_mysql.py | 11 +-- .../plugins/action/software/test_nginx.py | 11 +-- .../plugins/action/software/test_postgres.py | 11 +-- .../plugins/action/software/test_tomcat.py | 10 +-- .../plugins/action/test_software_facts.py | 22 ++--- .../snmp_utils/test_dependencies.py | 6 +- .../snmp_utils/test_post_process.py | 14 ++-- .../snmp_utils/test_processed_template.py | 6 +- .../snmp_utils/test_sysobjectids.py | 16 ++-- tests/unit/requirements.txt | 1 - 15 files changed, 151 insertions(+), 57 deletions(-) create mode 100644 tests/sanity/ignore-2.18.txt diff --git a/.github/workflows/repo-integration.yml b/.github/workflows/repo-integration.yml index 6211f07..49fff3f 100644 --- a/.github/workflows/repo-integration.yml +++ b/.github/workflows/repo-integration.yml @@ -18,6 +18,8 @@ jobs: - stable-2.13 - stable-2.14 - stable-2.15 + - stable-2.16 + - stable-2.17 - devel python: - '3.10' diff --git a/.github/workflows/repo-sanity.yml b/.github/workflows/repo-sanity.yml index 11f3520..16b593f 100644 --- a/.github/workflows/repo-sanity.yml +++ b/.github/workflows/repo-sanity.yml @@ -20,6 +20,7 @@ jobs: - stable-2.14 - stable-2.15 - stable-2.16 + - stable-2.17 - devel python: - '3.10' diff --git a/.github/workflows/repo-units.yml b/.github/workflows/repo-units.yml index a38e35a..0131447 100644 --- a/.github/workflows/repo-units.yml +++ b/.github/workflows/repo-units.yml @@ -18,6 +18,8 @@ jobs: - stable-2.13 - stable-2.14 - stable-2.15 + - stable-2.16 + - stable-2.17 - devel python: - '3.10' diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt new file mode 100644 index 0000000..99e7716 --- /dev/null +++ b/tests/sanity/ignore-2.18.txt @@ -0,0 +1,84 @@ +tests/unit/plugins/action/auto/conftest.py pylint:disallowed-name +plugins/action_utils/software_facts/parsers/environ.py pylint:disallowed-name +plugins/action/software_facts.py pylint:raising-bad-type # Code is correct. Test is failing +plugins/module_utils/file_parser/apache_webserver/errors.py pylint!skip +plugins/module_utils/file_parser/apache_webserver/lexer.py pylint!skip +plugins/module_utils/file_parser/apache_webserver/loader.py pylint!skip +plugins/module_utils/file_parser/apache_webserver/parser.py pylint!skip +plugins/module_utils/file_parser/haproxy/lexer.py pylint!skip +plugins/module_utils/file_parser/haproxy/loader.py pylint!skip +plugins/module_utils/file_parser/haproxy/parser.py pylint!skip +plugins/module_utils/file_parser/keepalived/lexer.py pylint!skip +plugins/module_utils/file_parser/keepalived/loader.py pylint!skip +plugins/module_utils/file_parser/keepalived/parser.py pylint!skip +plugins/module_utils/file_parser/nginx/lexer.py pylint!skip +plugins/module_utils/file_parser/nginx/loader.py pylint!skip +plugins/module_utils/file_parser/nginx/parser.py pylint!skip +plugins/module_utils/file_parser/lex.py pylint!skip +plugins/module_utils/file_parser/yacc.py pylint!skip +plugins/action_utils/software_facts/xmltodict.py pylint!skip +plugins/action_utils/software_facts/compat/__init__.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/config/data.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/config/manager.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/constants.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/context.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/errors/yaml_strings.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/_collections_compat.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/_json_compat.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/arg_spec.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/collections.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/parameters.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/text/converters.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/text/formatters.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/validation.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/warnings.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/common/yaml.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/errors.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/module_utils/parsing/convert_bool.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/parsing/quoting.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/parsing/splitter.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/parsing/yaml/objects.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/release.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/color.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/context_objects.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/display.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/fqcn.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/native_jinja.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/path.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/py3compat.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/singleton.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/unicode.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/unsafe_proxy.py pylint!skip +plugins/action_utils/software_facts/compat/ansible/utils/vars.py pylint!skip +plugins/action_utils/software_facts/compat/filter.py pylint!skip +plugins/module_utils/file_parser/apache_webserver/errors.py pep8!skip +plugins/module_utils/file_parser/apache_webserver/lexer.py pep8!skip +plugins/module_utils/file_parser/apache_webserver/loader.py pep8!skip +plugins/module_utils/file_parser/apache_webserver/parser.py pep8!skip +plugins/module_utils/file_parser/haproxy/lexer.py pep8!skip +plugins/module_utils/file_parser/haproxy/loader.py pep8!skip +plugins/module_utils/file_parser/haproxy/parser.py pep8!skip +plugins/module_utils/file_parser/keepalived/lexer.py pep8!skip +plugins/module_utils/file_parser/keepalived/loader.py pep8!skip +plugins/module_utils/file_parser/keepalived/parser.py pep8!skip +plugins/module_utils/file_parser/nginx/lexer.py pep8!skip +plugins/module_utils/file_parser/nginx/loader.py pep8!skip +plugins/module_utils/file_parser/nginx/parser.py pep8!skip +plugins/module_utils/file_parser/lex.py pep8!skip +plugins/module_utils/file_parser/yacc.py pep8!skip +plugins/modules/check_connection.py replace-urlopen +plugins/module_utils/file_parser/apache_webserver/lexer.py use-compat-six +plugins/module_utils/file_parser/apache_webserver/loader.py use-compat-six +plugins/module_utils/file_parser/apache_webserver/parser.py use-compat-six +plugins/module_utils/file_parser/haproxy/lexer.py use-compat-six +plugins/module_utils/file_parser/haproxy/loader.py use-compat-six +plugins/module_utils/file_parser/haproxy/parser.py use-compat-six +plugins/module_utils/file_parser/keepalived/lexer.py use-compat-six +plugins/module_utils/file_parser/keepalived/loader.py use-compat-six +plugins/module_utils/file_parser/keepalived/parser.py use-compat-six +plugins/module_utils/file_parser/nginx/lexer.py use-compat-six +plugins/module_utils/file_parser/nginx/loader.py use-compat-six +plugins/module_utils/file_parser/nginx/parser.py use-compat-six +plugins/modules/win_package_facts.ps1 pslint:PSCustomUseLiteralPath +plugins/modules/snmp_facts.py validate-modules:undocumented-parameter +plugins/modules/snmp_facts.py validate-modules:doc-default-does-not-match-spec \ No newline at end of file diff --git a/tests/unit/plugins/action/software/test_mariadb.py b/tests/unit/plugins/action/software/test_mariadb.py index 68c74ab..250794e 100644 --- a/tests/unit/plugins/action/software/test_mariadb.py +++ b/tests/unit/plugins/action/software/test_mariadb.py @@ -4,7 +4,6 @@ import pytest from ansible.module_utils.six.moves import builtins # noqa -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -186,12 +185,14 @@ def params_set_two_sw(sw_config, params_set_one_sw): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_one_sw'),), - (lazy_fixture('params_set_two_sw'),), - (lazy_fixture('params_set_no_sw'),)] + ('params_set_one_sw',), + ('params_set_two_sw',), + ('params_set_no_sw',)] ) def test_get_software_ok(normalize, - params_and_expected_result): + params_and_expected_result, + request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = ActionModule(*[None] * 6).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action/software/test_mysql.py b/tests/unit/plugins/action/software/test_mysql.py index fbe1f04..514670f 100644 --- a/tests/unit/plugins/action/software/test_mysql.py +++ b/tests/unit/plugins/action/software/test_mysql.py @@ -4,7 +4,6 @@ import pytest from ansible.module_utils.six.moves import builtins # noqa -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -159,12 +158,14 @@ def params_set_two_sw(sw_config, params_set_one_sw): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_one_sw'),), - (lazy_fixture('params_set_two_sw'),), - (lazy_fixture('params_set_no_sw'),)] + ('params_set_one_sw',), + ('params_set_two_sw',), + ('params_set_no_sw',)] ) def test_get_software_ok(normalize, - params_and_expected_result): + params_and_expected_result, + request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = ActionModule(*[None] * 6).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action/software/test_nginx.py b/tests/unit/plugins/action/software/test_nginx.py index 0f7a04f..9570525 100644 --- a/tests/unit/plugins/action/software/test_nginx.py +++ b/tests/unit/plugins/action/software/test_nginx.py @@ -4,7 +4,6 @@ import pytest from ansible.module_utils.six.moves import builtins # noqa -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -156,12 +155,14 @@ def params_set_two_sw(sw_config, params_set_one_sw): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_one_sw'),), - (lazy_fixture('params_set_two_sw'),), - (lazy_fixture('params_set_no_sw'),)] + ('params_set_one_sw',), + ('params_set_two_sw',), + ('params_set_no_sw',)] ) def test_get_software_ok(normalize, - params_and_expected_result): + params_and_expected_result, + request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = ActionModule(*[None] * 6).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action/software/test_postgres.py b/tests/unit/plugins/action/software/test_postgres.py index 2921851..b39495d 100644 --- a/tests/unit/plugins/action/software/test_postgres.py +++ b/tests/unit/plugins/action/software/test_postgres.py @@ -4,7 +4,6 @@ import pytest from ansible.module_utils.six.moves import builtins # noqa -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -597,12 +596,14 @@ def params_set_two_sw(sw_config, params_set_one_sw): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_one_sw'),), - (lazy_fixture('params_set_two_sw'),), - (lazy_fixture('params_set_no_sw'),)] + ('params_set_one_sw',), + ('params_set_two_sw',), + ('params_set_no_sw',)] ) def test_get_software_ok(normalize, - params_and_expected_result): + params_and_expected_result, + request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = ActionModule(*[None] * 6).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action/software/test_tomcat.py b/tests/unit/plugins/action/software/test_tomcat.py index 006cd7d..8a4b155 100644 --- a/tests/unit/plugins/action/software/test_tomcat.py +++ b/tests/unit/plugins/action/software/test_tomcat.py @@ -4,7 +4,6 @@ import pytest from ansible.module_utils.six.moves import builtins # noqa -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -229,11 +228,12 @@ def params_set_two_sw(sw_config, params_set_one_sw): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_one_sw'),), - (lazy_fixture('params_set_two_sw'),), - (lazy_fixture('params_set_no_sw'),)] + ('params_set_one_sw',), + ('params_set_two_sw',), + ('params_set_no_sw',)] ) -def test_get_software_ok(normalize, params_and_expected_result): +def test_get_software_ok(normalize, params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = ActionModule(*[None] * 6).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action/test_software_facts.py b/tests/unit/plugins/action/test_software_facts.py index 0c77d6f..8b7b43e 100644 --- a/tests/unit/plugins/action/test_software_facts.py +++ b/tests/unit/plugins/action/test_software_facts.py @@ -7,7 +7,6 @@ import pytest from ansible.errors import AnsibleError, AnsibleRuntimeError from ansible.module_utils.six import iteritems -from pytest_lazyfixture import lazy_fixture from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import call, patch, MagicMock, ANY from ansible_collections.datadope.discovery.plugins.action.software_facts import ActionModule @@ -1124,7 +1123,7 @@ def test_init(action_module): argnames=('params', 'expected_result'), argvalues=[ ( - lazy_fixture('params_set_child_with_children'), True + 'params_set_child_with_children', True ), ( { @@ -1186,7 +1185,9 @@ def test_init(action_module): }, False ) ]) -def test_validate_parameters(action_module, params, expected_result): +def test_validate_parameters(action_module, params, expected_result, request): + if isinstance(params, str): + params = request.getfixturevalue(params) instance = action_module(ActionModule) assert instance.validate_parameters(params[0] if isinstance(params, tuple) else params) is expected_result @@ -1369,14 +1370,15 @@ def run(self, *args, **kwargs): # noqa @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_set_child_with_children'),), - (lazy_fixture('params_set_child_without_children'),), - (lazy_fixture('params_set_parent_with_children'),), - (lazy_fixture('params_set_parent_without_children'),), - (lazy_fixture('params_set_dockers_with_children'),), - (lazy_fixture('params_set_dockers_without_children'),)] + ('params_set_child_with_children',), + ('params_set_child_without_children',), + ('params_set_parent_with_children',), + ('params_set_parent_without_children',), + ('params_set_dockers_with_children',), + ('params_set_dockers_without_children',)] ) -def test_get_software_ok(action_module, normalize, params_and_expected_result): +def test_get_software_ok(action_module, normalize, params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = action_module(ActionModule).process_software(**params) assert normalize(result) == normalize(expected_result) diff --git a/tests/unit/plugins/action_utils/snmp_utils/test_dependencies.py b/tests/unit/plugins/action_utils/snmp_utils/test_dependencies.py index 454c528..4a4f540 100644 --- a/tests/unit/plugins/action_utils/snmp_utils/test_dependencies.py +++ b/tests/unit/plugins/action_utils/snmp_utils/test_dependencies.py @@ -3,7 +3,6 @@ __metaclass__ = type import pytest -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action_utils.snmp_utils.utils import index_dependency @@ -236,9 +235,10 @@ def params_index_dependency(): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_index_dependency'),)] + ('params_index_dependency',)] ) -def test_dependencies(params_and_expected_result): +def test_dependencies(params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result tagged_result = params['tagged_result'] for config in params['config_dependencies']: diff --git a/tests/unit/plugins/action_utils/snmp_utils/test_post_process.py b/tests/unit/plugins/action_utils/snmp_utils/test_post_process.py index 59eaee3..3f15ee8 100644 --- a/tests/unit/plugins/action_utils/snmp_utils/test_post_process.py +++ b/tests/unit/plugins/action_utils/snmp_utils/test_post_process.py @@ -4,7 +4,6 @@ import pytest -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action_utils.snmp_utils.post_process import post_process @@ -47,13 +46,14 @@ def unknown_method(): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('decode_hex'),), - (lazy_fixture('decode_mac'),), - (lazy_fixture('lookups_adminstatus'),), - (lazy_fixture('lookup_operstatus'),), - (lazy_fixture('unknown_method'),)] + ('decode_hex',), + ('decode_mac',), + ('lookups_adminstatus',), + ('lookup_operstatus',), + ('unknown_method',)] ) -def test_post_process(params_and_expected_result): +def test_post_process(params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result for i in range(len(params[1])): process_method = post_process(params[0]) diff --git a/tests/unit/plugins/action_utils/snmp_utils/test_processed_template.py b/tests/unit/plugins/action_utils/snmp_utils/test_processed_template.py index ce395ae..3930c83 100644 --- a/tests/unit/plugins/action_utils/snmp_utils/test_processed_template.py +++ b/tests/unit/plugins/action_utils/snmp_utils/test_processed_template.py @@ -3,7 +3,6 @@ __metaclass__ = type import pytest -from pytest_lazyfixture import lazy_fixture from ansible_collections.datadope.discovery.plugins.action_utils.snmp_utils.utils import processed_templating_result @@ -270,9 +269,10 @@ def params_processed_template(): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('params_processed_template'),)] + ('params_processed_template',)] ) -def test_util_process_templating(params_and_expected_result): +def test_util_process_templating(params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = processed_templating_result( snmp_template=params['snmp_template'], diff --git a/tests/unit/plugins/action_utils/snmp_utils/test_sysobjectids.py b/tests/unit/plugins/action_utils/snmp_utils/test_sysobjectids.py index cf4ff6c..13b58ff 100644 --- a/tests/unit/plugins/action_utils/snmp_utils/test_sysobjectids.py +++ b/tests/unit/plugins/action_utils/snmp_utils/test_sysobjectids.py @@ -5,7 +5,6 @@ import os import pytest -from pytest_lazyfixture import lazy_fixture from ansible_collections.community.internal_test_tools.tools.lib.yaml import load_yaml from ansible_collections.datadope.discovery.plugins.action_utils.snmp_utils.utils import get_info_by_sysobject @@ -122,14 +121,15 @@ def dell_match_generic(sysobject_ids_file): @pytest.mark.parametrize(argnames=['params_and_expected_result'], argvalues=[ - (lazy_fixture('aruba_match_generic'),), - (lazy_fixture('aruba_not_brand_generic'),), - (lazy_fixture('cisco_match_generic'),), - (lazy_fixture('cisco_match_testing'),), - (lazy_fixture('dell_not_type_generic'),), - (lazy_fixture('dell_match_generic'),), ] + ('aruba_match_generic',), + ('aruba_not_brand_generic',), + ('cisco_match_generic',), + ('cisco_match_testing',), + ('dell_not_type_generic',), + ('dell_match_generic',), ] ) -def test_sysobjectids(params_and_expected_result): +def test_sysobjectids(params_and_expected_result, request): + params_and_expected_result = request.getfixturevalue(params_and_expected_result) params, expected_result = params_and_expected_result result = get_info_by_sysobject( sysobject_ids_file=params['sysobject_ids_file'], diff --git a/tests/unit/requirements.txt b/tests/unit/requirements.txt index 1bde110..e69de29 100644 --- a/tests/unit/requirements.txt +++ b/tests/unit/requirements.txt @@ -1 +0,0 @@ -pytest-lazy-fixture \ No newline at end of file