@@ -245,6 +245,10 @@ def test_uss_encoding_conversion_uss_file_to_uss_file(ansible_zos_module):
245
245
assert result .get ("dest" ) == uss_dest_file
246
246
assert result .get ("backup_name" ) is None
247
247
assert result .get ("changed" ) is True
248
+ assert result .get ("encoding" ) is not None
249
+ assert isinstance (result .get ("encoding" ), dict )
250
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
251
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
248
252
249
253
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_file } " )
250
254
for result in tag_results .contacted .values ():
@@ -274,6 +278,9 @@ def test_uss_encoding_conversion_uss_file_to_uss_path(ansible_zos_module):
274
278
assert result .get ("dest" ) == uss_dest_path
275
279
assert result .get ("backup_name" ) is None
276
280
assert result .get ("changed" ) is True
281
+ assert isinstance (result .get ("encoding" ), dict )
282
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
283
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
277
284
278
285
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_path } /{ path .basename (uss_file )} " )
279
286
for result in tag_results .contacted .values ():
@@ -306,6 +313,9 @@ def test_uss_encoding_conversion_uss_path_to_uss_path(ansible_zos_module):
306
313
assert result .get ("dest" ) == uss_dest_path
307
314
assert result .get ("backup_name" ) is not None
308
315
assert result .get ("changed" ) is True
316
+ assert isinstance (result .get ("encoding" ), dict )
317
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
318
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
309
319
310
320
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_path } " )
311
321
for result in tag_results .contacted .values ():
@@ -338,6 +348,9 @@ def test_uss_encoding_conversion_uss_file_to_mvs_ps(ansible_zos_module):
338
348
assert result .get ("dest" ) == mvs_ps
339
349
assert result .get ("backup_name" ) is None
340
350
assert result .get ("changed" ) is True
351
+ assert isinstance (result .get ("encoding" ), dict )
352
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
353
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
341
354
finally :
342
355
hosts .all .file (path = uss_file , state = "absent" )
343
356
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
@@ -365,6 +378,9 @@ def test_uss_encoding_conversion_mvs_ps_to_uss_file(ansible_zos_module):
365
378
assert result .get ("dest" ) == uss_dest_file
366
379
assert result .get ("backup_name" ) is not None
367
380
assert result .get ("changed" ) is True
381
+ assert isinstance (result .get ("encoding" ), dict )
382
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
383
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
368
384
369
385
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_file } " )
370
386
for result in tag_results .contacted .values ():
@@ -397,6 +413,9 @@ def test_uss_encoding_conversion_uss_file_to_mvs_pds(ansible_zos_module):
397
413
assert result .get ("dest" ) == mvs_ps
398
414
assert result .get ("backup_name" ) is None
399
415
assert result .get ("changed" ) is True
416
+ assert isinstance (result .get ("encoding" ), dict )
417
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
418
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
400
419
finally :
401
420
hosts .all .file (path = uss_file , state = "absent" )
402
421
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
@@ -435,6 +454,9 @@ def test_uss_encoding_conversion_uss_file_to_mvs_pds_member(ansible_zos_module):
435
454
assert result .get ("dest" ) == mvs_pds_member
436
455
assert result .get ("backup_name" ) is None
437
456
assert result .get ("changed" ) is True
457
+ assert isinstance (result .get ("encoding" ), dict )
458
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
459
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
438
460
finally :
439
461
hosts .all .file (path = uss_file , state = "absent" )
440
462
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
@@ -471,6 +493,9 @@ def test_uss_encoding_conversion_mvs_pds_member_to_uss_file(ansible_zos_module):
471
493
assert result .get ("dest" ) == uss_dest_file
472
494
assert result .get ("backup_name" ) is not None
473
495
assert result .get ("changed" ) is True
496
+ assert isinstance (result .get ("encoding" ), dict )
497
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
498
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
474
499
475
500
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_file } " )
476
501
for result in tag_results .contacted .values ():
@@ -509,6 +534,10 @@ def test_uss_encoding_conversion_uss_path_to_mvs_pds(ansible_zos_module):
509
534
assert result .get ("dest" ) == mvs_ps
510
535
assert result .get ("backup_name" ) is None
511
536
assert result .get ("changed" ) is True
537
+ assert isinstance (result .get ("encoding" ), dict )
538
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
539
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
540
+
512
541
hosts .all .file (path = uss_dest_path , state = "directory" )
513
542
results = hosts .all .zos_encode (
514
543
src = mvs_ps ,
@@ -524,6 +553,9 @@ def test_uss_encoding_conversion_uss_path_to_mvs_pds(ansible_zos_module):
524
553
assert result .get ("dest" ) == uss_dest_path
525
554
assert result .get ("backup_name" ) is None
526
555
assert result .get ("changed" ) is True
556
+ assert isinstance (result .get ("encoding" ), dict )
557
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
558
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
527
559
528
560
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_path } " )
529
561
for result in tag_results .contacted .values ():
@@ -559,6 +591,9 @@ def test_uss_encoding_conversion_mvs_ps_to_mvs_pds_member(ansible_zos_module):
559
591
assert result .get ("dest" ) == mvs_pds_member
560
592
assert result .get ("backup_name" ) is None
561
593
assert result .get ("changed" ) is True
594
+ assert isinstance (result .get ("encoding" ), dict )
595
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
596
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
562
597
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
563
598
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
564
599
@@ -575,10 +610,11 @@ def test_uss_encoding_conversion_uss_file_to_mvs_vsam(ansible_zos_module):
575
610
cmd = f"echo { quote (KSDS_CREATE_JCL .format (mvs_vs ))} > { temp_jcl_path } /SAMPLE"
576
611
)
577
612
results = hosts .all .zos_job_submit (
578
- src = f"{ temp_jcl_path } /SAMPLE" , location = "uss" , wait_time_s = 30
613
+ src = f"{ temp_jcl_path } /SAMPLE" , remote_src = True , wait_time = 30
579
614
)
580
615
581
616
for result in results .contacted .values ():
617
+ print (result )
582
618
assert result .get ("jobs" )[0 ].get ("ret_code" ).get ("msg_code" ) == "0000"
583
619
assert result .get ("jobs" )[0 ].get ("ret_code" ).get ("code" ) == 0
584
620
assert result .get ("changed" ) is True
@@ -595,6 +631,9 @@ def test_uss_encoding_conversion_uss_file_to_mvs_vsam(ansible_zos_module):
595
631
assert result .get ("dest" ) == mvs_vs
596
632
assert result .get ("backup_name" ) is None
597
633
assert result .get ("changed" ) is True
634
+ assert isinstance (result .get ("encoding" ), dict )
635
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
636
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
598
637
finally :
599
638
hosts .all .file (path = temp_jcl_path , state = "absent" )
600
639
hosts .all .file (path = uss_file , state = "absent" )
@@ -623,6 +662,9 @@ def test_uss_encoding_conversion_mvs_vsam_to_uss_file(ansible_zos_module):
623
662
assert result .get ("dest" ) == uss_dest_file
624
663
assert result .get ("backup_name" ) is not None
625
664
assert result .get ("changed" ) is True
665
+ assert isinstance (result .get ("encoding" ), dict )
666
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
667
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
626
668
627
669
tag_results = hosts .all .shell (cmd = f"ls -T { uss_dest_file } " )
628
670
for result in tag_results .contacted .values ():
@@ -658,6 +700,10 @@ def test_uss_encoding_conversion_mvs_vsam_to_mvs_ps(ansible_zos_module):
658
700
assert result .get ("dest" ) == mvs_ps
659
701
assert result .get ("backup_name" ) is None
660
702
assert result .get ("changed" ) is True
703
+ assert isinstance (result .get ("encoding" ), dict )
704
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
705
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
706
+
661
707
hosts .all .zos_data_set (name = mvs_vs , state = "absent" )
662
708
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
663
709
@@ -691,6 +737,10 @@ def test_uss_encoding_conversion_mvs_vsam_to_mvs_pds_member(ansible_zos_module):
691
737
assert result .get ("dest" ) == mvs_pds_member
692
738
assert result .get ("backup_name" ) is None
693
739
assert result .get ("changed" ) is True
740
+ assert result .get ("encoding" ) is not None
741
+ assert isinstance (result .get ("encoding" ), dict )
742
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
743
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
694
744
hosts .all .zos_data_set (name = mvs_vs , state = "absent" )
695
745
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
696
746
@@ -707,7 +757,7 @@ def test_uss_encoding_conversion_mvs_ps_to_mvs_vsam(ansible_zos_module):
707
757
cmd = f"echo { quote (KSDS_CREATE_JCL .format (mvs_vs ))} > { temp_jcl_path } /SAMPLE"
708
758
)
709
759
results = hosts .all .zos_job_submit (
710
- src = f"{ temp_jcl_path } /SAMPLE" , location = "uss" , wait_time_s = 30
760
+ src = f"{ temp_jcl_path } /SAMPLE" , remote_src = True , wait_time = 30
711
761
)
712
762
for result in results .contacted .values ():
713
763
assert result .get ("jobs" ) is not None
@@ -728,6 +778,10 @@ def test_uss_encoding_conversion_mvs_ps_to_mvs_vsam(ansible_zos_module):
728
778
assert result .get ("dest" ) == mvs_vs
729
779
assert result .get ("backup_name" ) is None
730
780
assert result .get ("changed" ) is True
781
+ assert result .get ("encoding" ) is not None
782
+ assert isinstance (result .get ("encoding" ), dict )
783
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
784
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
731
785
finally :
732
786
hosts .all .file (path = temp_jcl_path , state = "absent" )
733
787
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
@@ -755,6 +809,10 @@ def test_uss_encoding_conversion_src_with_special_chars(ansible_zos_module):
755
809
assert result .get ("backup_name" ) is None
756
810
assert result .get ("changed" ) is True
757
811
assert result .get ("msg" ) is None
812
+ assert result .get ("encoding" ) is not None
813
+ assert isinstance (result .get ("encoding" ), dict )
814
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
815
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
758
816
759
817
finally :
760
818
hosts .all .zos_data_set (name = src_data_set , state = "absent" )
@@ -813,6 +871,10 @@ def test_pds_backup_with_tmp_hlq_option(ansible_zos_module):
813
871
)
814
872
for enc_res in encode_res .contacted .values ():
815
873
assert enc_res .get ("backup_name" )[:6 ] == tmphlq
874
+ assert enc_res .get ("encoding" ) is not None
875
+ assert isinstance (enc_res .get ("encoding" ), dict )
876
+ assert enc_res .get ("encoding" ).get ("to" ) == FROM_ENCODING
877
+ assert enc_res .get ("encoding" ).get ("from" ) == TO_ENCODING
816
878
contents = hosts .all .shell (cmd = "cat \" //'{0}(SAMPLE)'\" " .format (enc_res .get ("backup_name" )))
817
879
hosts .all .file (path = temp_jcl_path , state = "absent" )
818
880
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
@@ -873,7 +935,7 @@ def test_vsam_backup(ansible_zos_module):
873
935
cmd = f"echo { quote (KSDS_CREATE_JCL .format (mvs_vs ))} > { temp_jcl_path } /SAMPLE"
874
936
)
875
937
hosts .all .zos_job_submit (
876
- src = f"{ temp_jcl_path } /SAMPLE" , location = "uss" , wait_time_s = 30
938
+ src = f"{ temp_jcl_path } /SAMPLE" , remote_src = True , wait_time = 30
877
939
)
878
940
hosts .all .file (path = temp_jcl_path , state = "absent" )
879
941
# submit JCL to populate KSDS
@@ -882,7 +944,7 @@ def test_vsam_backup(ansible_zos_module):
882
944
cmd = f"echo { quote (KSDS_REPRO_JCL .format (mvs_vs .upper ()))} > { temp_jcl_path } /SAMPLE"
883
945
)
884
946
hosts .all .zos_job_submit (
885
- src = f"{ temp_jcl_path } /SAMPLE" , location = "uss" , wait_time_s = 30
947
+ src = f"{ temp_jcl_path } /SAMPLE" , remote_src = True , wait_time = 30
886
948
)
887
949
888
950
hosts .all .zos_encode (
@@ -958,6 +1020,10 @@ def test_uss_backup_entire_folder_to_default_backup_location(ansible_zos_module)
958
1020
backup_name = None
959
1021
for result in results .contacted .values ():
960
1022
backup_name = result .get ("backup_name" )
1023
+ assert result .get ("encoding" ) is not None
1024
+ assert isinstance (result .get ("encoding" ), dict )
1025
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
1026
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
961
1027
assert backup_name
962
1028
contents = hosts .all .shell (cmd = f"cat { backup_name } file1" )
963
1029
content1 = ""
@@ -1026,6 +1092,10 @@ def test_uss_backup_entire_folder_to_default_backup_location_compressed(
1026
1092
backup_name = None
1027
1093
for result in results .contacted .values ():
1028
1094
backup_name = result .get ("backup_name" )
1095
+ assert result .get ("encoding" ) is not None
1096
+ assert isinstance (result .get ("encoding" ), dict )
1097
+ assert result .get ("encoding" ).get ("to" ) == FROM_ENCODING
1098
+ assert result .get ("encoding" ).get ("from" ) == TO_ENCODING
1029
1099
1030
1100
results = hosts .all .shell (cmd = f"ls -la { backup_name [:- 4 ]} *" )
1031
1101
for result in results .contacted .values ():
@@ -1058,6 +1128,10 @@ def test_return_backup_name_on_module_success_and_failure(ansible_zos_module):
1058
1128
for content in enc_ds .contacted .values ():
1059
1129
assert content .get ("backup_name" ) is not None
1060
1130
assert content .get ("backup_name" ) == backup_data_set
1131
+ assert content .get ("encoding" ) is not None
1132
+ assert isinstance (content .get ("encoding" ), dict )
1133
+ assert content .get ("encoding" ).get ("to" ) == TO_ENCODING
1134
+ assert content .get ("encoding" ).get ("from" ) == FROM_ENCODING
1061
1135
1062
1136
hosts .all .zos_data_set (name = backup_data_set , state = "absent" )
1063
1137
enc_ds = hosts .all .zos_encode (
@@ -1074,6 +1148,10 @@ def test_return_backup_name_on_module_success_and_failure(ansible_zos_module):
1074
1148
assert content .get ("msg" ) is not None
1075
1149
assert content .get ("backup_name" ) is not None
1076
1150
assert content .get ("backup_name" ) == backup_data_set
1151
+ assert content .get ("encoding" ) is not None
1152
+ assert isinstance (content .get ("encoding" ), dict )
1153
+ assert content .get ("encoding" ).get ("to" ) == TO_ENCODING
1154
+ assert content .get ("encoding" ).get ("from" ) == INVALID_ENCODING
1077
1155
finally :
1078
1156
hosts .all .zos_data_set (name = mvs_ps , state = "absent" )
1079
1157
hosts .all .zos_data_set (name = backup_data_set , state = "absent" )
@@ -1101,6 +1179,10 @@ def test_gdg_encoding_conversion_src_with_invalid_generation(ansible_zos_module,
1101
1179
assert "not cataloged" in result .get ("msg" )
1102
1180
assert result .get ("backup_name" ) is None
1103
1181
assert result .get ("changed" ) is False
1182
+ assert result .get ("encoding" ) is not None
1183
+ assert isinstance (result .get ("encoding" ), dict )
1184
+ assert result .get ("encoding" ).get ("to" ) == TO_ENCODING
1185
+ assert result .get ("encoding" ).get ("from" ) == FROM_ENCODING
1104
1186
finally :
1105
1187
hosts .all .shell (cmd = f"""drm "{ ds_name } (0)" """ )
1106
1188
hosts .all .shell (cmd = f"drm { ds_name } " )
0 commit comments