From bd30165cbc0922edf303956d84462cfa24900afb Mon Sep 17 00:00:00 2001 From: Lewis James Date: Fri, 19 Aug 2022 11:38:46 +0100 Subject: [PATCH 1/2] Adding HLQ.RUNID.LOAD to SEM RPL Signed-off-by: Lewis James --- .../java/dev/galasa/cicsts/ICicsRegion.java | 9 ++++ .../cicsts/internal/dse/DseCicsImpl.java | 6 +++ .../dev/galasa/sem/internal/SemCicsImpl.java | 14 +++++++ .../galasa/sem/internal/SemManagerImpl.java | 41 +++++++++++++++---- 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java index 433d50c05..4b09d8740 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java @@ -102,4 +102,13 @@ public interface ICicsRegion { * @throws CicstsManagerException */ public void removeSit(@NotNull String sitParam) throws CicstsManagerException; + + /** + * This method adds a method to the DFHRPL concatenation in the CICS + * startup JCL + * + * @param library + * @throws CicstsManagerException + */ + public void addToDfhRpl(@NotNull String library) throws CicstsManagerException; } \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java index 92753db00..f4e8911a8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java @@ -151,4 +151,10 @@ public void alterSit(@NotNull String sitParam, String sitValue) throws CicstsMan public void removeSit(@NotNull String sitParam) throws CicstsManagerException { throw new CicstsManagerException("Remove SIT is not supported under DSE provisioning"); } + + @Override + public void addToDfhRpl(@NotNull String library) throws CicstsManagerException { + throw new CicstsManagerException("Appending DFHRPL is not supported under DSE provisioning"); + + } } diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java index 375d45c7b..54cb94ab3 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java @@ -556,6 +556,20 @@ public void removeSit(@NotNull String sitParam) throws CicstsManagerException { } } } + + @Override + public void addToDfhRpl(String library) throws CicstsManagerException { + // Get the Galasa CICS object + ICicsRegion theCics = cicstsManager.locateCicsRegion(this.getTag()); + + // Find the SEM CICS object + for (CICSRegion cicsInComplex : complex.getCICS()) { + if (cicsInComplex.getApplid().equals(theCics.getApplid())) { + semManager.appendDfhRpl(cicsInComplex, library); + rebuildRuntimeJob(cicsInComplex); + } + } + } /** * Performs a rebuild of the given CICS job diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java index 51f6df868..05381af05 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java @@ -30,7 +30,9 @@ import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; import org.osgi.service.component.annotations.Component; +import com.ibm.hursley.cicsts.test.sem.complex.CICSRegion; import com.ibm.hursley.cicsts.test.sem.complex.Complex; +import com.ibm.hursley.cicsts.test.sem.complex.DfhRpl; import com.ibm.hursley.cicsts.test.sem.complex.RunOptions; import com.ibm.hursley.cicsts.test.sem.complex.jcl.JCLException; import com.ibm.hursley.cicsts.test.sem.complex.jcl.Job; @@ -80,6 +82,8 @@ import dev.galasa.zosbatch.ZosBatchException; import dev.galasa.zosbatch.spi.IZosBatchSpi; import dev.galasa.zosconsole.spi.IZosConsoleSpi; +import dev.galasa.zosfile.IZosDataset; +import dev.galasa.zosfile.spi.IZosFileSpi; import sem.DEFCICS; import sem.Environment; import sem.SemFactory; @@ -97,6 +101,7 @@ public class SemManagerImpl extends AbstractManager implements ICicsRegionProvis private IDynamicStatusStoreService dss; private IZosManagerSpi zosManager; + private IZosFileSpi zosFileManager; private IZosBatchSpi zosBatch; private IZosConsoleSpi zosConsole; private ICicstsManagerSpi cicsManager; @@ -185,6 +190,11 @@ public void youAreRequired(@NotNull List allManagers, @NotNull List 4) { throw new SemManagerException("SEM complex generation failed, rc=" +rc); } + + String loadLibrary = zosManager.getRunDatasetHLQ(primaryZosImage) + "." + getFramework().getTestRunName() + ".LOAD"; + IZosDataset loadLibaryDs = zosFileManager.getZosFileHandler().newDataset(loadLibrary, primaryZosImage); + + // Add the run load library to DFHRPL + if (loadLibaryDs.exists()) { + logger.debug("Found load library " + loadLibrary + " adding it to DFHRPL concatenation"); + for (CICSRegion cics : this.complex.getCICS()) { + this.appendDfhRpl(cics, zosManager.getRunDatasetHLQ(primaryZosImage) + "." + getFramework().getTestRunName() + ".LOAD"); + logger.trace("Added " + loadLibrary + " to DFHRPL in CICS region " + cics.getApplid()); + } + } else { + logger.debug("Load library " + loadLibrary + " is missing. Not adding it to DFHRPL"); + } this.conrep = this.complex.generateConRepModel(); @@ -794,13 +822,12 @@ public void cicsProvisionDiscard() { logger.info("SEM discard is complete"); } - - - - - - - + + public void appendDfhRpl(CICSRegion cics, String library) { + DfhRpl rplConcat = new DfhRpl(); + rplConcat.getDSNS().add(library); + cics.getRpl().add(0, rplConcat); + } public Environment convertModel(@NotNull String modelString) throws SemManagerException { ByteArrayInputStream bais = new ByteArrayInputStream(modelString.getBytes()); From a0b36611f0fb06bf38ebc04ea453b798756a86e5 Mon Sep 17 00:00:00 2001 From: Lewis James Date: Fri, 19 Aug 2022 20:05:54 +0100 Subject: [PATCH 2/2] Code review changes Signed-off-by: Lewis James --- .../src/main/java/dev/galasa/cicsts/ICicsRegion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java index 4b09d8740..6275f7859 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java @@ -105,7 +105,7 @@ public interface ICicsRegion { /** * This method adds a method to the DFHRPL concatenation in the CICS - * startup JCL + * startup JCL. Not allowed for DSE CICS regions. * * @param library * @throws CicstsManagerException