Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

ISS1078 - Adding LOAD library to DFHRPL on SEM build #802

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ public interface ICicsRegion {
*/
public void removeSit(@NotNull String sitParam) throws CicstsManagerException;


/**
lewisja1406 marked this conversation as resolved.
Show resolved Hide resolved
* This method adds a method to the DFHRPL concatenation in the CICS
* startup JCL. Not allowed for DSE CICS regions.
*
* @param library
* @throws CicstsManagerException
*/
public void addToDfhRpl(@NotNull String library) throws CicstsManagerException;


/**
* Allows a testcase to get a specific property about the region.
*
Expand All @@ -126,4 +137,5 @@ public interface ICicsRegion {
public default String getRegionProperty( String propertyName ) throws CicstsManagerException {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,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");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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;
Expand Down Expand Up @@ -82,6 +84,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;
Expand All @@ -99,6 +103,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;
Expand Down Expand Up @@ -187,6 +192,11 @@ public void youAreRequired(@NotNull List<IManager> allManagers, @NotNull List<IM
if (this.zosManager == null) {
throw new SemManagerException("Unable to locate the zOS Manager, required for the SEM Manager");
}

this.zosFileManager = addDependentManager(allManagers, activeManagers, galasaTest, IZosFileSpi.class);
if (this.zosFileManager == null) {
throw new SemManagerException("Unable to locate the zOS File Manager, required for the SEM Manager");
}

this.zosBatch = addDependentManager(allManagers, activeManagers, galasaTest, IZosBatchSpi.class);
if (this.zosBatch == null) {
Expand Down Expand Up @@ -225,6 +235,10 @@ public boolean areYouProvisionalDependentOn(@NotNull IManager otherManager) {
if (otherManager == this.zosManager) {
return true;
}

if (otherManager == this.zosFileManager) {
return true;
}

if (otherManager == this.zosBatch) {
return true;
Expand Down Expand Up @@ -428,6 +442,20 @@ private void generateComplex() throws SemManagerException {
if (rc > 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()) {
lewisja1406 marked this conversation as resolved.
Show resolved Hide resolved
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();

Expand Down Expand Up @@ -796,13 +824,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());
Expand Down