From 8024a18e94063896b58efb50d0dac81ba0e482ea Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Mon, 8 Dec 2025 22:35:35 +0530 Subject: [PATCH] DNM - Update junos workflow Signed-off-by: rohitthakur2590 --- .github/workflows/tests.yml | 143 +++++++++++++++++- .../junos/test_junos_bgp_address_family.py | 2 +- .../network/junos/test_junos_bgp_global.py | 2 +- .../network/junos/test_junos_command.py | 12 +- .../network/junos/test_junos_config.py | 20 +-- .../modules/network/junos/test_junos_facts.py | 2 +- .../network/junos/test_junos_hostname.py | 2 +- .../network/junos/test_junos_interfaces.py | 2 +- .../network/junos/test_junos_l2_interfaces.py | 2 +- .../network/junos/test_junos_l3_interfaces.py | 2 +- .../junos/test_junos_logging_global.py | 2 +- .../network/junos/test_junos_netconf.py | 2 +- .../network/junos/test_junos_ntp_global.py | 2 +- .../junos/test_junos_ospf_interfaces.py | 2 +- .../network/junos/test_junos_ospfv2.py | 2 +- .../network/junos/test_junos_ospfv3.py | 2 +- .../network/junos/test_junos_package.py | 4 +- .../modules/network/junos/test_junos_ping.py | 4 +- .../network/junos/test_junos_prefix_lists.py | 2 +- .../junos/test_junos_routing_instances.py | 2 +- .../junos/test_junos_routing_options.py | 2 +- .../modules/network/junos/test_junos_rpc.py | 4 +- .../modules/network/junos/test_junos_scp.py | 37 +++-- .../junos/test_junos_security_policies.py | 2 +- .../test_junos_security_policies_global.py | 2 +- .../junos/test_junos_security_zones.py | 2 +- .../network/junos/test_junos_snmp_server.py | 2 +- .../modules/network/junos/test_junos_vlans.py | 2 +- 28 files changed, 208 insertions(+), 58 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 677c0691..8bda00f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -197,6 +197,141 @@ jobs: else echo "No unit tests directory found, skipping" fi + # Tests for junipernetworks.junos collection (to be archived) + junipernetworks-junos-sanity: + name: Sanity Tests (junipernetworks.junos) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - python: "3.10" + ansible: "2.17" + - python: "3.11" + ansible: "2.17" + - python: "3.11" + ansible: "2.18" + - python: "3.11" + ansible: "2.19" + - python: "3.12" + ansible: "2.17" + - python: "3.12" + ansible: "2.18" + - python: "3.12" + ansible: "2.19" + steps: + - uses: actions/checkout@v5 + with: + ref: "${{ github.event.pull_request.head.sha }}" + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "${{ matrix.python }}" + - name: "Install tox-ansible, includes tox" + run: python -m pip install tox-ansible + - name: "Check for tox-ansible.ini file, else add default" + uses: ansible/ansible-content-actions/.github/actions/add_tox_ansible@main + - name: Copy tox-ansible.ini to collection directory + run: | + if [ -f tox-ansible.ini ]; then + cp tox-ansible.ini ansible_collections/junipernetworks/junos/ + fi + - name: Run tox sanity tests + working-directory: ansible_collections/junipernetworks/junos + run: >- + python -m tox --ansible -e sanity-py${{ matrix.python }}-${{ matrix.ansible }} + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + junipernetworks-junos-unit-galaxy: + name: Unit Tests (junipernetworks.junos - Galaxy) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - python: "3.10" + ansible: "2.17" + - python: "3.11" + ansible: "2.17" + - python: "3.11" + ansible: "2.18" + - python: "3.11" + ansible: "2.19" + - python: "3.12" + ansible: "2.17" + - python: "3.12" + ansible: "2.18" + - python: "3.12" + ansible: "2.19" + steps: + - uses: actions/checkout@v5 + with: + ref: "${{ github.event.pull_request.head.ref }}" + repository: "${{ github.event.pull_request.head.repo.full_name }}" + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "${{ matrix.python }}" + - name: "Install tox-ansible, includes tox" + run: python -m pip install tox-ansible + - name: "Check for tox-ansible.ini file, else add default" + uses: ansible/ansible-content-actions/.github/actions/add_tox_ansible@main + - name: Copy tox-ansible.ini to collection directory + run: | + if [ -f tox-ansible.ini ]; then + cp tox-ansible.ini ansible_collections/junipernetworks/junos/ + fi + - name: Run tox unit tests + working-directory: ansible_collections/junipernetworks/junos + run: >- + python -m tox --ansible -e unit-py${{ matrix.python }}-${{ matrix.ansible }} + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + junipernetworks-junos-integration: + name: Integration Tests (junipernetworks.junos) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - python: "3.11" + ansible: "2.17" + - python: "3.12" + ansible: "2.19" + steps: + - uses: actions/checkout@v5 + with: + ref: "${{ github.event.pull_request.head.sha }}" + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "${{ matrix.python }}" + - name: "Install tox-ansible, includes tox" + run: python -m pip install tox-ansible + - name: "Check for tox-ansible.ini file, else add default" + uses: ansible/ansible-content-actions/.github/actions/add_tox_ansible@main + - name: Copy tox-ansible.ini to collection directory + run: | + if [ -f tox-ansible.ini ]; then + cp tox-ansible.ini ansible_collections/junipernetworks/junos/ + fi + - name: Install collection dependencies + working-directory: ansible_collections/junipernetworks/junos + run: | + ansible-galaxy collection install -r requirements.txt || true + ansible-galaxy collection install git+https://github.com/ansible-collections/ansible.utils.git + ansible-galaxy collection install git+https://github.com/ansible-collections/ansible.netcommon.git + # Install juniper.device dependency + ansible-galaxy collection install git+https://github.com/Juniper/ansible-junos-stdlib.git,ansible_collections/juniper/device || true + - name: Run tox network-integration tests + working-directory: ansible_collections/junipernetworks/junos + run: >- + python -m tox --ansible -e network-integration-py${{ matrix.python }}-${{ matrix.ansible }} + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + continue-on-error: true all_green: if: ${{ always() && (github.event_name != 'schedule') }} needs: @@ -206,6 +341,9 @@ jobs: - unit-galaxy - ansible-lint - unit-source + - junipernetworks-junos-sanity + - junipernetworks-junos-unit-galaxy + - junipernetworks-junos-integration runs-on: ubuntu-latest steps: - run: >- @@ -216,5 +354,8 @@ jobs: '${{ needs.sanity.result }}', '${{ needs.unit-galaxy.result }}', '${{ needs.ansible-lint.result }}', - '${{ needs.unit-source.result }}' + '${{ needs.unit-source.result }}', + '${{ needs.junipernetworks-junos-sanity.result }}', + '${{ needs.junipernetworks-junos-unit-galaxy.result }}', + '${{ needs.junipernetworks-junos-integration.result }}' ])" diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_address_family.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_address_family.py index 5a743bee..bc226a09 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_address_family.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_address_family.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_bgp_address_family +from ansible_collections.juniper.device.plugins.modules import junos_bgp_address_family from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_global.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_global.py index f5d8dfcd..5848ff71 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_global.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_bgp_global.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_bgp_global +from ansible_collections.juniper.device.plugins.modules import junos_bgp_global from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_command.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_command.py index 5e066957..69929d10 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_command.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_command.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_command +from ansible_collections.juniper.device.plugins.modules import junos_command from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture @@ -44,17 +44,17 @@ def setUp(self): super(TestJunosCommandModule, self).setUp() self.mock_conn = patch( - "ansible_collections.junipernetworks.junos.plugins.module_utils.network.junos.junos.Connection", + "ansible_collections.juniper.device.plugins.module_utils.network.junos.junos.Connection", ) self.conn = self.mock_conn.start() self.mock_netconf = patch( - "ansible_collections.junipernetworks.junos.plugins.module_utils.network.junos.junos.NetconfConnection", + "ansible_collections.juniper.device.plugins.module_utils.network.junos.junos.NetconfConnection", ) self.netconf_conn = self.mock_netconf.start() self.mock_exec_rpc = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_command.exec_rpc", + "ansible_collections.juniper.device.plugins.modules.junos_command.exec_rpc", ) self.exec_rpc = self.mock_exec_rpc.start() @@ -64,12 +64,12 @@ def setUp(self): self.netconf_rpc = self.mock_netconf_rpc.start() self.mock_get_connection = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_command.get_connection", + "ansible_collections.juniper.device.plugins.modules.junos_command.get_connection", ) self.get_connection = self.mock_get_connection.start() self.mock_get_capabilities = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_command.get_capabilities", + "ansible_collections.juniper.device.plugins.modules.junos_command.get_capabilities", ) self.get_capabilities = self.mock_get_capabilities.start() self.get_capabilities.return_value = {"network_api": "netconf"} diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_config.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_config.py index e24a56c4..2cf63ea5 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_config.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_config.py @@ -26,7 +26,7 @@ from ansible.module_utils._text import to_text -from ansible_collections.junipernetworks.junos.plugins.modules import junos_config +from ansible_collections.juniper.device.plugins.modules import junos_config from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture @@ -39,37 +39,37 @@ def setUp(self): super(TestJunosConfigModule, self).setUp() self.mock_get_config = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.get_configuration", + "ansible_collections.juniper.device.plugins.modules.junos_config.get_configuration", ) self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.load_config", + "ansible_collections.juniper.device.plugins.modules.junos_config.load_config", ) self.load_config = self.mock_load_config.start() self.mock_load_configuration = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.load_configuration", + "ansible_collections.juniper.device.plugins.modules.junos_config.load_configuration", ) self.load_configuration = self.mock_load_configuration.start() self.mock_lock_configuration = patch( - "ansible_collections.junipernetworks.junos.plugins.module_utils.network.junos.junos.lock_configuration", + "ansible_collections.juniper.device.plugins.module_utils.network.junos.junos.lock_configuration", ) self.lock_configuration = self.mock_lock_configuration.start() self.mock_unlock_configuration = patch( - "ansible_collections.junipernetworks.junos.plugins.module_utils.network.junos.junos.unlock_configuration", + "ansible_collections.juniper.device.plugins.module_utils.network.junos.junos.unlock_configuration", ) self.unlock_configuration = self.mock_unlock_configuration.start() self.mock_commit_configuration = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.commit_configuration", + "ansible_collections.juniper.device.plugins.modules.junos_config.commit_configuration", ) self.commit_configuration = self.mock_commit_configuration.start() self.mock_get_diff = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.get_diff", + "ansible_collections.juniper.device.plugins.modules.junos_config.get_diff", ) self.get_diff = self.mock_get_diff.start() @@ -77,12 +77,12 @@ def setUp(self): self.conn = self.mock_conn.start() self.mock_netconf = patch( - "ansible_collections.junipernetworks.junos.plugins.module_utils.network.junos.junos.NetconfConnection", + "ansible_collections.juniper.device.plugins.module_utils.network.junos.junos.NetconfConnection", ) self.netconf_conn = self.mock_netconf.start() self.mock_exec_rpc = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_config.exec_rpc", + "ansible_collections.juniper.device.plugins.modules.junos_config.exec_rpc", ) self.exec_rpc = self.mock_exec_rpc.start() diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_facts.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_facts.py index 154ea4f5..00f440c2 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_facts.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_facts.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_facts +from ansible_collections.juniper.device.plugins.modules import junos_facts from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_hostname.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_hostname.py index 8fe1931d..aeddbc6a 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_hostname.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_hostname.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_hostname +from ansible_collections.juniper.device.plugins.modules import junos_hostname from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_interfaces.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_interfaces.py index d2f41bf6..ae5c824a 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_interfaces.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_interfaces.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_interfaces +from ansible_collections.juniper.device.plugins.modules import junos_interfaces from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l2_interfaces.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l2_interfaces.py index 06d61143..6e9a862d 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l2_interfaces.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l2_interfaces.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_l2_interfaces +from ansible_collections.juniper.device.plugins.modules import junos_l2_interfaces from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l3_interfaces.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l3_interfaces.py index 600861a6..a7841b74 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l3_interfaces.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_l3_interfaces.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_l3_interfaces +from ansible_collections.juniper.device.plugins.modules import junos_l3_interfaces from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_logging_global.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_logging_global.py index 55ac5170..0c62c88e 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_logging_global.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_logging_global.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_logging_global +from ansible_collections.juniper.device.plugins.modules import junos_logging_global from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_netconf.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_netconf.py index 70e4fe0b..fba4d461 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_netconf.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_netconf.py @@ -23,7 +23,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_netconf +from ansible_collections.juniper.device.plugins.modules import junos_netconf from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ntp_global.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ntp_global.py index 26836a7c..ecdb3cd8 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ntp_global.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ntp_global.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_ntp_global +from ansible_collections.juniper.device.plugins.modules import junos_ntp_global from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospf_interfaces.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospf_interfaces.py index 39ea2b77..a365fa5c 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospf_interfaces.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospf_interfaces.py @@ -28,7 +28,7 @@ from unittest.mock import MagicMock, patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_ospf_interfaces +from ansible_collections.juniper.device.plugins.modules import junos_ospf_interfaces from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv2.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv2.py index 3ec9f589..12418230 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv2.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv2.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_ospfv2 +from ansible_collections.juniper.device.plugins.modules import junos_ospfv2 from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv3.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv3.py index beef248b..ecdc53a3 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv3.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ospfv3.py @@ -28,7 +28,7 @@ from unittest.mock import MagicMock, patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_ospfv3 +from ansible_collections.juniper.device.plugins.modules import junos_ospfv3 from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_package.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_package.py index 943c7e9e..1f68f802 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_package.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_package.py @@ -38,7 +38,7 @@ module_patcher = patch.dict("sys.modules", modules) module_patcher.start() -from ansible_collections.junipernetworks.junos.plugins.modules import junos_package +from ansible_collections.juniper.device.plugins.modules import junos_package class TestJunosPackageModule(TestJunosModule): @@ -47,7 +47,7 @@ class TestJunosPackageModule(TestJunosModule): def setUp(self): super(TestJunosPackageModule, self).setUp() self.mock_get_device = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_package.get_device", + "ansible_collections.juniper.device.plugins.modules.junos_package.get_device", ) self.get_device = self.mock_get_device.start() diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ping.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ping.py index 4a6d2701..be6291c6 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ping.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_ping.py @@ -23,7 +23,7 @@ from unittest.mock import MagicMock, patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_ping +from ansible_collections.juniper.device.plugins.modules import junos_ping from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture @@ -36,7 +36,7 @@ def setUp(self): super(TestJunosPingModule, self).setUp() self.mock_get_connection = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_ping.get_connection", + "ansible_collections.juniper.device.plugins.modules.junos_ping.get_connection", ) self.get_connection = self.mock_get_connection.start() diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_prefix_lists.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_prefix_lists.py index 9db905a4..d5f5de55 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_prefix_lists.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_prefix_lists.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_prefix_lists +from ansible_collections.juniper.device.plugins.modules import junos_prefix_lists from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_instances.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_instances.py index d281a7ef..5eeefebb 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_instances.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_instances.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_routing_instances +from ansible_collections.juniper.device.plugins.modules import junos_routing_instances from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_options.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_options.py index 0f506bc8..3d079217 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_options.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_routing_options.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_routing_options +from ansible_collections.juniper.device.plugins.modules import junos_routing_options from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_rpc.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_rpc.py index 11a3bb8a..98aff99f 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_rpc.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_rpc.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_rpc +from ansible_collections.juniper.device.plugins.modules import junos_rpc from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture @@ -63,7 +63,7 @@ def setUp(self): self.netconf_rpc = self.mock_netconf_rpc.start() self.mock_exec_rpc = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_rpc.exec_rpc", + "ansible_collections.juniper.device.plugins.modules.junos_rpc.exec_rpc", ) self.exec_rpc = self.mock_exec_rpc.start() diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_scp.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_scp.py index fc2bd1b8..a687a791 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_scp.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_scp.py @@ -40,31 +40,40 @@ module_patcher = patch.dict("sys.modules", modules) module_patcher.start() -from ansible_collections.junipernetworks.junos.plugins.modules import junos_scp +# junos_scp module was removed from juniper.device collection +# This test file is kept for historical reference but tests are disabled +# from ansible_collections.juniper.device.plugins.modules import junos_scp + +import pytest + +pytestmark = pytest.mark.skip(reason="junos_scp module was removed from juniper.device collection") class TestJunosScpModule(TestJunosModule): - module = junos_scp + # junos_scp module was removed, skipping tests + module = None def setUp(self): super(TestJunosScpModule, self).setUp() - self.mock_get_device = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_scp.get_device", - ) - self.get_device = self.mock_get_device.start() + # junos_scp module was removed, skipping mocks + # self.mock_get_device = patch( + # "ansible_collections.juniper.device.plugins.modules.junos_scp.get_device", + # ) + # self.get_device = self.mock_get_device.start() - self.mock_scp = patch( - "ansible_collections.junipernetworks.junos.plugins.modules.junos_scp.SCP", - ) - self.scp = self.mock_scp.start() + # self.mock_scp = patch( + # "ansible_collections.juniper.device.plugins.modules.junos_scp.SCP", + # ) + # self.scp = self.mock_scp.start() - self.scp_mock = MagicMock() - self.scp().__enter__.return_value = self.scp_mock + # self.scp_mock = MagicMock() + # self.scp().__enter__.return_value = self.scp_mock def tearDown(self): super(TestJunosScpModule, self).tearDown() - self.mock_get_device.stop() - self.mock_scp.stop() + # junos_scp module was removed, skipping cleanup + # self.mock_get_device.stop() + # self.mock_scp.stop() def test_junos_scp_src(self): set_module_args(dict(src="test.txt")) diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies.py index 22eb2b14..d18e08c2 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_security_policies +from ansible_collections.juniper.device.plugins.modules import junos_security_policies from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies_global.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies_global.py index 1c1131d9..acc6b768 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies_global.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_policies_global.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_security_policies_global +from ansible_collections.juniper.device.plugins.modules import junos_security_policies_global from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_zones.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_zones.py index b5eb0385..608d1fee 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_zones.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_security_zones.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_security_zones +from ansible_collections.juniper.device.plugins.modules import junos_security_zones from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_snmp_server.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_snmp_server.py index f29381a1..69d15502 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_snmp_server.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_snmp_server.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_snmp_server +from ansible_collections.juniper.device.plugins.modules import junos_snmp_server from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture diff --git a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_vlans.py b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_vlans.py index 1f0890a5..283e82ef 100644 --- a/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_vlans.py +++ b/ansible_collections/junipernetworks/junos/tests/unit/modules/network/junos/test_junos_vlans.py @@ -28,7 +28,7 @@ from unittest.mock import patch -from ansible_collections.junipernetworks.junos.plugins.modules import junos_vlans +from ansible_collections.juniper.device.plugins.modules import junos_vlans from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args from .junos_module import TestJunosModule, load_fixture