@@ -195,6 +195,11 @@ def test_query_data_set_seq_no_volume(ansible_zos_module, volumes_on_systems):
195
195
stat = result ['stat' ]
196
196
assert stat .get ('resource_type' ) == 'data_set'
197
197
assert stat .get ('name' ) == name
198
+ assert stat .get ('exists' ) is True
199
+ assert stat .get ('isfile' ) is False
200
+ assert stat .get ('isdataset' ) is True
201
+ assert stat .get ('isaggregate' ) is False
202
+ assert stat .get ('isgdg' ) is False
198
203
assert stat .get ('attributes' ) is not None
199
204
200
205
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
@@ -262,6 +267,11 @@ def test_query_data_set_pds_no_volume(ansible_zos_module, volumes_on_systems):
262
267
stat = result ['stat' ]
263
268
assert stat .get ('resource_type' ) == 'data_set'
264
269
assert stat .get ('name' ) == name
270
+ assert stat .get ('exists' ) is True
271
+ assert stat .get ('isfile' ) is False
272
+ assert stat .get ('isdataset' ) is True
273
+ assert stat .get ('isaggregate' ) is False
274
+ assert stat .get ('isgdg' ) is False
265
275
assert stat .get ('attributes' ) is not None
266
276
267
277
assert stat ['attributes' ].get ('dsorg' ) == 'po'
@@ -330,6 +340,11 @@ def test_query_data_set_pdse_no_volume(ansible_zos_module, volumes_on_systems):
330
340
stat = result ['stat' ]
331
341
assert stat .get ('resource_type' ) == 'data_set'
332
342
assert stat .get ('name' ) == name
343
+ assert stat .get ('exists' ) is True
344
+ assert stat .get ('isfile' ) is False
345
+ assert stat .get ('isdataset' ) is True
346
+ assert stat .get ('isaggregate' ) is False
347
+ assert stat .get ('isgdg' ) is False
333
348
assert stat .get ('attributes' ) is not None
334
349
335
350
assert stat ['attributes' ].get ('dsorg' ) == 'po'
@@ -394,6 +409,11 @@ def test_query_data_set_vsam_ksds(ansible_zos_module):
394
409
stat = result ['stat' ]
395
410
assert stat .get ('resource_type' ) == 'data_set'
396
411
assert stat .get ('name' ) == name
412
+ assert stat .get ('exists' ) is True
413
+ assert stat .get ('isfile' ) is False
414
+ assert stat .get ('isdataset' ) is True
415
+ assert stat .get ('isaggregate' ) is False
416
+ assert stat .get ('isgdg' ) is False
397
417
assert stat .get ('attributes' ) is not None
398
418
399
419
assert stat ['attributes' ].get ('dsorg' ) == 'vsam'
@@ -477,6 +497,11 @@ def test_query_data_set_gds(ansible_zos_module, volumes_on_systems):
477
497
stat = result ['stat' ]
478
498
assert stat .get ('resource_type' ) == 'data_set'
479
499
assert name in stat .get ('name' )
500
+ assert stat .get ('exists' ) is True
501
+ assert stat .get ('isfile' ) is False
502
+ assert stat .get ('isdataset' ) is True
503
+ assert stat .get ('isaggregate' ) is False
504
+ assert stat .get ('isgdg' ) is False
480
505
assert stat .get ('attributes' ) is not None
481
506
482
507
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
@@ -548,6 +573,11 @@ def test_query_data_set_seq_with_correct_volume(ansible_zos_module, volumes_on_s
548
573
stat = result ['stat' ]
549
574
assert stat .get ('resource_type' ) == 'data_set'
550
575
assert stat .get ('name' ) == name
576
+ assert stat .get ('exists' ) is True
577
+ assert stat .get ('isfile' ) is False
578
+ assert stat .get ('isdataset' ) is True
579
+ assert stat .get ('isaggregate' ) is False
580
+ assert stat .get ('isgdg' ) is False
551
581
assert stat .get ('attributes' ) is not None
552
582
553
583
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
@@ -609,8 +639,9 @@ def test_query_data_set_seq_with_wrong_volume(ansible_zos_module, volumes_on_sys
609
639
610
640
for result in zos_stat_result .contacted .values ():
611
641
assert result .get ('changed' , False ) is False
612
- assert result .get ('failed' ) is True
613
- assert 'could not be found' in result .get ('msg' , '' )
642
+ assert result .get ('failed' , False ) is False
643
+ assert result .get ('stat' ) is not None
644
+ assert result .get ('stat' ).get ('exists' ) is False
614
645
finally :
615
646
hosts .all .shell (
616
647
cmd = f'drm { escaped_name } '
@@ -659,6 +690,11 @@ def test_query_data_set_seq_multi_volume(ansible_zos_module, volumes_on_systems)
659
690
stat = result ['stat' ]
660
691
assert stat .get ('resource_type' ) == 'data_set'
661
692
assert stat .get ('name' ) == name
693
+ assert stat .get ('exists' ) is True
694
+ assert stat .get ('isfile' ) is False
695
+ assert stat .get ('isdataset' ) is True
696
+ assert stat .get ('isaggregate' ) is False
697
+ assert stat .get ('isgdg' ) is False
662
698
assert stat .get ('attributes' ) is not None
663
699
664
700
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
@@ -733,6 +769,11 @@ def test_query_data_set_seq_multi_volume_missing_one(ansible_zos_module, volumes
733
769
stat = result ['stat' ]
734
770
assert stat .get ('resource_type' ) == 'data_set'
735
771
assert stat .get ('name' ) == name
772
+ assert stat .get ('exists' ) is True
773
+ assert stat .get ('isfile' ) is False
774
+ assert stat .get ('isdataset' ) is True
775
+ assert stat .get ('isaggregate' ) is False
776
+ assert stat .get ('isgdg' ) is False
736
777
assert stat .get ('attributes' ) is not None
737
778
738
779
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
@@ -789,6 +830,11 @@ def test_query_gdg(ansible_zos_module):
789
830
stat = result ['stat' ]
790
831
assert stat .get ('resource_type' ) == 'gdg'
791
832
assert stat .get ('name' ) == name
833
+ assert stat .get ('exists' ) is True
834
+ assert stat .get ('isfile' ) is False
835
+ assert stat .get ('isdataset' ) is False
836
+ assert stat .get ('isaggregate' ) is False
837
+ assert stat .get ('isgdg' ) is True
792
838
assert stat .get ('attributes' ) is not None
793
839
794
840
assert stat ['attributes' ].get ('limit' ) == limit
@@ -833,6 +879,11 @@ def test_query_aggregate(ansible_zos_module):
833
879
stat = result ['stat' ]
834
880
assert stat .get ('resource_type' ) == 'aggregate'
835
881
assert stat .get ('name' ) == aggregate_name
882
+ assert stat .get ('exists' ) is True
883
+ assert stat .get ('isfile' ) is False
884
+ assert stat .get ('isdataset' ) is False
885
+ assert stat .get ('isaggregate' ) is True
886
+ assert stat .get ('isgdg' ) is False
836
887
assert stat .get ('attributes' ) is not None
837
888
838
889
assert stat ['attributes' ].get ('total_size' ) is not None
@@ -871,6 +922,11 @@ def test_query_file_no_symlink(ansible_zos_module):
871
922
stat = result ['stat' ]
872
923
assert stat .get ('resource_type' ) == 'file'
873
924
assert stat .get ('name' ) == test_file
925
+ assert stat .get ('exists' ) is True
926
+ assert stat .get ('isfile' ) is True
927
+ assert stat .get ('isdataset' ) is False
928
+ assert stat .get ('isaggregate' ) is False
929
+ assert stat .get ('isgdg' ) is False
874
930
assert stat .get ('attributes' ) is not None
875
931
876
932
for attr in EXPECTED_ATTRS ['file' ]['flat' ]:
@@ -902,6 +958,11 @@ def test_query_file_no_checksum_no_mime(ansible_zos_module):
902
958
stat = result ['stat' ]
903
959
assert stat .get ('resource_type' ) == 'file'
904
960
assert stat .get ('name' ) == test_file
961
+ assert stat .get ('exists' ) is True
962
+ assert stat .get ('isfile' ) is True
963
+ assert stat .get ('isdataset' ) is False
964
+ assert stat .get ('isaggregate' ) is False
965
+ assert stat .get ('isgdg' ) is False
905
966
assert stat .get ('attributes' ) is not None
906
967
907
968
for attr in EXPECTED_ATTRS ['file' ]['flat' ]:
@@ -949,6 +1010,11 @@ def test_query_file_symlink_follow_on(ansible_zos_module):
949
1010
stat = result ['stat' ]
950
1011
assert stat .get ('resource_type' ) == 'file'
951
1012
assert stat .get ('name' ) == test_file
1013
+ assert stat .get ('exists' ) is True
1014
+ assert stat .get ('isfile' ) is True
1015
+ assert stat .get ('isdataset' ) is False
1016
+ assert stat .get ('isaggregate' ) is False
1017
+ assert stat .get ('isgdg' ) is False
952
1018
assert stat .get ('attributes' ) is not None
953
1019
954
1020
# When following links, these two attributes should be None.
@@ -998,6 +1064,11 @@ def test_query_file_symlink_follow_off(ansible_zos_module):
998
1064
stat = result ['stat' ]
999
1065
assert stat .get ('resource_type' ) == 'file'
1000
1066
assert stat .get ('name' ) == test_file
1067
+ assert stat .get ('exists' ) is True
1068
+ assert stat .get ('isfile' ) is True
1069
+ assert stat .get ('isdataset' ) is False
1070
+ assert stat .get ('isaggregate' ) is False
1071
+ assert stat .get ('isgdg' ) is False
1001
1072
assert stat .get ('attributes' ) is not None
1002
1073
1003
1074
for attr in EXPECTED_ATTRS ['file' ]['flat' ]:
@@ -1026,8 +1097,9 @@ def test_query_data_set_non_existent(ansible_zos_module, resource_type):
1026
1097
1027
1098
for result in zos_stat_result .contacted .values ():
1028
1099
assert result .get ('changed' , False ) is False
1029
- assert result .get ('failed' ) is True
1030
- assert 'could not be found' in result .get ('msg' , '' )
1100
+ assert result .get ('failed' , False ) is False
1101
+ assert result .get ('stat' ) is not None
1102
+ assert result .get ('stat' ).get ('exists' ) is False
1031
1103
1032
1104
1033
1105
def test_query_data_set_tmp_hlq (ansible_zos_module , volumes_on_systems ):
@@ -1062,6 +1134,11 @@ def test_query_data_set_tmp_hlq(ansible_zos_module, volumes_on_systems):
1062
1134
stat = result ['stat' ]
1063
1135
assert stat .get ('resource_type' ) == 'data_set'
1064
1136
assert stat .get ('name' ) == name
1137
+ assert stat .get ('exists' ) is True
1138
+ assert stat .get ('isfile' ) is False
1139
+ assert stat .get ('isdataset' ) is True
1140
+ assert stat .get ('isaggregate' ) is False
1141
+ assert stat .get ('isgdg' ) is False
1065
1142
assert stat .get ('attributes' ) is not None
1066
1143
finally :
1067
1144
hosts .all .shell (cmd = f'drm { name } ' )
@@ -1119,6 +1196,11 @@ def test_query_data_set_seq_with_alias(ansible_zos_module, volumes_on_systems):
1119
1196
stat = result ['stat' ]
1120
1197
assert stat .get ('resource_type' ) == 'data_set'
1121
1198
assert stat .get ('name' ) == alias
1199
+ assert stat .get ('exists' ) is True
1200
+ assert stat .get ('isfile' ) is False
1201
+ assert stat .get ('isdataset' ) is True
1202
+ assert stat .get ('isaggregate' ) is False
1203
+ assert stat .get ('isgdg' ) is False
1122
1204
assert stat .get ('attributes' ) is not None
1123
1205
1124
1206
assert stat ['attributes' ].get ('dsorg' ) == 'ps'
0 commit comments