File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 19
19
from ibm_zos_core .tests .helpers .dataset import (
20
20
get_random_q ,
21
21
)
22
+ from ibm_zos_core .tests .helpers .volumes import (
23
+ create_vvds_on_volume ,
24
+ )
22
25
# TEST_VOL_ADDR = '0903'
23
26
# TEST_VOL_SER = 'KET999'
24
27
TEST_VOL_ADDR = '01A2'
27
30
INDEX_CREATION_SUCCESS_MSG = 'VTOC INDEX CREATION SUCCESSFUL'
28
31
VTOC_LOC_MSG = "ICK01314I VTOC IS LOCATED AT CCHH=X'0000 0001' AND IS {:4d} TRACKS."
29
32
33
+ def clear_volume (hosts , volume ):
34
+ datasets_in_volume = hosts .all .shell (cmd = "vtocls {0}" .format (volume ))
35
+ for dataset in datasets_in_volume .contacted .values ():
36
+ datasets = str (dataset .get ("stdout" )).split ("\n " )
37
+ for dataset in datasets :
38
+ dataset_t_del = dataset .split (' ' , 1 )[0 ]
39
+ hosts .all .shell (cmd = """drm "{0}" """ .format (dataset_t_del ))
30
40
31
41
# Guard Rail to prevent unintentional initialization of targeted volume.
32
42
# If this test fails, either reset target volume serial to match
35
45
36
46
def test_guard_rail_and_setup (ansible_zos_module ):
37
47
hosts = ansible_zos_module
38
- hlq = get_random_q ()
39
48
# remove all data sets from target volume. Expected to be the following 3
40
- hosts . all . zos_data_set ( name = "*" , volumes = TEST_VOL_ADDR , state = "absent" )
49
+ clear_volume ( hosts , TEST_VOL_SER )
41
50
42
51
params = {
43
52
"address" :TEST_VOL_ADDR ,
You can’t perform that action at this time.
0 commit comments