From be49b1767766fa697e1191cf34bf8b7182123e55 Mon Sep 17 00:00:00 2001 From: ddimatos Date: Fri, 14 Apr 2023 07:49:22 -0700 Subject: [PATCH 1/4] Add a test case for symbols using an existing volume on our test system Signed-off-by: ddimatos --- .../functional/modules/test_zos_copy_func.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/functional/modules/test_zos_copy_func.py b/tests/functional/modules/test_zos_copy_func.py index 1f148b597..1f9c3aec0 100644 --- a/tests/functional/modules/test_zos_copy_func.py +++ b/tests/functional/modules/test_zos_copy_func.py @@ -1769,6 +1769,47 @@ def test_copy_pds_to_existing_pds(ansible_zos_module, args): hosts.all.zos_data_set(name=dest, state="absent") +@pytest.mark.pdse +def test_copy_pds_member_with_system_symbol(ansible_zos_module,): + """This test is for bug #543 in GitHub. In some versions of ZOAU, + datasets.listing can't handle system symbols in volume names and + therefore fails to get details from a dataset. + """ + hosts = ansible_zos_module + # The volume for this dataset should use a system symbol. + # This dataset and member should be available on any z/OS system. + src = "SYS1.SAMPLIB(IZUPRM00)" + dest = "USER.TEST.PDS.DEST" + + try: + hosts.all.zos_data_set( + name=dest, + state="present", + type="pdse", + replace=True + ) + + copy_res = hosts.all.zos_copy(src=src, dest=dest, remote_src=True) + verify_copy = hosts.all.shell( + cmd="mls {0}".format(dest), + executable=SHELL_EXECUTABLE + ) + + for result in copy_res.contacted.values(): + assert result.get("msg") is None + assert result.get("changed") is True + assert result.get("dest") == dest + + for v_cp in verify_copy.contacted.values(): + assert v_cp.get("rc") == 0 + stdout = v_cp.get("stdout") + assert stdout is not None + assert len(stdout.splitlines()) == 1 + + finally: + hosts.all.zos_data_set(name=dest, state="absent") + + @pytest.mark.pdse def test_copy_multiple_data_set_members(ansible_zos_module): hosts = ansible_zos_module From b1ee7ea56ad9896f0fbf5629f14c1bd1be1a564b Mon Sep 17 00:00:00 2001 From: ddimatos Date: Fri, 14 Apr 2023 07:56:04 -0700 Subject: [PATCH 2/4] Add changelog fragment Signed-off-by: ddimatos --- changelogs/fragments/739-zos_copy-volume-symbol-test.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/fragments/739-zos_copy-volume-symbol-test.yml diff --git a/changelogs/fragments/739-zos_copy-volume-symbol-test.yml b/changelogs/fragments/739-zos_copy-volume-symbol-test.yml new file mode 100644 index 000000000..eccf8f319 --- /dev/null +++ b/changelogs/fragments/739-zos_copy-volume-symbol-test.yml @@ -0,0 +1,5 @@ +trivial: +- zos_copy - prior, there was no test case for a special character on a volume. + This change adds a test case to test a volume which has in it a special + character, issue 738. + (https://github.com/ansible-collections/ibm_zos_core/pull/739) From 8b04329835785f0afd31776f7fe465420d8c0f67 Mon Sep 17 00:00:00 2001 From: Demetri Date: Fri, 14 Apr 2023 16:16:50 -0700 Subject: [PATCH 3/4] Update 739-zos_copy-volume-symbol-test.yml Update description to use symbols overs special chars. --- changelogs/fragments/739-zos_copy-volume-symbol-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelogs/fragments/739-zos_copy-volume-symbol-test.yml b/changelogs/fragments/739-zos_copy-volume-symbol-test.yml index eccf8f319..b5dfad5ee 100644 --- a/changelogs/fragments/739-zos_copy-volume-symbol-test.yml +++ b/changelogs/fragments/739-zos_copy-volume-symbol-test.yml @@ -1,5 +1,5 @@ trivial: -- zos_copy - prior, there was no test case for a special character on a volume. - This change adds a test case to test a volume which has in it a special - character, issue 738. +- zos_copy - prior, there was no test case for symbols on a volume. + This change adds a test case to test a volume which has in it symbols, + issue 738. (https://github.com/ansible-collections/ibm_zos_core/pull/739) From 0e0d95990bcdc014d577d88aa53f0f14e91380c6 Mon Sep 17 00:00:00 2001 From: ddimatos Date: Sat, 15 Apr 2023 13:07:55 -0700 Subject: [PATCH 4/4] Update test case with added comments Signed-off-by: ddimatos --- tests/functional/modules/test_zos_copy_func.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/functional/modules/test_zos_copy_func.py b/tests/functional/modules/test_zos_copy_func.py index b763c2dd2..dbe878158 100644 --- a/tests/functional/modules/test_zos_copy_func.py +++ b/tests/functional/modules/test_zos_copy_func.py @@ -1862,6 +1862,10 @@ def test_copy_pds_member_with_system_symbol(ansible_zos_module,): """This test is for bug #543 in GitHub. In some versions of ZOAU, datasets.listing can't handle system symbols in volume names and therefore fails to get details from a dataset. + + Note: `listcat ent('SYS1.SAMPLIB') all` will display 'volser = ******' + and `D SYMBOLS` will show you that `&SYSR2. = "RES80A"` where + the symbols for this volume correspond to volume `RES80A` """ hosts = ansible_zos_module # The volume for this dataset should use a system symbol.