Skip to content

Commit a1c5e39

Browse files
[Enabler][1832]Set_dynamic_volumes_for_volume_init (#2030)
* Fix dynamic volume init * Add fragment * Fix error for other test suites * Fix comments and avoid circular * Test with volume 7 * Update test_zos_volume_init_func.py * Return dynamic volume * Add validation of test cases * Try to order volumes * Try to order * Try to order * Try to order * Try to order * Try to order * Update volumes.py * Debug copy * Debug copy * Debug copy * Use only valid volumes * Ensure order from least to most * Add comment and make easy way to get volumes
1 parent 85a8668 commit a1c5e39

File tree

4 files changed

+255
-153
lines changed

4 files changed

+255
-153
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trivial:
2+
- test_zos_volume_init.py - Adds support dynamic volumes and allocations for testing.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/2030).

tests/conftest.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
__metaclass__ = type
1515
import pytest
1616
from ibm_zos_core.tests.helpers.ztest import ZTestHelper
17-
from ibm_zos_core.tests.helpers.volumes import get_volumes, get_volumes_with_vvds
17+
from ibm_zos_core.tests.helpers.volumes import get_volumes, get_volumes_with_vvds, get_volume_and_unit
1818
from ansible.plugins.action import ActionBase
1919
import sys
2020
from mock import MagicMock
@@ -158,6 +158,20 @@ def volumes_with_vvds(ansible_zos_module, request):
158158
yield volumes_with_vvds
159159

160160

161+
@pytest.fixture(scope="session")
162+
def volumes_unit_on_systems(ansible_zos_module, request):
163+
""" Call the pytest-ansible plugin to check volumes on the system and work properly a list by session."""
164+
path = request.config.getoption("--zinventory")
165+
list_volumes = None
166+
167+
if path is None:
168+
src = request.config.getoption("--zinventory-raw")
169+
helper = ZTestHelper.from_args(src)
170+
list_volumes = helper.get_volume_and_unit()
171+
else:
172+
list_volumes = get_volume_and_unit(ansible_zos_module, path)
173+
174+
yield list_volumes
161175

162176
# * We no longer edit sys.modules directly to add zoautil_py mock
163177
# * because automatic teardown is not performed, leading to mock pollution

0 commit comments

Comments
 (0)