http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java new file mode 100644 index 0000000..7162cdf --- /dev/null +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java @@ -0,0 +1,394 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.stratos.integration.tests; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.stratos.autoscaler.stub.pojo.ApplicationContext; +import org.apache.stratos.common.client.AutoscalerServiceClient; +import org.apache.stratos.common.threading.StratosThreadPool; +import org.apache.stratos.messaging.domain.application.*; +import org.apache.stratos.messaging.domain.instance.ClusterInstance; +import org.apache.stratos.messaging.domain.instance.GroupInstance; +import org.apache.stratos.messaging.domain.topology.Cluster; +import org.apache.stratos.messaging.domain.topology.Member; +import org.apache.stratos.messaging.domain.topology.MemberStatus; +import org.apache.stratos.messaging.domain.topology.Service; +import org.apache.stratos.messaging.message.receiver.application.ApplicationManager; +import org.apache.stratos.messaging.message.receiver.application.ApplicationsEventReceiver; +import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver; +import org.apache.stratos.messaging.message.receiver.topology.TopologyManager; + +import java.io.File; +import java.rmi.RemoteException; +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.ExecutorService; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.assertNull; + +/** + * To start the Topology receivers + */ +public class TopologyHandler { + private static final Log log = LogFactory.getLog(TopologyHandler.class); + + public static final int APPLICATION_ACTIVATION_TIMEOUT = 120000; + public static final int APPLICATION_TOPOLOGY_TIMEOUT = 60000; + public static final String APPLICATION_STATUS_CREATED = "Created"; + public static final String APPLICATION_STATUS_UNDEPLOYING = "Undeploying"; + private ApplicationsEventReceiver applicationsEventReceiver; + private TopologyEventReceiver topologyEventReceiver; + public static TopologyHandler topologyHandler; + + private TopologyHandler() { + // Set jndi.properties.dir system property for initializing event receivers + System.setProperty("jndi.properties.dir", getResourcesFolderPath()); + System.setProperty("autoscaler.service.url", "https://localhost:9443/services/AutoscalerService"); + initializeApplicationEventReceiver(); + initializeTopologyEventReceiver(); + assertApplicationTopologyInitialized(); + assertTopologyInitialized(); + } + + public static TopologyHandler getInstance() { + if (topologyHandler == null) { + synchronized (TopologyHandler.class) { + if (topologyHandler == null) { + topologyHandler = new TopologyHandler(); + } + } + } + return topologyHandler; + } + + + /** + * Initialize application event receiver + */ + private void initializeApplicationEventReceiver() { + if (applicationsEventReceiver == null) { + applicationsEventReceiver = new ApplicationsEventReceiver(); + ExecutorService executorService = StratosThreadPool.getExecutorService("STRATOS_TEST_SERVER", 1); + applicationsEventReceiver.setExecutorService(executorService); + applicationsEventReceiver.execute(); + } + } + + /** + * Initialize Topology event receiver + */ + private void initializeTopologyEventReceiver() { + if (topologyEventReceiver == null) { + topologyEventReceiver = new TopologyEventReceiver(); + ExecutorService executorService = StratosThreadPool.getExecutorService("STRATOS_TEST_SERVER1", 1); + topologyEventReceiver.setExecutorService(executorService); + topologyEventReceiver.execute(); + } + } + + /** + * Assert application Topology initialization + */ + private void assertApplicationTopologyInitialized() { + long startTime = System.currentTimeMillis(); + boolean applicationTopologyInitialized = ApplicationManager.getApplications().isInitialized(); + while (!applicationTopologyInitialized) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + applicationTopologyInitialized = ApplicationManager.getApplications().isInitialized(); + if ((System.currentTimeMillis() - startTime) > APPLICATION_TOPOLOGY_TIMEOUT) { + break; + } + } + assertEquals(String.format("Application Topology didn't get initialized "), applicationTopologyInitialized, true); + } + + /** + * Assert Topology initialization + */ + private void assertTopologyInitialized() { + long startTime = System.currentTimeMillis(); + boolean topologyInitialized = TopologyManager.getTopology().isInitialized(); + while (!topologyInitialized) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + topologyInitialized = TopologyManager.getTopology().isInitialized(); + if ((System.currentTimeMillis() - startTime) > APPLICATION_TOPOLOGY_TIMEOUT) { + break; + } + } + assertEquals(String.format("Topology didn't get initialized "), topologyInitialized, true); + } + + /** + * Assert application activation + * + * @param applicationName + */ + public void assertApplicationActivation(String applicationName) { + long startTime = System.currentTimeMillis(); + Application application = ApplicationManager.getApplications().getApplication(applicationName); + while (!((application != null) && (application.getStatus() == ApplicationStatus.Active))) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + application = ApplicationManager.getApplications().getApplication(applicationName); + if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) { + break; + } + } + assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application); + assertEquals(String.format("Application status did not change to active: [application-id] %s", applicationName), + ApplicationStatus.Active, application.getStatus()); + } + + /** + * Assert application activation + * + * @param applicationName + */ + public void assertGroupActivation(String applicationName) { + Application application = ApplicationManager.getApplications().getApplication(applicationName); + assertNotNull(String.format("Application is not found: [application-id] %s", + applicationName), application); + + Collection<Group> groups = application.getAllGroupsRecursively(); + for (Group group : groups) { + assertEquals(group.getInstanceContextCount() >= group.getGroupMinInstances(), true); + } + } + + /** + * Assert application activation + * + * @param applicationName + */ + public void assertClusterActivation(String applicationName) { + Application application = ApplicationManager.getApplications().getApplication(applicationName); + assertNotNull(String.format("Application is not found: [application-id] %s", + applicationName), application); + + Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively(); + for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) { + String serviceName = clusterDataHolder.getServiceType(); + String clusterId = clusterDataHolder.getClusterId(); + Service service = TopologyManager.getTopology().getService(serviceName); + assertNotNull(String.format("Service is not found: [application-id] %s [service] %s", + applicationName, serviceName), service); + + Cluster cluster = service.getCluster(clusterId); + assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s", + applicationName, serviceName, clusterId), cluster); + boolean clusterActive = false; + + for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) { + int activeInstances = 0; + for (Member member : cluster.getMembers()) { + if (member.getClusterInstanceId().equals(instance.getInstanceId())) { + if (member.getStatus().equals(MemberStatus.Active)) { + activeInstances++; + } + } + } + clusterActive = activeInstances >= clusterDataHolder.getMinInstances(); + + if (!clusterActive) { + break; + } + } + assertEquals(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId), + clusterActive, true); + } + + } + + public void assertClusterMinMemberCount(String applicationName, int minMembers) { + long startTime = System.currentTimeMillis(); + + Application application = ApplicationManager.getApplications().getApplication(applicationName); + assertNotNull(String.format("Application is not found: [application-id] %s", + applicationName), application); + + Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively(); + for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) { + String serviceName = clusterDataHolder.getServiceType(); + String clusterId = clusterDataHolder.getClusterId(); + Service service = TopologyManager.getTopology().getService(serviceName); + assertNotNull(String.format("Service is not found: [application-id] %s [service] %s", + applicationName, serviceName), service); + + Cluster cluster = service.getCluster(clusterId); + assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s", + applicationName, serviceName, clusterId), cluster); + boolean clusterActive = false; + + for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) { + int activeInstances = 0; + for (Member member : cluster.getMembers()) { + if (member.getClusterInstanceId().equals(instance.getInstanceId())) { + if (member.getStatus().equals(MemberStatus.Active)) { + activeInstances++; + } + } + } + clusterActive = activeInstances >= minMembers; + + while (!clusterActive) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + service = TopologyManager.getTopology().getService(serviceName); + assertNotNull(String.format("Service is not found: [application-id] %s [service] %s", + applicationName, serviceName), service); + + cluster = service.getCluster(clusterId); + activeInstances = 0; + for (Member member : cluster.getMembers()) { + if (member.getClusterInstanceId().equals(instance.getInstanceId())) { + if (member.getStatus().equals(MemberStatus.Active)) { + activeInstances++; + } + } + } + clusterActive = activeInstances >= minMembers; + assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s", + applicationName, serviceName, clusterId), cluster); + + if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) { + break; + } + } + } + assertEquals(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId), + clusterActive, true); + } + + } + + + /** + * Assert application activation + * + * @param applicationName + */ + public boolean assertApplicationUndeploy(String applicationName) { + long startTime = System.currentTimeMillis(); + Application application = ApplicationManager.getApplications().getApplication(applicationName); + ApplicationContext applicationContext = null; + try { + applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName); + } catch (RemoteException e) { + log.error("Error while getting the application context for [application] " + applicationName); + } + while (((application != null) && application.getInstanceContextCount() > 0) || + (applicationContext == null || applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING))) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + application = ApplicationManager.getApplications().getApplication(applicationName); + try { + applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName); + } catch (RemoteException e) { + log.error("Error while getting the application context for [application] " + applicationName); + } + if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) { + break; + } + } + + assertNotNull(String.format("Application is not found: [application-id] %s", + applicationName), application); + assertNotNull(String.format("Application Context is not found: [application-id] %s", + applicationName), applicationContext); + + //Force undeployment after the graceful deployment + if (application.getInstanceContextCount() > 0 || + applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING)) { + return false; + } + assertEquals(String.format("Application status did not change to Created: [application-id] %s", applicationName), + APPLICATION_STATUS_CREATED, applicationContext.getStatus()); + return true; + } + + /** + * Assert application activation + * + * @param applicationName + */ + public void assertGroupInstanceCount(String applicationName, String groupAlias, int count) { + long startTime = System.currentTimeMillis(); + Application application = ApplicationManager.getApplications().getApplication(applicationName); + if (application != null) { + Group group = application.getGroupRecursively(groupAlias); + while (group.getInstanceContextCount() != count) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) { + break; + } + } + for (GroupInstance instance : group.getInstanceIdToInstanceContextMap().values()) { + while (!instance.getStatus().equals(GroupStatus.Active)) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) { + break; + } + } + } + assertEquals(String.format("Application status did not change to active: [application-id] %s", applicationName), + group.getInstanceContextCount(), count); + } + assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application); + + } + + public void assertApplicationNotExists(String applicationName) { + Application application = ApplicationManager.getApplications().getApplication(applicationName); + assertNull(String.format("Application is found in the topology : [application-id] %s", applicationName), application); + } + + /** + * Get resources folder path + * + * @return + */ + private String getResourcesFolderPath() { + String path = getClass().getResource("/").getPath(); + return StringUtils.removeEnd(path, File.separator); + } + + +}
http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java new file mode 100644 index 0000000..ce23728 --- /dev/null +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.stratos.integration.tests.config; + +/** + * Created by reka on 5/7/15. + */ +public class ApplicationBean { +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java new file mode 100644 index 0000000..ace17e6 --- /dev/null +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.stratos.integration.tests.config; + +/** + * Created by reka on 5/7/15. + */ +public class ApplicationConfigParser { +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java index 5ff8fd3..34a9d75 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java @@ -315,7 +315,7 @@ public class RestClient { log.error(msg + entityName); throw new RuntimeException(msg + entityName); } catch (Exception e) { - String message = "Could not add " + entityName; + String message = "Could not update " + entityName; log.error(message, e); throw new RuntimeException(message, e); } http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/application-policies/application-policy-2.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/application-policies/application-policy-2.json b/products/stratos/modules/integration/src/test/resources/application-policies/application-policy-2.json new file mode 100644 index 0000000..1137942 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/application-policies/application-policy-2.json @@ -0,0 +1,18 @@ +{ + "id": "application-policy-2", + "algorithm": "one-after-another", + "networkPartitions": [ + "network-partition-7", + "network-partition-8" + ], + "properties": [ + { + "name": "networkPartitionGroups", + "value": "network-partition-7,network-partition-8" + }, + { + "name": "key-2", + "value": "value-2" + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v1.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v1.json new file mode 100644 index 0000000..ff332c0 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v1.json @@ -0,0 +1,86 @@ +{ + "alias": "g-sc-G123-1", + "applicationId": "g-sc-G123-1", + "components": { + "cartridges": [], + "groups": [ + { + "name": "G1", + "groupMaxInstances": 1, + "groupMinInstances": 1, + "alias": "group1", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c1", + "subscribableInfo": { + "alias": "c1-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G2", + "groupMaxInstances": 1, + "groupMinInstances": 1, + "alias": "group2", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 4, + "type": "c2", + "subscribableInfo": { + "alias": "c2-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G3", + "groupMaxInstances": 3, + "groupMinInstances": 2, + "deploymentPolicy": "static-1", + "alias": "group3", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c3", + "subscribableInfo": { + "alias": "c3-1x0", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [] + } + ] + } + ] + } + ] + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v2.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v2.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v2.json new file mode 100644 index 0000000..6f827c2 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v2.json @@ -0,0 +1,86 @@ +{ + "alias": "g-sc-G123-1", + "applicationId": "g-sc-G123-1", + "components": { + "cartridges": [], + "groups": [ + { + "name": "G1", + "groupMaxInstances": 5, + "groupMinInstances": 2, + "alias": "group1", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c1", + "subscribableInfo": { + "alias": "c1-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G2", + "groupMaxInstances": 1, + "groupMinInstances": 1, + "alias": "group2", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 4, + "type": "c2", + "subscribableInfo": { + "alias": "c2-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G3", + "groupMaxInstances": 3, + "groupMinInstances": 2, + "deploymentPolicy": "static-1", + "alias": "group3", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c3", + "subscribableInfo": { + "alias": "c3-1x0", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [] + } + ] + } + ] + } + ] + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v3.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v3.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v3.json new file mode 100644 index 0000000..a6e5fd7 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/g-sc-G123-1-v3.json @@ -0,0 +1,86 @@ +{ + "alias": "g-sc-G123-1", + "applicationId": "g-sc-G123-1", + "components": { + "cartridges": [], + "groups": [ + { + "name": "G1", + "groupMaxInstances": 1, + "groupMinInstances": 1, + "alias": "group1", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c1", + "subscribableInfo": { + "alias": "c1-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G2", + "groupMaxInstances": 1, + "groupMinInstances": 1, + "alias": "group2", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 4, + "type": "c2", + "subscribableInfo": { + "alias": "c2-1x0", + "deploymentPolicy": "deployment-policy-1", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [ + { + "name": "G3", + "groupMaxInstances": 4, + "groupMinInstances": 3, + "deploymentPolicy": "static-1", + "alias": "group3", + "cartridges": [ + { + "cartridgeMin": 2, + "cartridgeMax": 3, + "type": "c3", + "subscribableInfo": { + "alias": "c3-1x0", + "artifactRepository": { + "repoUsername": "user", + "repoUrl": "http://stratos.apache.org:10080/git/default.git", + "privateRepo": true, + "repoPassword": "c-policy" + }, + "autoscalingPolicy": "autoscaling-policy-1" + } + } + ], + "groups": [] + } + ] + } + ] + } + ] + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json deleted file mode 100644 index fb5e000..0000000 --- a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "alias": "g-sc-G123-1", - "applicationId": "g-sc-G123-1", - "components": { - "cartridges": [], - "groups": [ - { - "name": "G1", - "groupMaxInstances": 5, - "groupMinInstances": 4, - "alias": "group1", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 3, - "type": "c1", - "subscribableInfo": { - "alias": "c1-1x0", - "deploymentPolicy": "deployment-policy-1", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [ - { - "name": "G2", - "groupMaxInstances": 1, - "groupMinInstances": 1, - "alias": "group2", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 4, - "type": "c2", - "subscribableInfo": { - "alias": "c2-1x0", - "deploymentPolicy": "deployment-policy-1", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [ - { - "name": "G3", - "groupMaxInstances": 3, - "groupMinInstances": 2, - "deploymentPolicy": "static-1", - "alias": "group3", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 3, - "type": "c3", - "subscribableInfo": { - "alias": "c3-1x0", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [] - } - ] - } - ] - } - ] - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1.json deleted file mode 100644 index ff332c0..0000000 --- a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "alias": "g-sc-G123-1", - "applicationId": "g-sc-G123-1", - "components": { - "cartridges": [], - "groups": [ - { - "name": "G1", - "groupMaxInstances": 1, - "groupMinInstances": 1, - "alias": "group1", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 3, - "type": "c1", - "subscribableInfo": { - "alias": "c1-1x0", - "deploymentPolicy": "deployment-policy-1", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [ - { - "name": "G2", - "groupMaxInstances": 1, - "groupMinInstances": 1, - "alias": "group2", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 4, - "type": "c2", - "subscribableInfo": { - "alias": "c2-1x0", - "deploymentPolicy": "deployment-policy-1", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [ - { - "name": "G3", - "groupMaxInstances": 3, - "groupMinInstances": 2, - "deploymentPolicy": "static-1", - "alias": "group3", - "cartridges": [ - { - "cartridgeMin": 2, - "cartridgeMax": 3, - "type": "c3", - "subscribableInfo": { - "alias": "c3-1x0", - "artifactRepository": { - "repoUsername": "user", - "repoUrl": "http://stratos.apache.org:10080/git/default.git", - "privateRepo": true, - "repoPassword": "c-policy" - }, - "autoscalingPolicy": "autoscaling-policy-1" - } - } - ], - "groups": [] - } - ] - } - ] - } - ] - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/autoscaling-policies/autoscaling-policy-c0-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/autoscaling-policies/autoscaling-policy-c0-v1.json b/products/stratos/modules/integration/src/test/resources/autoscaling-policies/autoscaling-policy-c0-v1.json new file mode 100644 index 0000000..31c2b84 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/autoscaling-policies/autoscaling-policy-c0-v1.json @@ -0,0 +1,14 @@ +{ + "id": "autoscaling-policy-c0", + "loadThresholds": { + "requestsInFlight": { + "threshold": 30 + }, + "memoryConsumption": { + "threshold": 40 + }, + "loadAverage": { + "threshold": 20 + } + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/autoscaling-policies/update/autoscaling-policy-c0.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/autoscaling-policies/update/autoscaling-policy-c0.json b/products/stratos/modules/integration/src/test/resources/autoscaling-policies/update/autoscaling-policy-c0.json deleted file mode 100644 index 31c2b84..0000000 --- a/products/stratos/modules/integration/src/test/resources/autoscaling-policies/update/autoscaling-policy-c0.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "autoscaling-policy-c0", - "loadThresholds": { - "requestsInFlight": { - "threshold": 30 - }, - "memoryConsumption": { - "threshold": 40 - }, - "loadAverage": { - "threshold": 20 - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges-groups/cartrdige-nested-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges-groups/cartrdige-nested-v1.json b/products/stratos/modules/integration/src/test/resources/cartridges-groups/cartrdige-nested-v1.json new file mode 100644 index 0000000..6020e1e --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges-groups/cartrdige-nested-v1.json @@ -0,0 +1,50 @@ +{ + "name": "G1", + "dependencies": { + "terminationBehaviour": "terminate-none", + "startupOrders": [ + { + "aliases": [ + "group.group2", + "cartridge.c1-1x0" + ] + } + ] + }, + "cartridges": [ + "c1" + ], + "groups": [ + { + "name": "G2", + "dependencies": { + "terminationBehaviour": "terminate-dependents", + "startupOrders": [ + { + "aliases": [ + "group.group3", + "cartridge.c2-1x0" + ] + } + ] + }, + "cartridges": [ + "c2" + ], + "groups": [ + { + "name": "G3", + "dependencies": { + "terminationBehaviour": "terminate-all", + "startupOrders": [] + }, + "cartridges": [ + "c3" + ], + "groups": [] + } + ] + } + ] +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6-v1.json b/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6-v1.json new file mode 100644 index 0000000..c0132f0 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6-v1.json @@ -0,0 +1,50 @@ +{ + "name": "G4", + "dependencies": { + "terminationBehaviour": "terminate-none", + "startupOrders": [ + { + "aliases": [ + "group.group2", + "cartridge.c1-1x0" + ] + } + ] + }, + "cartridges": [ + "c4" + ], + "groups": [ + { + "name": "G5", + "dependencies": { + "terminationBehaviour": "terminate-dependents", + "startupOrders": [ + { + "aliases": [ + "group.group6", + "cartridge.c5-1x0" + ] + } + ] + }, + "cartridges": [ + "c5" + ], + "groups": [ + { + "name": "G6", + "dependencies": { + "terminationBehaviour": "terminate-all", + "startupOrders": [] + }, + "cartridges": [ + "c6" + ], + "groups": [] + } + ] + } + ] +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6.json b/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6.json new file mode 100644 index 0000000..ef28723 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges-groups/g4-g5-g6.json @@ -0,0 +1,50 @@ +{ + "name": "G4", + "dependencies": { + "terminationBehaviour": "terminate-none", + "startupOrders": [ + { + "aliases": [ + "group.group5", + "cartridge.c4-1x0" + ] + } + ] + }, + "cartridges": [ + "c4" + ], + "groups": [ + { + "name": "G5", + "dependencies": { + "terminationBehaviour": "terminate-dependents", + "startupOrders": [ + { + "aliases": [ + "group.group6", + "cartridge.c5-1x0" + ] + } + ] + }, + "cartridges": [ + "c5" + ], + "groups": [ + { + "name": "G6", + "dependencies": { + "terminationBehaviour": "terminate-all", + "startupOrders": [] + }, + "cartridges": [ + "c6" + ], + "groups": [] + } + ] + } + ] +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges-groups/update/cartrdige-nested.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges-groups/update/cartrdige-nested.json b/products/stratos/modules/integration/src/test/resources/cartridges-groups/update/cartrdige-nested.json deleted file mode 100644 index 6020e1e..0000000 --- a/products/stratos/modules/integration/src/test/resources/cartridges-groups/update/cartrdige-nested.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "G1", - "dependencies": { - "terminationBehaviour": "terminate-none", - "startupOrders": [ - { - "aliases": [ - "group.group2", - "cartridge.c1-1x0" - ] - } - ] - }, - "cartridges": [ - "c1" - ], - "groups": [ - { - "name": "G2", - "dependencies": { - "terminationBehaviour": "terminate-dependents", - "startupOrders": [ - { - "aliases": [ - "group.group3", - "cartridge.c2-1x0" - ] - } - ] - }, - "cartridges": [ - "c2" - ], - "groups": [ - { - "name": "G3", - "dependencies": { - "terminationBehaviour": "terminate-all", - "startupOrders": [] - }, - "cartridges": [ - "c3" - ], - "groups": [] - } - ] - } - ] -} - http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges/mock/c0-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges/mock/c0-v1.json b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c0-v1.json new file mode 100755 index 0000000..6d922a9 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c0-v1.json @@ -0,0 +1,124 @@ +{ + "category": "Data", + "description": "c0 Cartridge", + "displayName": "c0", + "host": "qmog.cisco.com12", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9d123", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "private", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc2112121" + } + ], + "name": "core1", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f1354961212" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb812" + }, + { + "name": "keyPair", + "value": "phoenix12" + }, + { + "name": "autoAssignIp", + "value": "true" + }, + { + "name": "securityGroups", + "value": "default123" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61617" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7612" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin123" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7612" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7712" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin123" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test123" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "3" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "apache", + "type": "c0", + "version": "1.0" +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges/mock/c4.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges/mock/c4.json b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c4.json new file mode 100755 index 0000000..ec7d8b2 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c4.json @@ -0,0 +1,45 @@ +{ + "type": "c4", + "provider": "apache", + "host": "stratos.apache.org", + "category": "data", + "displayName": "c4", + "description": "c4 Cartridge", + "version": "7", + "multiTenant": "false", + "portMapping": [ + { + "name": "http-22", + "protocol": "http", + "port": "22", + "proxyPort": "8280" + } + ], + "deployment": { + }, + "iaasProvider": [ + { + "type": "mock", + "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e", + "networkInterfaces": [ + { + "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594" + }, + { + "name": "keyPair", + "value": "vishanth-key" + }, + { + "name": "securityGroups", + "value": "default" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges/mock/c5.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges/mock/c5.json b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c5.json new file mode 100755 index 0000000..0e438fd --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c5.json @@ -0,0 +1,124 @@ +{ + "category": "Application", + "description": "c5 Cartridge", + "displayName": "c5", + "host": "qmog.cisco.com", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "public", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6" + } + ], + "name": "core", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809" + }, + { + "name": "keyPair", + "value": "phoenix" + }, + { + "name": "autoAssignIp", + "value": "false" + }, + { + "name": "securityGroups", + "value": "default" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61616" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7711" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "1" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "cisco", + "type": "c5", + "version": "1.0" +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges/mock/c6.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges/mock/c6.json b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c6.json new file mode 100755 index 0000000..8f41441 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/cartridges/mock/c6.json @@ -0,0 +1,45 @@ +{ + "type": "c6", + "provider": "apache", + "host": "stratos.apache.org", + "category": "data", + "displayName": "c6", + "description": "c6 Cartridge", + "version": "7", + "multiTenant": "false", + "portMapping": [ + { + "name": "http-22", + "protocol": "http", + "port": "22", + "proxyPort": "8280" + } + ], + "deployment": { + }, + "iaasProvider": [ + { + "type": "mock", + "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e", + "networkInterfaces": [ + { + "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594" + }, + { + "name": "keyPair", + "value": "vishanth-key" + }, + { + "name": "securityGroups", + "value": "default" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/cartridges/mock/update/c0.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/cartridges/mock/update/c0.json b/products/stratos/modules/integration/src/test/resources/cartridges/mock/update/c0.json deleted file mode 100755 index 6d922a9..0000000 --- a/products/stratos/modules/integration/src/test/resources/cartridges/mock/update/c0.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "category": "Data", - "description": "c0 Cartridge", - "displayName": "c0", - "host": "qmog.cisco.com12", - "iaasProvider": [ - { - "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9d123", - "maxInstanceLimit": "4", - "networkInterfaces": [ - { - "floatingNetworks": [ - { - "name": "private", - "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc2112121" - } - ], - "name": "core1", - "networkUuid": "5e107fbd-4820-47ad-84ea-6f1354961212" - } - ], - "property": [ - { - "name": "instanceType", - "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb812" - }, - { - "name": "keyPair", - "value": "phoenix12" - }, - { - "name": "autoAssignIp", - "value": "true" - }, - { - "name": "securityGroups", - "value": "default123" - } - ], - "type": "mock" - } - ], - "multiTenant": "false", - "portMapping": [ - { - "port": "22", - "protocol": "http", - "proxyPort": "8280" - } - ], - "property": [ - { - "name": "payload_parameter.MB_IP", - "value": "octl.qmog.cisco.com123" - }, - { - "name": "payload_parameter.MB_PORT", - "value": "61617" - }, - { - "name": "payload_parameter.CEP_IP", - "value": "octl.qmog.cisco.com123" - }, - { - "name": "payload_parameter.CEP_PORT", - "value": "7612" - }, - { - "name": "payload_parameter.CEP_ADMIN_USERNAME", - "value": "admin" - }, - { - "name": "payload_parameter.CEP_ADMIN_PASSWORD", - "value": "admin123" - }, - { - "name": "payload_parameter.CERT_TRUSTSTORE", - "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" - }, - { - "name": "payload_parameter.TRUSTSTORE_PASSWORD", - "value": "wso2carbon" - }, - { - "name": "payload_parameter.ENABLE_DATA_PUBLISHER", - "value": "false" - }, - { - "name": "payload_parameter.MONITORING_SERVER_IP", - "value": "octl.qmog.cisco.com123" - }, - { - "name": "payload_parameter.MONITORING_SERVER_PORT", - "value": "7612" - }, - { - "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", - "value": "7712" - }, - { - "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", - "value": "admin" - }, - { - "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", - "value": "admin123" - }, - { - "name": "payload_parameter.QTCM_DNS_SEGMENT", - "value": "test123" - }, - { - "name": "payload_parameter.QTCM_NETWORK_COUNT", - "value": "3" - }, - { - "name": "payload_parameter.SIMPLE_PROPERTY", - "value": "value" - } - ], - "provider": "apache", - "type": "c0", - "version": "1.0" -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-1-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-1-v1.json b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-1-v1.json new file mode 100644 index 0000000..2ba5eb3 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-1-v1.json @@ -0,0 +1,36 @@ +{ + "id": "deployment-policy-1", + "networkPartitions": [ + { + "id": "network-partition-1", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 25 + }, + { + "id": "partition-2", + "partitionMax": 20 + } + ] + }, + { + "id": "network-partition-2", + "partitionAlgo": "round-robin", + "partitions": [ + { + "id": "network-partition-2-partition-1", + "partitionMax": 15 + }, + { + "id": "network-partition-2-partition-2", + "partitionMax": 5 + } + ] + } + ] +} + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2-v1.json b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2-v1.json new file mode 100644 index 0000000..b5c305c --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2-v1.json @@ -0,0 +1,36 @@ +{ + "id": "deployment-policy-2", + "networkPartitions": [ + { + "id": "network-partition-5", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 25 + }, + { + "id": "partition-2", + "partitionMax": 20 + } + ] + }, + { + "id": "network-partition-6", + "partitionAlgo": "round-robin", + "partitions": [ + { + "id": "network-partition-6-partition-1", + "partitionMax": 15 + }, + { + "id": "network-partition-6-partition-2", + "partitionMax": 5 + } + ] + } + ] +} + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2.json b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2.json new file mode 100644 index 0000000..5df3e24 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-2.json @@ -0,0 +1,32 @@ +{ + "id": "deployment-policy-2", + "networkPartitions": [ + { + "id": "network-partition-5", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 20 + } + ] + }, + { + "id": "network-partition-6", + "partitionAlgo": "round-robin", + "partitions": [ + { + "id": "network-partition-6-partition-1", + "partitionMax": 10 + }, + { + "id": "network-partition-6-partition-2", + "partitionMax": 9 + } + ] + } + ] +} + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-3.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-3.json b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-3.json new file mode 100644 index 0000000..d024922 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/deployment-policies/deployment-policy-3.json @@ -0,0 +1,32 @@ +{ + "id": "deployment-policy-1", + "networkPartitions": [ + { + "id": "network-partition-3", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 20 + } + ] + }, + { + "id": "network-partition-4", + "partitionAlgo": "round-robin", + "partitions": [ + { + "id": "network-partition-2-partition-1", + "partitionMax": 10 + }, + { + "id": "network-partition-2-partition-2", + "partitionMax": 9 + } + ] + } + ] +} + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/deployment-policies/update/deployment-policy-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policies/update/deployment-policy-1.json b/products/stratos/modules/integration/src/test/resources/deployment-policies/update/deployment-policy-1.json deleted file mode 100644 index 2ba5eb3..0000000 --- a/products/stratos/modules/integration/src/test/resources/deployment-policies/update/deployment-policy-1.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "deployment-policy-1", - "networkPartitions": [ - { - "id": "network-partition-1", - "partitionAlgo": "one-after-another", - "partitions": [ - { - "id": "partition-1", - "partitionMax": 25 - }, - { - "id": "partition-2", - "partitionMax": 20 - } - ] - }, - { - "id": "network-partition-2", - "partitionAlgo": "round-robin", - "partitions": [ - { - "id": "network-partition-2-partition-1", - "partitionMax": 15 - }, - { - "id": "network-partition-2-partition-2", - "partitionMax": 5 - } - ] - } - ] -} - - - http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-1.json b/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-1.json deleted file mode 100644 index 3fbeeac..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-1.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "network-partition-1", - "provider": "ec2", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "region", - "value": "ap-southeast-1" - }, - { - "name": "zone", - "value": "ap-southeast-1a" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-2.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-2.json b/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-2.json deleted file mode 100644 index 02f9b1d..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/ec2/network-partition-2.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "network-partition-2", - "partitions": [ - { - "id": "partition-2", - "provider": "ec2", - "property": [ - { - "name": "region", - "value": "ap-southeast-2" - }, - { - "name": "region", - "value": "ap-southeast-2b" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/gce/network-partition-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/gce/network-partition-1.json b/products/stratos/modules/integration/src/test/resources/network-partitions/gce/network-partition-1.json deleted file mode 100644 index 177e7d2..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/gce/network-partition-1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "network-partition-1", - "provider": "gce", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "region", - "value": "default" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-1.json b/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-1.json deleted file mode 100644 index bb27086..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "network-partition-1", - "provider": "kubernetes", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "cluster", - "value": "kubernetes-cluster-2" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-2.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-2.json b/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-2.json deleted file mode 100644 index 8f9f053..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "network-partition-2", - "provider": "kubernetes", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "cluster", - "value": "kubernetes-cluster-2" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-3.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-3.json b/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-3.json deleted file mode 100644 index 5188f3c..0000000 --- a/products/stratos/modules/integration/src/test/resources/network-partitions/kubernetes/network-partition-3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "network-partition-3", - "provider": "kubernetes", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "cluster", - "value": "kubernetes-cluster-1" - } - ] - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-1-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-1-v1.json b/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-1-v1.json new file mode 100644 index 0000000..054265a --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-1-v1.json @@ -0,0 +1,28 @@ +{ + "id": "network-partition-1", + "provider": "mock", + "partitions": [ + { + "id": "partition-1", + "property": [ + { + "name": "region", + "value": "default" + } + ] + }, + { + "id": "partition-2", + "property": [ + { + "name": "region", + "value": "default1" + }, + { + "name": "zone", + "value": "z1" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/5b844043/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-3-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-3-v1.json b/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-3-v1.json new file mode 100644 index 0000000..c7d4733 --- /dev/null +++ b/products/stratos/modules/integration/src/test/resources/network-partitions/mock/network-partition-3-v1.json @@ -0,0 +1,28 @@ +{ + "id": "network-partition-3", + "provider": "mock", + "partitions": [ + { + "id": "partition-1", + "property": [ + { + "name": "region", + "value": "default" + } + ] + }, + { + "id": "partition-2", + "property": [ + { + "name": "region", + "value": "default1" + }, + { + "name": "zone", + "value": "z1" + } + ] + } + ] +}
