Skip to content

Commit ae042ba

Browse files
[Enabler][zos_zfs_resize] Updated zos_zfs_resize test that failed on ansible 2.18 (#2240)
* Updated test * Added changelogs * Update 2240-fix2.18-zos_zfs_resize.yml
1 parent 8666829 commit ae042ba

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trivial:
2+
- test_zos_zfs_resize_func.py - modified test case `test_grow_n_shrink_operations_trace_ds_not_created` and `test_grow_n_shrink_operations_trace_ds`
3+
to resolve issues when testing ansible 2.18.
4+
(https://github.com/ansible-collections/ibm_zos_core/pull/2240).

tests/functional/modules/test_zos_zfs_resize_func.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,10 @@ def test_grow_n_shrink_operations_trace_ds(ansible_zos_module, trace_destination
655655
assert result.get('new_free_space') >= result.get('old_free_space')
656656
assert result.get('space_type') == "k"
657657
assert "Printing contents of table at address" in result.get("stdout")
658-
cmd = "dcat \"{0}\" ".format(trace_destination_ds)
658+
cmd = "dcat \"{0}\" | wc -l".format(trace_destination_ds)
659659
output_of_trace_file = hosts.all.shell(cmd=cmd)
660660
for out in output_of_trace_file.contacted.values():
661-
assert out.get("stdout") is not None
661+
assert int(out.get("stdout")) != 0
662662
assert result.get('stderr') == ""
663663
assert result.get('stderr_lines') == []
664664

@@ -687,10 +687,10 @@ def test_grow_n_shrink_operations_trace_ds(ansible_zos_module, trace_destination
687687
assert result.get('new_free_space') <= result.get('old_free_space')
688688
assert result.get('space_type') == "k"
689689
assert "print of in-memory trace table has completed" in result.get('stdout')
690-
cmd = "dcat \"{0}\" ".format(trace_destination_ds_s)
690+
cmd = "dcat \"{0}\" | wc -l".format(trace_destination_ds_s)
691691
output_of_trace_file = hosts.all.shell(cmd=cmd)
692692
for out in output_of_trace_file.contacted.values():
693-
assert out.get("stdout") is not None
693+
assert int(out.get("stdout")) != 0
694694
assert result.get('stderr') == ""
695695
assert result.get('stderr_lines') == []
696696

@@ -736,10 +736,10 @@ def test_grow_n_shrink_operations_trace_ds_not_created(ansible_zos_module, trace
736736
assert result.get('new_free_space') >= result.get('old_free_space')
737737
assert result.get('space_type') == "k"
738738
assert "Printing contents of table at address" in result.get("stdout")
739-
cmd = "dcat \"{0}\" ".format(trace_destination_ds)
739+
cmd = "dcat \"{0}\" | wc -l".format(trace_destination_ds)
740740
output_of_trace_file = hosts.all.shell(cmd=cmd)
741741
for out in output_of_trace_file.contacted.values():
742-
assert out.get("stdout") is not None
742+
assert int(out.get("stdout")) != 0
743743
assert result.get('stderr') == ""
744744
assert result.get('stderr_lines') == []
745745

@@ -762,10 +762,10 @@ def test_grow_n_shrink_operations_trace_ds_not_created(ansible_zos_module, trace
762762
assert result.get('new_free_space') <= result.get('old_free_space')
763763
assert result.get('space_type') == "k"
764764
assert "print of in-memory trace table has completed" in result.get('stdout')
765-
cmd = "dcat \"{0}\" ".format(trace_destination_ds_s)
765+
cmd = "dcat \"{0}\" | wc -l".format(trace_destination_ds_s)
766766
output_of_trace_file = hosts.all.shell(cmd=cmd)
767767
for out in output_of_trace_file.contacted.values():
768-
assert out.get("stdout") is not None
768+
assert int(out.get("stdout")) != 0
769769
assert result.get('stderr') == ""
770770
assert result.get('stderr_lines') == []
771771

0 commit comments

Comments
 (0)