From fa91c95c37835d0cac17e5bff1bf9f2080bb79d7 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Wed, 17 Jul 2024 16:09:20 -0400 Subject: [PATCH] lock vsam snapshot Signed-off-by: MarkAckert --- .../init/__snapshots__/vsam.test.ts.snap | 157 +++++++++++++++--- .../src/__tests__/init/vsam.test.ts | 6 +- 2 files changed, 138 insertions(+), 25 deletions(-) diff --git a/tests/zwe-remote-integration/src/__tests__/init/__snapshots__/vsam.test.ts.snap b/tests/zwe-remote-integration/src/__tests__/init/__snapshots__/vsam.test.ts.snap index 8c83f914bd..e19ad35262 100644 --- a/tests/zwe-remote-integration/src/__tests__/init/__snapshots__/vsam.test.ts.snap +++ b/tests/zwe-remote-integration/src/__tests__/init/__snapshots__/vsam.test.ts.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`init-vsam (LONG) creates vsam 1`] = ` -" -$ Temporary directory '/tmp/.zweenv-0000' created. +"Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. +bos extend currSize=0x0 dataSize=0x105b chunk=0x1000 extend=0x105b ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -80,13 +80,10 @@ $$ //* Overridden by the higher entries. //* PARMLIB member must be named "ZWEYAML" //* -//* Do not remove the defaults.yaml entry. -//* //* Ex. PARMLIB MY.ZOWE.CUSTOM.PARMLIB -//* FILE /the/zowe/defaults.yaml +//* FILE /some/other/zowe.yaml //MYCONFIG DD *,DLM=$$ FILE /test/dir/zowe.test.yaml -FILE /test/dir/files/defaults.yaml $$ //CMGROUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* @@ -181,8 +178,120 @@ Template JCL: TEST.DATASET.PFX.SZWESAMP(ZWECSVSM) , Executable JCL: TEST.DATASET Submitting Job ZWECSVSM Job ZWECSVSM(JOB00000) completed with RC=0 ->> Zowe Caching Service VSAM storage is created successfully. -" +>> Zowe Caching Service VSAM storage is created successfully." +`; + +exports[`init-vsam (LONG) creates vsam: short-before-all-vsam 1`] = ` +"Temporary directory '/tmp/.zweenv-0000' created. +Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. +bos extend currSize=0x0 dataSize=0x1057 chunk=0x1000 extend=0x1057 +Template JCL: TEST.DATASET.PFX.SZWESAMP(ZWEGENER) +--- JCL content --- +//ZWEGENER JOB +//* +//* This program and the accompanying materials are made available +//* under the terms of the Eclipse Public License v2.0 which +//* accompanies this distribution, and is available at +//* https://www.eclipse.org/legal/epl-v20.html +//* +//* SPDX-License-Identifier: EPL-2.0 +//* +//* Copyright Contributors to the Zowe Project. 2020, 2020 +//* +//********************************************************************* +//* +//* This job is responsible for generating other jobs required +//* to configure Zowe. +//* +//* The method of validating your configuration is using +//* JSON Schema . Zowe provides +//* the ConfigMgr to assist in this. This job will invoke +//* the ConfigMgr to validate your current configuration +//* before generating any jobs. If there are any values +//* that are incorrect, you will be notified. You should +//* fix the value and then run this job again. You can run +//* this job as many times as you need. +//* +//* Configmgr documentation: +//* https://docs.zowe.org/stable/user-guide/configmgr-using +//* +//* Note: Any string with braces has an associated yaml value +//* in one of the yaml definitions for Zowe. +//* You must find the value and substitute it. +//* +//* {key} -> value +//* +//GENER EXEC PGM=IKJEFT1B +//ISPPROF DD DSN=,DISP=(NEW,DELETE),UNIT=, +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120,DSORG=PO), +// SPACE=(3120,(20,5,10)) +//* +//* Replace TEST.DATASET.PFX with the +//* Value as seen in zowe.yaml +//* +//SYSPROC DD DSN=TEST.DATASET.PFX.SZWEEXEC,DISP=SHR +//* +//* Replace TEST.DATASET.PFX with the +//* Value as seen in zowe.yaml +//* +//STEPLIB DD DSN=TEST.DATASET.PFX.SZWELOAD,DISP=SHR +//ISPPLIB DD DSN=ISP.SISPPENU,DISP=SHR +//ISPMLIB DD DSN=ISP.SISPMENU,DISP=SHR +//ISPTLIB DD DSN=ISP.SISPTENU,DISP=SHR +//ISPSLIB DD DSN=ISP.SISPSENU,DISP=SHR +//* +//* The order must be as follows. +//* +//* zowe-yaml-schema.json +//* server-common.json +//* +//* Replace /test/dir with where your Zowe run time +//* directory is, as seen in zowe.yaml +//* +//MYSCHEMA DD *,DLM=$$ +FILE /test/dir/schemas/zowe-yaml-schema.json +FILE /test/dir/schemas/server-common.json +$$ +//* +//* The DD below must include one or more FILE or PARMLIB +//* Entries. The lower entries have their values +//* Overridden by the higher entries. +//* PARMLIB member must be named "ZWEYAML" +//* +//* Ex. PARMLIB MY.ZOWE.CUSTOM.PARMLIB +//* FILE /some/other/zowe.yaml +//MYCONFIG DD *,DLM=$$ +FILE /test/dir/zowe.test.yaml +$$ +//CMGROUT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//SYSTSPRT DD SYSOUT=* +//* +//* Change 'generate' to 'nogenerate' if you only +//* want to validate your configuration. The default +//* option, 'generate', will validate and then generate +//* jobs based on your configuration. +//* +//* - generate +//* - nogenerate +//* +//* Change 'noverbose' to 'verbose' below for +//* advanced logging. This is not needed unless +//* there is an error. +//* +//* - verbose +//* - noverbose +//* +//SYSTSIN DD * +ISPSTART CMD(%ZWEGEN00 - +generate - +noverbose - +) + +--- End of JCL --- +Submitting Job ZWEGENER +Job ZWEGENER(JOB00000) completed with RC=0 +Zowe JCL generated successfully" `; exports[`init-vsam (SHORT) invalid NONRLS configurations 1`] = ` @@ -197,7 +306,7 @@ Validity Exceptions(s) with object at exports[`init-vsam (SHORT) invalid NONRLS configurations 2`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x103b chunk=0x1000 extend=0x103b +bos extend currSize=0x0 dataSize=0x104b chunk=0x1000 extend=0x104b ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -207,7 +316,7 @@ ERROR: Error ZWEL0157E: VSAM parameter (zowe.setup.vsam.volume) is not defined i exports[`init-vsam (SHORT) invalid NONRLS configurations 3`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1036 chunk=0x1000 extend=0x1036 +bos extend currSize=0x0 dataSize=0x1046 chunk=0x1000 extend=0x1046 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -217,7 +326,7 @@ ERROR: Error ZWEL0157E: VSAM parameter (zowe.setup.vsam.name) is not defined in exports[`init-vsam (SHORT) invalid NONRLS configurations 4`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1034 chunk=0x1000 extend=0x1034 +bos extend currSize=0x0 dataSize=0x1044 chunk=0x1000 extend=0x1044 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -236,7 +345,7 @@ Validity Exceptions(s) with object at exports[`init-vsam (SHORT) invalid NONRLS configurations 6`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x102d chunk=0x1000 extend=0x102d +bos extend currSize=0x0 dataSize=0x103d chunk=0x1000 extend=0x103d ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -246,7 +355,7 @@ ERROR: Error ZWEL0157E: VSAM parameter (zowe.setup.vsam.volume) is not defined i exports[`init-vsam (SHORT) invalid NONRLS configurations 7`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x103f chunk=0x1000 extend=0x103f +bos extend currSize=0x0 dataSize=0x104f chunk=0x1000 extend=0x104f ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -265,7 +374,7 @@ Validity Exceptions(s) with object at exports[`init-vsam (SHORT) invalid RLS configurations 2`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x103e chunk=0x1000 extend=0x103e +bos extend currSize=0x0 dataSize=0x104e chunk=0x1000 extend=0x104e ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -284,7 +393,7 @@ Validity Exceptions(s) with object at exports[`init-vsam (SHORT) invalid RLS configurations 4`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1030 chunk=0x1000 extend=0x1030 +bos extend currSize=0x0 dataSize=0x1040 chunk=0x1000 extend=0x1040 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -294,7 +403,7 @@ ERROR: Error ZWEL0157E: VSAM parameter (zowe.setup.vsam.storageClass) is not def exports[`init-vsam (SHORT) invalid RLS configurations 5`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x103f chunk=0x1000 extend=0x103f +bos extend currSize=0x0 dataSize=0x104f chunk=0x1000 extend=0x104f ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -304,7 +413,7 @@ ERROR: Error ZWEL0157E: VSAM parameter (zowe.setup.vsam.storageClass) is not def exports[`init-vsam (SHORT) simple --dry-run 1`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x104b chunk=0x1000 extend=0x104b +bos extend currSize=0x0 dataSize=0x105b chunk=0x1000 extend=0x105b ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -381,7 +490,7 @@ To perform command, re-run command without "--dry-run" flag, or submit the JCL d exports[`init-vsam (SHORT) skip non-vsam caching service 1`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1051 chunk=0x1000 extend=0x1051 +bos extend currSize=0x0 dataSize=0x1061 chunk=0x1000 extend=0x1061 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -420,7 +529,7 @@ Validity Exceptions(s) with object at Validity Exceptions(s) with object at /zowe Validity Exceptions(s) with object at /zowe/setup Validity Exceptions(s) with object at /zowe/setup/dataset - type 'null' not permitted at /zowe/setup/dataset/prefix; expecting type 'string'" + type 'null' not permitted at /zowe/setup/dataset/jcllib; expecting type 'string'" `; exports[`init-vsam (SHORT) unset jcllib 2`] = ` @@ -429,9 +538,9 @@ Validity Exceptions(s) with object at Validity Exceptions(s) with object at /zowe Validity Exceptions(s) with object at /zowe/setup Validity Exceptions(s) with object at /zowe/setup/dataset - Validity Exceptions(s) with string at /zowe/setup/dataset/prefix - string too short (len=0) '' 0 < MIN=3 at /zowe/setup/dataset/prefix - string pattern match fail s='', pat='^([A-Z\\$\\#\\@]){1}([A-Z0-9\\$\\#\\@\\-]){0,7}(\\.([A-Z\\$\\#\\@]){1}([A-Z0-9\\$\\#\\@\\-]){0,7}){0,11}$', at /zowe/setup/dataset/prefix" + Validity Exceptions(s) with string at /zowe/setup/dataset/jcllib + string too short (len=0) '' 0 < MIN=3 at /zowe/setup/dataset/jcllib + string pattern match fail s='', pat='^([A-Z\\$\\#\\@]){1}([A-Z0-9\\$\\#\\@\\-]){0,7}(\\.([A-Z\\$\\#\\@]){1}([A-Z0-9\\$\\#\\@\\-]){0,7}){0,11}$', at /zowe/setup/dataset/jcllib" `; exports[`init-vsam (SHORT) unset vsam mode 1`] = ` @@ -455,7 +564,7 @@ Validity Exceptions(s) with object at exports[`init-vsam (SHORT) valid NONRLS configurations 1`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1041 chunk=0x1000 extend=0x1041 +bos extend currSize=0x0 dataSize=0x1051 chunk=0x1000 extend=0x1051 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets @@ -532,7 +641,7 @@ To perform command, re-run command without "--dry-run" flag, or submit the JCL d exports[`init-vsam (SHORT) valid RLS configuration 1`] = ` "Temporary directory '/tmp/.zweenv-0000' created. Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed. -bos extend currSize=0x0 dataSize=0x1044 chunk=0x1000 extend=0x1044 +bos extend currSize=0x0 dataSize=0x1054 chunk=0x1000 extend=0x1054 ------------------------------------------------------------------------------- >> Initialize Zowe custom data sets diff --git a/tests/zwe-remote-integration/src/__tests__/init/vsam.test.ts b/tests/zwe-remote-integration/src/__tests__/init/vsam.test.ts index 0e75618131..bac021918f 100644 --- a/tests/zwe-remote-integration/src/__tests__/init/vsam.test.ts +++ b/tests/zwe-remote-integration/src/__tests__/init/vsam.test.ts @@ -60,7 +60,11 @@ describe(`${testSuiteName}`, () => { describe('(SHORT)', () => { beforeAll(async () => { - await testRunner.runZweTest(cfgYaml, 'init generate'); + cfgYaml = ZoweConfig.getZoweYaml(); + const result = await testRunner.runZweTest(cfgYaml, 'init generate --allow-overwrite'); + expect(result.stdout).not.toBeNull(); + expect(result.cleanedStdout).toMatchSnapshot('short-before-all-vsam'); + expect(result.rc).toBe(0); }); it('skip non-vsam caching service', async () => {