diff options
author | Keighron, Lori (lk2924) <lk2924@us.att.com> | 2019-11-11 17:53:30 -0500 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2019-11-20 01:34:04 +0000 |
commit | 7b1313a9d6621f8c16dee4a21136f7d825a42c1d (patch) | |
tree | bbbede0a3f99bd7cabc3ddd6425c7416008462f2 /appc-sequence-generator/appc-sequence-generator-bundle | |
parent | d6801d69b3d29ce0aa99d3214f7cf4bfd02fb706 (diff) |
Add vm caps fixes to sequence-generator code (vm caps)
Add vm caps fixes to sequence-generator code (vm caps)
output/start.json not needed
Change-Id: Id3f65d2780d9d92ab971c9c6ed5ab60669135808
Issue-ID: APPC-1787
Signed-off-by: Keighron, Lori (lk2924) <lk2924@att.com>
Diffstat (limited to 'appc-sequence-generator/appc-sequence-generator-bundle')
20 files changed, 906 insertions, 113 deletions
diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/dgplugin/impl/SequenceGeneratorPluginImpl.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/dgplugin/impl/SequenceGeneratorPluginImpl.java index 111085e18..25e8d872f 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/dgplugin/impl/SequenceGeneratorPluginImpl.java +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/dgplugin/impl/SequenceGeneratorPluginImpl.java @@ -72,12 +72,12 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin { SequenceGeneratorInput sequenceGeneratorInput = buildSequenceGeneratorInput(inputJSON); List<Transaction> sequence = generateSequence(sequenceGeneratorInput); if (sequence.isEmpty()) { - logger.error("Error generating sequence"); + logger.error("Transaction list is empty"); context.setAttribute("error-code", "450"); context.setAttribute("error-message", "Request is not supported"); } else { String output = objectMapper.writeValueAsString(sequence); - logger.debug("Sequence Generator Output " + output); + logger.info("Sequence Generator Output " + output); context.setAttribute("output", output); } } catch (Exception e) { @@ -294,11 +294,14 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin { Vserver vserver = new Vserver(); vserver.setId(vserverId); vserver.setUrl(vmId); - if (vm.get("vnfc")!=null&& vm.get("vnfc").get("vnfc-name") != null && vm.get("vnfc").get("vnfc-type")!= null) { - Vnfc vfc = new Vnfc(); - vfc.setVnfcType(vm.get("vnfc").get("vnfc-type").asText()); - vfc.setVnfcName(vm.get("vnfc").get("vnfc-name").asText()); - vfc.setVnfcFunctionCode(vm.get("vnfc").get("vnfc-function-code").asText()); + Vnfc vfc = new Vnfc(); + if (vm.get("vnfc") != null ) { + if (vm.get("vnfc").get("vnfc-name") != null) + vfc.setVnfcName(vm.get("vnfc").get("vnfc-name").asText()); + if (vm.get("vnfc").get("vnfc-type") != null) + vfc.setVnfcType(vm.get("vnfc").get("vnfc-type").asText()); + if (vm.get("vnfc").get("vnfc-function-code") != null) + vfc.setVnfcFunctionCode(vm.get("vnfc").get("vnfc-function-code").asText()); vserver.setVnfc(vfc); List<Vserver> vServers = vfcs.get(vfc); if (vServers == null) { @@ -318,6 +321,7 @@ public class SequenceGeneratorPluginImpl implements SequenceGeneratorPlugin { return new InventoryModel(vnf); } + private CapabilityModel buildCapabilitiesModel(String inputJson) throws IOException, APPCException { logger.info("Entering buildCapabilitiesModel"); diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/RestartSequenceGenerator.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/RestartSequenceGenerator.java index 2f5080d0b..5c83df4e0 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/RestartSequenceGenerator.java +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/RestartSequenceGenerator.java @@ -32,6 +32,7 @@ import org.onap.appc.seqgen.SequenceGenerator; import org.onap.appc.seqgen.objects.ActionIdentifier; import org.onap.appc.seqgen.objects.Constants; import org.onap.appc.seqgen.objects.Constants.Action; +import org.onap.appc.seqgen.objects.Constants.ResponseAction; import org.onap.appc.seqgen.objects.Response; import org.onap.appc.seqgen.objects.SequenceGeneratorInput; import org.onap.appc.seqgen.objects.Transaction; @@ -59,8 +60,7 @@ public class RestartSequenceGenerator implements SequenceGenerator{ PayloadGenerator payloadGenerator = new PayloadGenerator(); for (Vserver vm : vservers) { // check vm-Restart-capabilities for this vm's vnfc-function-code (before incrementing transactionId) - String vmVnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); - if (!vmSupportsRestart(input, vmVnfcFunctionCode)) { + if (!vmSupportsRestart(input, vm)) { continue; } Transaction transactionStop = new Transaction(); @@ -79,9 +79,9 @@ public class RestartSequenceGenerator implements SequenceGenerator{ Response failureResponse = new Response(); failureResponse.setResponseMessage(Constants.ResponseMessage.FAILURE.getResponse()); Map<String,String> failureAction = new HashMap<>(); - //if(!checkLastVM(vservers,vm.getId())) - //{ - failureAction.put(Constants.ResponseAction.STOP.getAction(), String.valueOf(transactionId+1)); + //if(!checkLastVM(vservers,vm.getId())) { + //failureAction.put(Constants.ResponseAction.STOP.getAction(), String.valueOf(transactionId+1)); + failureAction.put(ResponseAction.STOP.getAction(), Boolean.TRUE.toString()); failureResponse.setResponseAction(failureAction); transactionStop.addResponse(failureResponse); //} @@ -101,10 +101,9 @@ public class RestartSequenceGenerator implements SequenceGenerator{ Response failureResponse = new Response(); failureResponse.setResponseMessage(Constants.ResponseMessage.FAILURE.getResponse()); Map<String,String> failureAction = new HashMap<>(); - //if(!checkLastVM(vservers,vm.getId())) - //{ - //failureAction.put(Constants.ResponseAction.JUMP.getAction(),transactionId.toString()); - failureAction.put(Constants.ResponseAction.STOP.getAction(),transactionId.toString()); + //if(!checkLastVM(vservers,vm.getId())) { + //failureAction.put(Constants.ResponseAction.JUMP.getAction(),transactionId.toString()); + failureAction.put(ResponseAction.STOP.getAction(), Boolean.TRUE.toString()); failureResponse.setResponseAction(failureAction); transactionStart.addResponse(failureResponse); //} @@ -114,28 +113,37 @@ public class RestartSequenceGenerator implements SequenceGenerator{ return transactionList; } - private boolean vmSupportsRestart(SequenceGeneratorInput input, String vnfcFunctionCode) { + private boolean vmSupportsRestart(SequenceGeneratorInput input, Vserver vm) { boolean vmSupported = true; if (input.getCapability() == null) { logger.info("vmSupportsRestart: " + "Capabilities model is null, returning vmSupported=" + vmSupported); return vmSupported; } Map<String, List<String>> vmCapabilities = input.getCapability().getVmCapabilities(); - logger.info("vmSupportsRestart: vnfcFunctionCode=" + vnfcFunctionCode + ", vmCapabilities=" + vmCapabilities); if (vmCapabilities != null) { if (!vmCapabilities.isEmpty()) { - vmSupported = false; - if (vmCapabilities.get(Action.RESTART.getActionType()) != null) { - if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { - for (String enabledFuncCode : vmCapabilities.get(Action.RESTART.getActionType()) ) { - if (enabledFuncCode.equalsIgnoreCase(vnfcFunctionCode)) { - vmSupported = true; - logger.info("vmSupportsRestart: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilties"); - break; + List<String> vmCapsForThisAction = vmCapabilities.get(Action.RESTART.getActionType()); + if (vmCapsForThisAction != null) { + vmSupported = false; + if (!vmCapsForThisAction.isEmpty()) { + if (vm.getVnfc() != null) { + String vnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); + if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { + for (String s : vmCapabilities.get(Action.RESTART.getActionType()) ) { + if (s.equalsIgnoreCase(vnfcFunctionCode)) { + vmSupported = true; + logger.info("vmSupportsRestart: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilities"); + break; + } + } + } else { + logger.info("vmSupportsRestart: " + "Inventory vnfcFunctionCode is null or empty"); } - } + } else { + logger.info("vmSupportsRestart: " + "Inventory vnfc is null or empty"); + } } else { - logger.info("vmSupportsRestart: " + "Inventory vnfcFunctionCode is null or empty"); + logger.info("vmSupportsRestart: " + "Given action in vm entry in Capabilities model is empty"); } } else { logger.info("vmSupportsRestart: " + "Given action in vm entry in Capabilities model is null"); @@ -147,10 +155,11 @@ public class RestartSequenceGenerator implements SequenceGenerator{ logger.info("vmSupportsRestart: " + "Vm entry in Capabilities model is null"); } - logger.info("vmSupportsRestart: " + "returning vmSupported=" + vmSupported); + logger.info("vmSupportsRestart: " + "returning vmSupported=" + vmSupported + ", " + ((vmSupported)?"including":"excluding") + " vm=" + vm.getId()); return vmSupported; } + private boolean checkLastVM(List<Vserver> vservers, String vmId){ Vserver vm= vservers.get(vservers.size()-1); return vm.getId().equals(vmId); diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StartSequenceGenerator.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StartSequenceGenerator.java index 105173f33..f709374e8 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StartSequenceGenerator.java +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StartSequenceGenerator.java @@ -78,8 +78,7 @@ public class StartSequenceGenerator implements SequenceGenerator { List<Integer> transactionIds = new LinkedList<>(); for (Vserver vm : vservers) { // check vm-Start-capabilities for this vm's vnfc-function-code (before incrementing transactionId) - String vmVnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); - if (!vmSupportsStart(input, vmVnfcFunctionCode)) { + if (!vmSupportsStart(input, vm)) { continue; } Transaction transaction = new Transaction(); @@ -139,8 +138,7 @@ public class StartSequenceGenerator implements SequenceGenerator { if(!vms.isEmpty()) { for (Vserver vm : vms) { // check vm-Start-capabilities for this vm's vnfc-function-code (before incrementing transactionId) - String vmVnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); - if (!vmSupportsStart(input, vmVnfcFunctionCode)) { + if (!vmSupportsStart(input, vm)) { continue; } Transaction transaction = new Transaction(); @@ -336,28 +334,37 @@ public class StartSequenceGenerator implements SequenceGenerator { } } - private boolean vmSupportsStart(SequenceGeneratorInput input, String vnfcFunctionCode) { + private boolean vmSupportsStart(SequenceGeneratorInput input, Vserver vm) { boolean vmSupported = true; if (input.getCapability() == null) { logger.info("vmSupportsStart: " + "Capabilities model is null, returning vmSupported=" + vmSupported); return vmSupported; } Map<String, List<String>> vmCapabilities = input.getCapability().getVmCapabilities(); - logger.info("vmSupportsStart: vnfcFunctionCode=" + vnfcFunctionCode + ", vmCapabilities=" + vmCapabilities); if (vmCapabilities != null) { if (!vmCapabilities.isEmpty()) { - vmSupported = false; - if (vmCapabilities.get(Action.START.getActionType()) != null) { - if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { - for (String enabledFuncCode : vmCapabilities.get(Action.START.getActionType()) ) { - if (enabledFuncCode.equalsIgnoreCase(vnfcFunctionCode)) { - vmSupported = true; - logger.info("vmSupportsStart: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilties"); - break; + List<String> vmCapsForThisAction = vmCapabilities.get(Action.START.getActionType()); + if (vmCapsForThisAction != null) { + vmSupported = false; + if (!vmCapsForThisAction.isEmpty()) { + if (vm.getVnfc() != null) { + String vnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); + if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { + for (String s : vmCapabilities.get(Action.START.getActionType()) ) { + if (s.equalsIgnoreCase(vnfcFunctionCode)) { + vmSupported = true; + logger.info("vmSupportsStart: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilities"); + break; + } + } + } else { + logger.info("vmSupportsStart: " + "Inventory vnfcFunctionCode is null or empty"); } - } + } else { + logger.info("vmSupportsStart: " + "Inventory vnfc is null or empty"); + } } else { - logger.info("vmSupportsStart: " + "Inventory vnfcFunctionCode is null or empty"); + logger.info("vmSupportsStart: " + "Given action in vm entry in Capabilities model is empty"); } } else { logger.info("vmSupportsStart: " + "Given action in vm entry in Capabilities model is null"); @@ -369,7 +376,7 @@ public class StartSequenceGenerator implements SequenceGenerator { logger.info("vmSupportsStart: " + "Vm entry in Capabilities model is null"); } - logger.info("vmSupportsStart: " + "returning vmSupported=" + vmSupported); + logger.info("vmSupportsStart: " + "returning vmSupported=" + vmSupported + ", " + ((vmSupported)?"including":"excluding") + " vm=" + vm.getId()); return vmSupported; } }
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StopSequenceGenerator.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StopSequenceGenerator.java index 8b60dede4..c0d161a9a 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StopSequenceGenerator.java +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/impl/StopSequenceGenerator.java @@ -83,7 +83,7 @@ public class StopSequenceGenerator implements SequenceGenerator { } } - private List<Transaction> generateSequenceWithOutDependency(SequenceGeneratorInput input)throws Exception{ + private List<Transaction> generateSequenceWithOutDependency(SequenceGeneratorInput input) throws Exception{ String payload = null; PayloadGenerator payloadGenerator = new PayloadGenerator(); List<Transaction> transactionList = new LinkedList<>(); @@ -92,8 +92,7 @@ public class StopSequenceGenerator implements SequenceGenerator { List<Integer> transactionIds = new LinkedList<>(); for (Vserver vm : vservers) { // check vm-Stop-capabilities for this vm's vnfc-function-code (before incrementing transactionId) - String vmVnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); - if (!vmSupportsStop(input, vmVnfcFunctionCode)) { + if (!vmSupportsStop(input, vm)) { continue; } Transaction transaction = new Transaction(); @@ -121,7 +120,8 @@ public class StopSequenceGenerator implements SequenceGenerator { return transactionList; } - private List<Transaction> generateSequenceWithDependencyModel(VnfcFlowModel flowModel,SequenceGeneratorInput input){ + private List<Transaction> generateSequenceWithDependencyModel(VnfcFlowModel flowModel, + SequenceGeneratorInput input) throws Exception { List<Transaction> transactionList = new LinkedList<>(); Integer transactionId = 1; List<Integer> transactionIds = new LinkedList<>(); @@ -149,8 +149,7 @@ public class StopSequenceGenerator implements SequenceGenerator { } List<Vserver> vms = vnfc.getVserverList(); for(Vserver vm:vms){ - String vmVnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); - if (!vmSupportsStop(input, vmVnfcFunctionCode)) { + if (!vmSupportsStop(input, vm)) { continue; } Transaction transaction = new Transaction(); @@ -175,7 +174,8 @@ public class StopSequenceGenerator implements SequenceGenerator { return transactionList; } - private VnfcFlowModel buildFlowModel(InventoryModel inventoryModel, VnfcDependencyModel dependencyModel, FlowStrategies flowStrategy) throws APPCException, InvalidDependencyModelException { + private VnfcFlowModel buildFlowModel(InventoryModel inventoryModel, VnfcDependencyModel dependencyModel, + FlowStrategies flowStrategy) throws APPCException, InvalidDependencyModelException { FlowBuilder flowBuilder = FlowBuilderFactory.getInstance().getFlowBuilder(flowStrategy); if (flowBuilder == null) { throw new APPCException("Flow Strategy not supported " + flowStrategy); @@ -201,7 +201,8 @@ public class StopSequenceGenerator implements SequenceGenerator { List<Vserver> vservers = input.getInventoryModel().getVnf().getVservers(); for (Vserver vm : vservers) { if(!(vm.getVnfc()!=null&& vm.getVnfc().getVnfcType()!=null&& vm.getVnfc().getVnfcName()!=null)){ - vnfcPresent=false;break; + vnfcPresent=false; + break; } } return vnfcPresent; @@ -213,34 +214,44 @@ public class StopSequenceGenerator implements SequenceGenerator { return true; } List<String> vnfcCapabilities = capability.getVnfcCapabilities(); - if(vnfcCapabilities!=null) - return vnfcCapabilities.stream().anyMatch(p -> Capabilties.STOP_APPLICATION.getCapability().equalsIgnoreCase(p)); + if(vnfcCapabilities != null) + return vnfcCapabilities.stream() + .anyMatch(p -> Capabilties.STOP_APPLICATION.getCapability().equalsIgnoreCase(p)); return false; } - private boolean vmSupportsStop(SequenceGeneratorInput input, String vnfcFunctionCode) { + private boolean vmSupportsStop(SequenceGeneratorInput input, Vserver vm) { boolean vmSupported = true; if (input.getCapability() == null) { logger.info("vmSupportsStop: " + "Capabilities model is null, returning vmSupported=" + vmSupported); return vmSupported; } Map<String, List<String>> vmCapabilities = input.getCapability().getVmCapabilities(); - logger.info("vmSupportsStop: vnfcFunctionCode=" + vnfcFunctionCode + ", vmCapabilities=" + vmCapabilities); if (vmCapabilities != null) { if (!vmCapabilities.isEmpty()) { - vmSupported = false; - if (vmCapabilities.get(Action.STOP.getActionType()) != null) { - if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { - for (String enabledFuncCode : vmCapabilities.get(Action.STOP.getActionType()) ) { - if (enabledFuncCode.equalsIgnoreCase(vnfcFunctionCode)) { - vmSupported = true; - logger.info("vmSupportsStop: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilties"); - break; + List<String> vmCapsForThisAction = vmCapabilities.get(Action.STOP.getActionType()); + if (vmCapsForThisAction != null) { + vmSupported = false; + if (!vmCapsForThisAction.isEmpty()) { + if (vm.getVnfc() != null) { + String vnfcFunctionCode = vm.getVnfc().getVnfcFunctionCode(); + if (vnfcFunctionCode != null && !vnfcFunctionCode.isEmpty()) { + for (String s : vmCapabilities.get(Action.STOP.getActionType()) ) { + if (s.equalsIgnoreCase(vnfcFunctionCode)) { + vmSupported = true; + logger.info("vmSupportsStop: vnfcFunctionCode=" + vnfcFunctionCode + " found in vmCapabilities"); + break; + } + } + } else { + logger.info("vmSupportsStop: " + "Inventory vnfcFunctionCode is null or empty"); } - } + } else { + logger.info("vmSupportsStop: " + "Inventory vnfc is null or empty"); + } } else { - logger.info("vmSupportsStop: " + "Inventory vnfcFunctionCode is null or empty"); + logger.info("vmSupportsStop: " + "Given action in vm entry in Capabilities model is empty"); } } else { logger.info("vmSupportsStop: " + "Given action in vm entry in Capabilities model is null"); @@ -252,7 +263,7 @@ public class StopSequenceGenerator implements SequenceGenerator { logger.info("vmSupportsStop: " + "Vm entry in Capabilities model is null"); } - logger.info("vmSupportsStop: " + "returning vmSupported=" + vmSupported); + logger.info("vmSupportsStop: " + "returning vmSupported=" + vmSupported + ", " + ((vmSupported)?"including":"excluding") + " vm=" + vm.getId()); return vmSupported; } }
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/onap/appc/seqgen/TestSequenceGeneratorPlugin.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/onap/appc/seqgen/TestSequenceGeneratorPlugin.java index 5fddce12b..c5d82baba 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/onap/appc/seqgen/TestSequenceGeneratorPlugin.java +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/onap/appc/seqgen/TestSequenceGeneratorPlugin.java @@ -29,7 +29,9 @@ import java.util.HashMap; import java.util.Map; import org.junit.Assert; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestName; import org.onap.appc.seqgen.dgplugin.SequenceGeneratorPlugin; import org.onap.appc.seqgen.dgplugin.impl.SequenceGeneratorPluginImpl; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; @@ -38,12 +40,16 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; public class TestSequenceGeneratorPlugin { + @Rule + public final TestName thisTestName = new TestName(); private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestSequenceGeneratorPlugin.class); private SequenceGeneratorPlugin seqImpl; @Test public void testGenerateSequenceStart() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/start.json"); Map<String,String> params = new HashMap<>(); @@ -60,6 +66,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceWODependencyInfo()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/start-withoutDependency.json"); Map<String,String> params = new HashMap<>(); @@ -76,6 +84,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceSingleVM()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/start-singleVM-.json"); Map<String,String> params = new HashMap<>(); @@ -92,6 +102,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceNoStrategy() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/no-strategy.json"); Map<String,String> params = new HashMap<>(); @@ -109,6 +121,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceStop() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/stop.json"); Map<String,String> params = new HashMap<>(); @@ -126,6 +140,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceWrongNumber() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/wrongnumber.json"); Map<String,String> params = new HashMap<>(); @@ -137,7 +153,7 @@ public class TestSequenceGeneratorPlugin { String errorCode = context.getAttribute("error-code"); String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); + logger.info("errorCode = " + errorCode); Assert.assertEquals(errorCode,"401"); Assert.assertEquals(errorMessage,"Error generating sequence Invalid Number for Wait Time 6a"); } @@ -145,6 +161,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceCyclic() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/cyclic.json"); Map<String,String> params = new HashMap<>(); @@ -156,13 +174,15 @@ public class TestSequenceGeneratorPlugin { String errorCode = context.getAttribute("error-code"); String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); + logger.info("errorCode = " + errorCode); Assert.assertEquals(errorCode,"401"); Assert.assertEquals(errorMessage,"Error generating sequence There seems to be no Root/Independent node for Vnfc dependencies"); } @Test public void testGenerateSequenceWrongAction() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/wrongaction.json"); Map<String,String> params = new HashMap<>(); @@ -174,7 +194,7 @@ public class TestSequenceGeneratorPlugin { String errorCode = context.getAttribute("error-code"); String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); + logger.info("errorCode = " + errorCode); Assert.assertEquals(errorCode,"401"); Assert.assertEquals(errorMessage,"Error generating sequence Invalid Action start"); } @@ -182,6 +202,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceMissingRequestInfo() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/missingrequestinfo.json"); Map<String,String> params = new HashMap<>(); @@ -200,6 +222,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceStopSingleVM() throws URISyntaxException, IOException{ + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/stop-singleVM.json"); Map<String,String> params = new HashMap<>(); @@ -216,6 +240,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceStopSingleVmPerVnfc() throws URISyntaxException, IOException{ + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/stop-singleVmPerVnfc.json"); Map<String,String> params = new HashMap<>(); @@ -232,6 +258,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceRestartNoDep() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/restartNodep.json"); Map<String,String> params = new HashMap<>(); @@ -241,14 +269,16 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String outputJSON = context.getAttribute("output"); - String actualOutput = readOutput("/output/restart-NoDep.json"); + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/restart-NoDep.json"); outputJSON.trim(); Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } @Test public void testGenerateSequenceRestartNoDepSingleVM() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/NoDep-SingleVM.json"); Map<String,String> params = new HashMap<>(); @@ -258,13 +288,15 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String outputJSON = context.getAttribute("output"); - String actualOutput = readOutput("/output/restart-Nodep-SingleVM.json"); + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/restart-Nodep-SingleVM.json"); Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } @Test public void testGenerateSequenceStartSingleVmPerVnfc() throws URISyntaxException, IOException{ + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/start-singleVmPerVnfc-.json"); Map<String,String> params = new HashMap<>(); @@ -281,6 +313,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceVnfcNotPresentInInventory() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/CheckVNfcInInventory.json"); Map<String,String> params = new HashMap<>(); @@ -297,6 +331,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceCheckMandatoryVnfc() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/CheckMandatoryVnfc.json"); Map<String,String> params = new HashMap<>(); @@ -315,6 +351,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceCheckMissingDependencyInfo() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/MissingDependencyInfo.json"); Map<String,String> params = new HashMap<>(); @@ -333,6 +371,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceExtraVnfcInDependency() throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/WrongDependencyModel.json"); Map<String,String> params = new HashMap<>(); @@ -351,6 +391,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceStartWithVmStartCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StartWithVmStartCaps.json"); Map<String,String> params = new HashMap<>(); @@ -367,6 +409,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceRestartWithVmRestartCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/RestartWithVmRestartCaps.json"); Map<String,String> params = new HashMap<>(); @@ -376,13 +420,15 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String outputJSON = context.getAttribute("output"); - String actualOutput = readOutput("/output/RestartWithVmRestartCaps.json"); + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/RestartWithVmRestartCaps.json"); Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } @Test public void testGenerateSequenceStopWithVmStopCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StopWithVmStopCaps.json"); Map<String,String> params = new HashMap<>(); @@ -399,6 +445,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceStartWithoutAnyCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StartWithoutAnyCaps.json"); Map<String,String> params = new HashMap<>(); @@ -415,6 +463,8 @@ public class TestSequenceGeneratorPlugin { @Test public void testGenerateSequenceRestartWithoutAnyCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/RestartWithoutAnyCaps.json"); Map<String,String> params = new HashMap<>(); @@ -424,13 +474,15 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String outputJSON = context.getAttribute("output"); - String actualOutput = readOutput("/output/RestartWithoutAnyCaps.json"); + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/RestartWithoutAnyCaps.json"); Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } @Test public void testGenerateSequenceStopWithoutAnyCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StopWithoutAnyCaps.json"); Map<String,String> params = new HashMap<>(); @@ -440,12 +492,15 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String outputJSON = context.getAttribute("output"); - String actualOutput = readOutput("/output/StopWithoutAnyCaps.json"); + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/StopWithoutAnyCaps.json"); Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } + @Test public void testGenerateSequenceStartWithoutVmStartCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StartWithoutVmStartCaps.json"); Map<String,String> params = new HashMap<>(); @@ -455,15 +510,14 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String errorCode = context.getAttribute("error-code"); - String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); - Assert.assertEquals("450", errorCode); - Assert.assertEquals("Request is not supported", errorMessage); + String actualOutput = context.getAttribute("output"); + Assert.assertEquals(null, actualOutput); } @Test public void testGenerateSequenceRestartWithoutVmRestartCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/RestartWithoutVmRestartCaps.json"); Map<String,String> params = new HashMap<>(); @@ -473,15 +527,14 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String errorCode = context.getAttribute("error-code"); - String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); - Assert.assertEquals("450", errorCode); - Assert.assertEquals("Request is not supported", errorMessage); + String actualOutput = context.getAttribute("output"); + Assert.assertEquals(null, actualOutput); } @Test public void testGenerateSequenceStopWithoutVmStopCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + String inputJSON = readInput("/input/StopWithoutVmStopCaps.json"); Map<String,String> params = new HashMap<>(); @@ -491,17 +544,122 @@ public class TestSequenceGeneratorPlugin { SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); plugin.generateSequence(params,context); - String errorCode = context.getAttribute("error-code"); - String errorMessage = context.getAttribute("error-message"); - logger.debug("errorCode = " + errorCode); - Assert.assertEquals("450", errorCode); - Assert.assertEquals("Request is not supported", errorMessage); + String actualOutput = context.getAttribute("output"); + Assert.assertEquals(null, actualOutput); + } + + @Test + public void testGenerateSequenceStartWithEmptyVmCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/StartWithEmptyVmCaps.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/StartWithoutAnyCaps.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); + } + + @Test + public void testGenerateSequenceRestartWithEmptyVmCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/RestartWithEmptyVmCaps.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/RestartWithoutAnyCaps.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); + } + + @Test + public void testGenerateSequenceStopWithEmptyVmCaps()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/StopWithEmptyVmCaps.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/StopWithoutAnyCaps.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); + } + + @Test + public void testGenerateSequenceStartWithVmStartCapsAndMissingVnfcInfo()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/StartWithVmStartCapsAndMissingVnfcInfo.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/StartWithVmStartCapsAndMissingVnfcInfo.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); + } + + @Test + public void testGenerateSequenceStopWithVmStopCapsAndMissingVnfcInfo()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/StopWithVmStopCapsAndMissingVnfcInfo.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/StopWithVmStopCapsAndMissingVnfcInfo.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); + } + + @Test + public void testGenerateSequenceRestartWithVmRestartCapsAndMissingVnfcInfo()throws URISyntaxException, IOException { + logger.info("****** Running test: " + thisTestName.getMethodName() + " ******"); + + String inputJSON = readInput("/input/RestartWithVmRestartCapsAndMissingVnfcInfo.json"); + + Map<String,String> params = new HashMap<>(); + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute("inputJSON",inputJSON); + + SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl(); + plugin.generateSequence(params,context); + + String actualOutput = context.getAttribute("output"); + String outputJSON = readOutput("/output/RestartWithVmRestartCapsAndMissingVnfcInfo.json"); + Assert.assertEquals(outputJSON.trim(),actualOutput.trim()); } private String readInput(String inputFile) throws URISyntaxException, IOException { return new String(Files.readAllBytes(Paths.get(this.getClass().getResource(inputFile).toURI())), "UTF-8"); } - + private String readOutput(String outputFile) throws IOException,URISyntaxException { String output = new String(Files.readAllBytes(Paths.get(this.getClass().getResource(outputFile).toURI())), "UTF-8"); int start=output.indexOf("["); diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithEmptyVmCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithEmptyVmCaps.json new file mode 100644 index 000000000..8d1a1f6f1 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithEmptyVmCaps.json @@ -0,0 +1,78 @@ +{ + "request-info": { + "action": "Restart", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": " {\"vnf-host-ip-address\": \"10.147.124.163\" }" + + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "smp_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-function-code": "pld", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "FE", + "vnfc-function-code": "pld", + "vnfc-name": "FE - Name" + } + + }, + { + "vserver-id" : "fe_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "be_vserverid5", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + } + ] + } + }, + "dependency-info" : { + }, + "tunable-parameters" : { + "strategy" : "FORWARD", + "waitTime" : "120", + "retryCount" : "5" + }, + "capabilities" : { + "vm" : [], + "vnfc" : [], + "vf-module" : [], + "vnf" : [] + } +} diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithVmRestartCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithVmRestartCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..cc46b7ce7 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/RestartWithVmRestartCapsAndMissingVnfcInfo.json @@ -0,0 +1,85 @@ +{ + "request-info": { + "action": "Restart", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": " {\"vnf-host-ip-address\": \"10.147.124.163\" }" + + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "no_vnfc_info", + "vm-id" : "vm_id1" + }, + { + "vserver-id" : "empty_vnfc_info", + "vm-id" : "vm_id1", + "vnfc": + { + } + }, + { + "vserver-id" : "nofunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "unsupportedfunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "xyz", + "vnfc-name": "BE - Name" + } + } + ] + } + }, + "dependency-info" : { + }, + "tunable-parameters" : { + "strategy" : "FORWARD", + "waitTime" : "120", + "retryCount" : "5" + }, + "capabilities" : { + "vnf": ["Stop", "Start", "StartApplication","StopApplication"], + "vf-module": ["Stop", "Start"], + "vm" : [{"Stop" :["pld", "ssc", "dbo"]}, {"Start" :["pld", "ssc", "dbo"]}, {"Restart" :["pld", "ssc", "dbo"]}], + "vnfc": ["StopApplication", "StartApplication","HealthCheck"] + } +} diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithEmptyVmCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithEmptyVmCaps.json new file mode 100644 index 000000000..35e1c691d --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithEmptyVmCaps.json @@ -0,0 +1,134 @@ + + +{ + "request-info": { + "action": "Start", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": "ABC" + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "be_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "fe_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "FE", + "vnfc-function-code": "pld", + "vnfc-name": "FE - Name" + } + + }, + { + "vserver-id" : "fe_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "FE", + "vnfc-function-code": "pld", + "vnfc-name": "FE - Name" + } + + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "be_vserverid3", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "smp_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-function-code": "pld", + "vnfc-name": "SMP - Name" + } + + }, + { + "vserver-id" : "smp_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-function-code": "pld", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid4", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "be_vserverid5", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + } + ] + } + }, + "dependency-info": { + + }, + "tunable-parameters": { + + }, + "capabilities" : { + "vm" : [], + "vnfc" : [], + "vf-module" : [], + "vnf" : [] + } +} + diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithVmStartCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithVmStartCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..2e8da4942 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StartWithVmStartCapsAndMissingVnfcInfo.json @@ -0,0 +1,85 @@ +{ + "request-info": { + "action": "Start", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": " {\"vnf-host-ip-address\": \"10.147.124.163\" }" + + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "no_vnfc_info", + "vm-id" : "vm_id1" + }, + { + "vserver-id" : "empty_vnfc_info", + "vm-id" : "vm_id1", + "vnfc": + { + } + }, + { + "vserver-id" : "nofunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "unsupportedfunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "xyz", + "vnfc-name": "BE - Name" + } + } + ] + } + }, + "dependency-info" : { + }, + "tunable-parameters" : { + "strategy" : "FORWARD", + "waitTime" : "120", + "retryCount" : "5" + }, + "capabilities" : { + "vnf": ["Stop", "Start", "StartApplication","StopApplication"], + "vf-module": ["Stop", "Start"], + "vm" : [{"Stop" :["pld", "ssc", "dbo"]}, {"Start" :["pld", "ssc", "dbo"]}, {"Restart" :["pld", "ssc", "dbo"]}], + "vnfc": ["StopApplication", "StartApplication","HealthCheck"] + } +} diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithEmptyVmCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithEmptyVmCaps.json new file mode 100644 index 000000000..3af02b596 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithEmptyVmCaps.json @@ -0,0 +1,134 @@ +{ + "request-info": { + "action": "Stop", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": " {\"vnf-host-ip-address\": \"10.147.124.163\" }" + + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "be_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "fe_vserverid1", + "vm-id" : "vm_id2", + "vnfc": + { + "vnfc-type": "FE", + "vnfc-function-code": "pld", + "vnfc-name": "FE - Name" + } + + }, + { + "vserver-id" : "fe_vserverid2", + "vm-id" : "vm_id3", + "vnfc": + { + "vnfc-type": "FE", + "vnfc-function-code": "pld", + "vnfc-name": "FE - Name" + } + + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id4", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "be_vserverid3", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "smp_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-function-code": "pld", + "vnfc-name": "SMP - Name" + } + + }, + { + "vserver-id" : "smp_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-function-code": "pld", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid4", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + }, + { + "vserver-id" : "be_vserverid5", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + + } + ] + } + }, + "dependency-info": { + }, + "tunable-parameters": { + "strategy" : "FORWARD", + "wait-time": "120", + "retry-count": "5" + }, + "capabilities" : { + "vm" : [], + "vnfc" : [], + "vf-module" : [], + "vnf" : [] + } +} + diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithVmStopCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithVmStopCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..11be55932 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithVmStopCapsAndMissingVnfcInfo.json @@ -0,0 +1,85 @@ +{ + "request-info": { + "action": "Stop", + "action-level": "vnf", + "action-identifier": { + "vnf-id": "dbgx0001v" + }, + "payload": " {\"vnf-host-ip-address\": \"10.147.124.163\" }" + + }, + "inventory-info": { + "vnf-info": { + "vnf-id" : "abc", + "vnf-name": "vSCP", + "vnf-type": "vSCP", + "vnf-version" : "1.0", + "identity-url" : "test_url", + "vm": [ + { + "vserver-id" : "no_vnfc_info", + "vm-id" : "vm_id1" + }, + { + "vserver-id" : "empty_vnfc_info", + "vm-id" : "vm_id1", + "vnfc": + { + } + }, + { + "vserver-id" : "nofunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "SMP", + "vnfc-name": "SMP - Name" + } + }, + { + "vserver-id" : "be_vserverid1", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "be_vserverid2", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "pld", + "vnfc-name": "BE - Name" + } + }, + { + "vserver-id" : "unsupportedfunctioncode", + "vm-id" : "vm_id1", + "vnfc": + { + "vnfc-type": "BE", + "vnfc-function-code": "xyz", + "vnfc-name": "BE - Name" + } + } + ] + } + }, + "dependency-info" : { + }, + "tunable-parameters" : { + "strategy" : "FORWARD", + "waitTime" : "120", + "retryCount" : "5" + }, + "capabilities" : { + "vnf": ["Stop", "Start", "StartApplication","StopApplication"], + "vf-module": ["Stop", "Start"], + "vm" : [{"Stop" :["pld", "ssc", "dbo"]}, {"Start" :["pld", "ssc", "dbo"]}, {"Restart" :["pld", "ssc", "dbo"]}], + "vnfc": ["StopApplication", "StartApplication","HealthCheck"] + } +} diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithoutAnyCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithoutAnyCaps.json index 10750615c..c075fff46 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithoutAnyCaps.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/input/StopWithoutAnyCaps.json @@ -14,11 +14,11 @@ "vnf-name": "vSCP", "vnf-type": "vSCP", "vnf-version" : "1.0", - "identity-url" : "test", + "identity-url" : "test_url", "vm": [ { "vserver-id" : "be_vserverid1", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "BE", @@ -29,7 +29,7 @@ }, { "vserver-id" : "fe_vserverid1", - "vm-id" : "vm-id2", + "vm-id" : "vm_id2", "vnfc": { "vnfc-type": "FE", @@ -40,7 +40,7 @@ }, { "vserver-id" : "fe_vserverid2", - "vm-id" : "vm-id3", + "vm-id" : "vm_id3", "vnfc": { "vnfc-type": "FE", @@ -51,7 +51,7 @@ }, { "vserver-id" : "be_vserverid2", - "vm-id" : "vm-id4", + "vm-id" : "vm_id4", "vnfc": { "vnfc-type": "BE", @@ -62,7 +62,7 @@ }, { "vserver-id" : "be_vserverid3", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "BE", @@ -73,7 +73,7 @@ }, { "vserver-id" : "smp_vserverid1", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "SMP", @@ -84,7 +84,7 @@ }, { "vserver-id" : "smp_vserverid2", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "SMP", @@ -94,7 +94,7 @@ }, { "vserver-id" : "be_vserverid4", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "BE", @@ -105,7 +105,7 @@ }, { "vserver-id" : "be_vserverid5", - "vm-id" : "vm-id1", + "vm-id" : "vm_id1", "vnfc": { "vnfc-type": "BE", diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCaps.json index 9acc7d868..de6e14535 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCaps.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCaps.json @@ -1 +1 @@ -[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]}]
\ No newline at end of file +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}]
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..1f15beb12 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithVmRestartCapsAndMissingVnfcInfo.json @@ -0,0 +1 @@ +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}] diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithoutAnyCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithoutAnyCaps.json index 9acc7d868..de6e14535 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithoutAnyCaps.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/RestartWithoutAnyCaps.json @@ -1 +1 @@ -[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]}]
\ No newline at end of file +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}]
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StartWithVmStartCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StartWithVmStartCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..bea6c7949 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StartWithVmStartCapsAndMissingVnfcInfo.json @@ -0,0 +1 @@ +[{"transactionId":1,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}] diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithVmStopCapsAndMissingVnfcInfo.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithVmStopCapsAndMissingVnfcInfo.json new file mode 100644 index 000000000..af1da43f5 --- /dev/null +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithVmStopCapsAndMissingVnfcInfo.json @@ -0,0 +1 @@ +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}] diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithoutAnyCaps.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithoutAnyCaps.json index dc3972280..926689ddb 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithoutAnyCaps.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/StopWithoutAnyCaps.json @@ -1 +1 @@ -[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid1"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id2\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id3\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id4\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid3"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid1"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid4"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":9,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test\",\"vm-id\":\"vm-id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}]
\ No newline at end of file +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id2\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id3\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id4\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid3"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid1"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid4"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":9,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}]
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/restart-NoDep.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/restart-NoDep.json index 9acc7d868..de6e14535 100755 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/restart-NoDep.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/restart-NoDep.json @@ -1 +1 @@ -[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"3"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"5"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"7"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"9"}}]}]
\ No newline at end of file +[{"transactionId":1,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":4,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Stop","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"{\"identity-url\":\"test_url\",\"vm-id\":\"vm_id1\"}","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]}]
\ No newline at end of file diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/start.json b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/start.json index 641fa9491..b70238903 100644 --- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/start.json +++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/resources/output/start.json @@ -1,2 +1,2 @@ -[{"transactionId":1,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc1_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc1_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":3,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC1 - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":1,"param-name":"status","param-value":"success"},{"pre-transactionID":2,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":4,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC1 - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc2_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc2_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":7,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc2_vserverid3"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc2_vserverid4"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":9,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc2_vserverid5"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":10,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC2 - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":5,"param-name":"status","param-value":"success"},{"pre-transactionID":6,"param-name":"status","param-value":"success"},{"pre-transactionID":7,"param-name":"status","param-value":"success"},{"pre-transactionID":8,"param-name":"status","param-value":"success"},{"pre-transactionID":9,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":11,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC2 - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":12,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc3_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":13,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"vnfc3_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"ignore":"true"}}]},{"transactionId":14,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC3 - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":12,"param-name":"status","param-value":"success"},{"pre-transactionID":13,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":15,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"VNFC3 - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]}] +[{"transactionId":1,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":2,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"smp_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":3,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"SMP - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":1,"param-name":"status","param-value":"success"},{"pre-transactionID":2,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":4,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"SMP - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":5,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":6,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":7,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid3"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":8,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid4"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":9,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"be_vserverid5"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":10,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"BE - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":5,"param-name":"status","param-value":"success"},{"pre-transactionID":6,"param-name":"status","param-value":"success"},{"pre-transactionID":7,"param-name":"status","param-value":"success"},{"pre-transactionID":8,"param-name":"status","param-value":"success"},{"pre-transactionID":9,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":11,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"BE - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":12,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid1"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":13,"action":"Start","action-level":"vm","action-identifier":{"vserver-id":"fe_vserverid2"},"payload":"ABC","responses":[{"response-message":"failure","response-action":{"stop":"true"}}]},{"transactionId":14,"action":"StartApplication","action-level":"vnfc","action-identifier":{"vnfc-name":"FE - Name"},"payload":"ABC","precheck-operator":"any","precheck-options":[{"pre-transactionID":12,"param-name":"status","param-value":"success"},{"pre-transactionID":13,"param-name":"status","param-value":"success"}],"responses":[]},{"transactionId":15,"action":"HealthCheck","action-level":"vnfc","action-identifier":{"vnfc-name":"FE - Name"},"payload":"ABC","responses":[{"response-message":"unhealthy","response-action":{"wait":"120","retry":"5"}},{"response-message":"healthy","response-action":{"continue":"true"}},{"response-message":"failure","response-action":{"stop":"true"}}]}] |