Repository: stratos Updated Branches: refs/heads/stratos-4.1.x 196ffcc10 -> 999f0f25f
integration test for STRATOS-1620 Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/28e65f2b Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/28e65f2b Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/28e65f2b Branch: refs/heads/stratos-4.1.x Commit: 28e65f2bf9c9b2f8f62173160b773368ac3b88f1 Parents: 885bf56 Author: Isuru Haththotuwa <[email protected]> Authored: Fri Nov 20 01:13:44 2015 +0530 Committer: Isuru Haththotuwa <[email protected]> Committed: Sat Nov 21 15:57:56 2015 +0530 ---------------------------------------------------------------------- .../common/StratosTestServerManager.java | 16 ++ .../tests/StratosIntegrationTest.java | 5 + .../tests/other/IaasProviderAttributeTest.java | 257 +++++++++++++++++++ ...tion-policy-iaasprovider-attribute-test.json | 17 ++ .../app-iaasprovider-attribute-test.json | 24 ++ ...ling-policy-iaasprovider-attribute-test.json | 14 + ...dge-iaasprovider-attribute-test-updated.json | 54 ++++ .../cartridge-iaasprovider-attribute-test.json | 54 ++++ ...ment-policy-iaasprovider-attribute-test.json | 15 ++ ...k-partition-iaasprovider-attribute-test.json | 19 ++ .../test/resources/common/cloud-controller.xml | 11 +- 11 files changed, 484 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java index d2db900..e5bb7f8 100644 --- a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java +++ b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java @@ -263,6 +263,14 @@ public class StratosTestServerManager extends TestServerManager { public void setWebAppURLHttps(String webAppURLHttps) { this.webAppURLHttps = webAppURLHttps; } + + public ServerLogReader getLogReader () { + return ((StratosServerManager)carbonServer).getInputLogStreamReader(); + } + + public ServerLogReader getErrorLogReader () { + return ((StratosServerManager)carbonServer).getErrorStreamReader(); + } } // TODO: get rid of this class once startup script issue is fixed in automation engine @@ -620,4 +628,12 @@ class StratosServerManager extends CarbonServerManager { } } + + public ServerLogReader getInputLogStreamReader () { + return inputStreamHandler; + } + + public ServerLogReader getErrorStreamReader () { + return errorStreamHandler; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/StratosIntegrationTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/StratosIntegrationTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/StratosIntegrationTest.java index 2836f93..3983835 100644 --- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/StratosIntegrationTest.java +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/StratosIntegrationTest.java @@ -18,6 +18,7 @@ package org.apache.stratos.integration.tests; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.stratos.integration.common.StratosTestServerManager; import org.apache.stratos.integration.common.TopologyHandler; import org.apache.stratos.integration.common.extensions.StratosServerExtension; import org.apache.stratos.integration.common.rest.RestClient; @@ -25,6 +26,8 @@ import org.apache.stratos.mock.iaas.client.MockIaasApiClient; import org.wso2.carbon.automation.engine.context.AutomationContext; import org.wso2.carbon.automation.engine.context.TestUserMode; +import java.util.List; + public class StratosIntegrationTest { private static final Log log = LogFactory.getLog(StratosIntegrationTest.class); protected AutomationContext stratosAutomationCtx; @@ -36,6 +39,7 @@ public class StratosIntegrationTest { protected MockIaasApiClient mockIaasApiClient; public static final int GLOBAL_TEST_TIMEOUT = 5 * 60 * 1000; // 5 mins public static final int APPLICATION_TEST_TIMEOUT = 20 * 60 * 1000; // 20 mins + protected StratosTestServerManager stratosTestServerManager; public StratosIntegrationTest() { try { @@ -50,6 +54,7 @@ public class StratosIntegrationTest { stratosSecuredBackendURL = StratosServerExtension.getStratosTestServerManager().getWebAppURLHttps(); restClient = new RestClient(stratosBackendURL, stratosSecuredBackendURL, adminUsername, adminPassword); mockIaasApiClient = new MockIaasApiClient(stratosBackendURL + "/mock-iaas/api"); + stratosTestServerManager = StratosServerExtension.getStratosTestServerManager(); // initialize topology handler before running the tests TopologyHandler.getInstance(); } catch (Exception e) { http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/other/IaasProviderAttributeTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/other/IaasProviderAttributeTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/other/IaasProviderAttributeTest.java new file mode 100644 index 0000000..70b089b --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/other/IaasProviderAttributeTest.java @@ -0,0 +1,257 @@ +/* + * 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.other; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.stratos.common.beans.application.ApplicationBean; +import org.apache.stratos.common.beans.cartridge.CartridgeBean; +import org.apache.stratos.common.beans.cartridge.IaasProviderBean; +import org.apache.stratos.integration.common.RestConstants; +import org.apache.stratos.integration.common.TopologyHandler; +import org.apache.stratos.integration.tests.StratosIntegrationTest; +import org.apache.stratos.messaging.domain.application.ApplicationStatus; +import org.testng.annotations.Test; + +import java.util.List; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; +import static org.testng.AssertJUnit.assertTrue; + +public class IaasProviderAttributeTest extends StratosIntegrationTest { + + private static final Log log = LogFactory.getLog(IaasProviderAttributeTest.class); + private static final String RESOURCES_PATH = "/cartridge-iaas-attribute-test"; + private static final String AUTOSCALING_POLICY = "autoscaling-policy-iaasprovider-attribute-test"; + private static final String NETWORK_PARTITION = "network-partition-iaasprovider-attribute-test"; + private static final String DEPLOYMENT_POLICY = "deployment-policy-iaasprovider-attribute-test"; + private static final String APPLICATION_POLICY = "application-policy-iaasprovider-attribute-test"; + private static final String CARTRIDGE = "cartridge-iaasprovider-attribute-test"; + private static final String UPDATED_CARTRIDGE = "cartridge-iaasprovider-attribute-test-updated"; + private static final String APPLICATION = "app-iaasprovider-attribute-test"; + + @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.cartridge.iaas.attributes", "all"}) + public void testIaasProviderAttributesForDefaultCartridge () throws Exception { + + // add autoscaling policy + log.info("Adding autoscaling policy [autoscale policy id] " + AUTOSCALING_POLICY); + boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants. + AUTOSCALING_POLICIES_PATH + "/" + AUTOSCALING_POLICY + ".json", + RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); + assertTrue(addedScalingPolicy); + + // add network partition + log.info("Adding network partition [network partition id] " + NETWORK_PARTITION); + boolean addedN1 = restClient.addEntity(RESOURCES_PATH + "/network-partitions" + "/" + + NETWORK_PARTITION + ".json", RestConstants.NETWORK_PARTITIONS, + RestConstants.NETWORK_PARTITIONS_NAME); + assertTrue(addedN1); + + // add deployment policy + log.info("Adding deployment policy [deployment policy id] " + DEPLOYMENT_POLICY); + boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + + DEPLOYMENT_POLICY + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); + assertTrue(addedDep); + + // add application policy + log.info("Adding application policy [application policy id] " + APPLICATION_POLICY); + boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + + APPLICATION_POLICY + ".json", RestConstants.APPLICATION_POLICIES, + RestConstants.APPLICATION_POLICIES_NAME); + assertTrue(addAppPolicy); + + // deploy a default cartridge + boolean defaultCartridgeAdded = restClient.addEntity(RESOURCES_PATH + "/cartridges/" + CARTRIDGE + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + assertTrue("Default cartridge not deployed properly", defaultCartridgeAdded); + + // deploy application + log.info("Adding application [application id] " + APPLICATION); + boolean addedApp = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + + APPLICATION + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); + assertEquals(addedApp, true); + + // Test Iaas Provider attributes + CartridgeBean defaultCartridgeBean = (CartridgeBean) restClient.getEntity(RestConstants.CARTRIDGES, CARTRIDGE, CartridgeBean.class, + RestConstants.CARTRIDGES_NAME); + + assertEquals(CARTRIDGE, defaultCartridgeBean.getType()); + List<IaasProviderBean> iaasProviders = defaultCartridgeBean.getIaasProvider(); + assertNotNull(iaasProviders, "No Iaas Providers found in default cartridge definition"); + IaasProviderBean mockIaasProvider = getMockIaasProvider(iaasProviders); + assertNotNull(mockIaasProvider, "Mock Iaas Provider not found in default cartridge definition"); + assertNotNull(mockIaasProvider.getProperty(), "No properties found in Iaas Provider " + + "config of default cartridge definition"); + + ///applications/{applicationId}/deploy/{applicationPolicyId} + log.info("Deploying application [application id] app-iaasprovider-attribute-test using [application policy id] " + + "application-policy-iaasprovider-attribute-test"); + String resourcePath = RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + + RestConstants.APPLICATIONS_DEPLOY + "/" + APPLICATION_POLICY; + boolean appDeployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); + assertTrue(appDeployed); + + ApplicationBean applicationBean = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, APPLICATION, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); + assertEquals(applicationBean.getApplicationId(), APPLICATION); + + TopologyHandler topologyHandler = TopologyHandler.getInstance(); + + long time = System.currentTimeMillis() + 300000L; + + boolean found = false; + while (System.currentTimeMillis() < time) { + if (!stratosTestServerManager.getLogReader().getOutput().contains("cc_property_value_1") + && stratosTestServerManager.getLogReader().getOutput().contains("cartridge_property_value_1")) { + found = true; + break; + } + } + + assertTrue("Property 'property1' not found | value not equal to 'cartridge_property_value_1'", found); + +// log.info("Waiting for application status to become ACTIVE..."); +// topologyHandler.assertApplicationStatus(applicationBean.getApplicationId(), +// ApplicationStatus.Active); +// +// // undeploy application +// log.info("Un-deploying the application [application id] app-iaasprovider-attribute-test"); +// String resourcePathUndeploy = RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + +// RestConstants.APPLICATIONS_UNDEPLOY; +// +// boolean undeployedApp = restClient.undeployEntity(resourcePathUndeploy, RestConstants +// .APPLICATIONS_NAME); +// assertTrue(undeployedApp); +// log.info("Undeployed application 'app-iaasprovider-attribute-test'"); +// +// // force undeploy to make sure its undeployed +// log.info("Force undeployment is going to start for the [application] app-iaasprovider-attribute-test"); +// restClient.undeployEntity(RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + +// RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); +// +// boolean forceUndeployed = topologyHandler.assertApplicationUndeploy("app-iaasprovider-attribute-test"); +// assertTrue(String.format("Forceful undeployment failed for the application %s", +// "app-iaasprovider-attribute-test"), forceUndeployed); +// +// // update cartridge +// boolean updated = restClient.updateEntity(RESOURCES_PATH + "/cartridges/" + UPDATED_CARTRIDGE + ".json", +// RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); +// assertTrue(updated); +// log.info("Updated cartridge 'cartridge-iaasprovider-attribute-test'"); +// +// // re-deplpoy the application +// resourcePath = RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + +// RestConstants.APPLICATIONS_DEPLOY + "/" + APPLICATION_POLICY; +// appDeployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); +// assertTrue(appDeployed); +// log.info("Re-deployed application 'app-iaasprovider-attribute-test'"); +// +// time = System.currentTimeMillis() + 300000L; +// +// found = false; +// while (System.currentTimeMillis() < time) { +// if (stratosTestServerManager.getLogReader().getOutput().contains("cartridge_property_value_1")) { +// found = true; +// break; +// } +// } +// +// assertTrue("Property 'property1' not found | value not equal to 'cartridge_property_value_1'", found); + + terminateAndRemoveAllArtifacts(); + } + + private IaasProviderBean getMockIaasProvider(List<IaasProviderBean> iaasProviders) { + for (IaasProviderBean iaasProvider : iaasProviders) { + if ("mock".equals(iaasProvider.getType())) { + return iaasProvider; + } + } + return null; + } + + private void terminateAndRemoveAllArtifacts () throws Exception { + + TopologyHandler topologyHandler = TopologyHandler.getInstance(); + + log.info("Un-deploying the application [application id] app-iaasprovider-attribute-test"); + String resourcePathUndeploy = RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + + RestConstants.APPLICATIONS_UNDEPLOY; + + boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME); + assertTrue(unDeployed); + + boolean undeploy = topologyHandler.assertApplicationUndeploy("app-iaasprovider-attribute-test"); + if (!undeploy) { + //Need to forcefully undeploy the application + log.info("Force undeployment is going to start for the [application] app-iaasprovider-attribute-test"); + + restClient.undeployEntity(RestConstants.APPLICATIONS + "/app-iaasprovider-attribute-test" + + RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); + + boolean forceUndeployed = topologyHandler.assertApplicationUndeploy("app-iaasprovider-attribute-test"); + assertTrue(String.format("Forceful undeployment failed for the application %s", + "app-iaasprovider-attribute-test"), forceUndeployed); + } + + log.info("Removing the application [application id] app-iaasprovider-attribute-test"); + boolean removedApp = restClient.removeEntity(RestConstants.APPLICATIONS, "app-iaasprovider-attribute-test", + RestConstants.APPLICATIONS_NAME); + assertTrue(removedApp); + + ApplicationBean beanRemoved = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, "app-iaasprovider-attribute-test", ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); + assertNull(beanRemoved); + + log.info("Removing the application policy [application policy id] " + + "application-policy-iaasprovider-attribute-test"); + boolean removeAppPolicy = restClient + .removeEntity(RestConstants.APPLICATION_POLICIES, "application-policy-iaasprovider-attribute-test", + RestConstants.APPLICATION_POLICIES_NAME); + assertTrue(removeAppPolicy); + + log.info("Removing the cartridge [cartridge type] cartridge-iaasprovider-attribute-test"); + boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "cartridge-iaasprovider-attribute-test", + RestConstants.CARTRIDGES_NAME); + assertTrue(removedC1); + + log.info("Removing the autoscaling policy [autoscaling policy id] " + AUTOSCALING_POLICY); + boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, AUTOSCALING_POLICY, + RestConstants.AUTOSCALING_POLICIES_NAME); + assertTrue(removedAuto); + + log.info("Removing the deployment policy [deployment policy id] deployment-policy-iaasprovider-attribute-test"); + boolean removedDep = restClient + .removeEntity(RestConstants.DEPLOYMENT_POLICIES, "deployment-policy-iaasprovider-attribute-test", + RestConstants.DEPLOYMENT_POLICIES_NAME); + assertTrue(removedDep); + + log.info("Removing the network partition [network partition id] network-partition-iaasprovider-attribute-test"); + boolean removedNet = restClient + .removeEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-iaasprovider-attribute-test", + RestConstants.NETWORK_PARTITIONS_NAME); + assertTrue(removedNet); + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/application-policies/application-policy-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/application-policies/application-policy-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/application-policies/application-policy-iaasprovider-attribute-test.json new file mode 100644 index 0000000..1413446 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/application-policies/application-policy-iaasprovider-attribute-test.json @@ -0,0 +1,17 @@ +{ + "id": "application-policy-iaasprovider-attribute-test", + "algorithm": "one-after-another", + "networkPartitions": [ + "network-partition-iaasprovider-attribute-test" + ], + "properties": [ + { + "name": "networkPartitionGroups", + "value": "network-partition-iaasprovider-attribute-test" + }, + { + "name": "key-2", + "value": "value-2" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/applications/app-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/applications/app-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/applications/app-iaasprovider-attribute-test.json new file mode 100644 index 0000000..fe1ff69 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/applications/app-iaasprovider-attribute-test.json @@ -0,0 +1,24 @@ +{ + "alias": "app-iaasprovider-attribute-test", + "applicationId": "app-iaasprovider-attribute-test", + "components": { + "cartridges": [ + { + "type": "cartridge-iaasprovider-attribute-test", + "cartridgeMin": 1, + "cartridgeMax": 1, + "subscribableInfo": { + "alias": "cartridge-alias-default-iaasprovider-attribute-test", + "autoscalingPolicy": "autoscaling-policy-iaasprovider-attribute-test", + "deploymentPolicy": "deployment-policy-iaasprovider-attribute-test", + "artifactRepository": { + "privateRepo": false, + "repoUrl": "https://github.com/lakwarus/single-cartridge.git", + "repoUsername": "", + "repoPassword": "" + } + } + } + ] + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/autoscaling-policies/autoscaling-policy-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/autoscaling-policies/autoscaling-policy-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/autoscaling-policies/autoscaling-policy-iaasprovider-attribute-test.json new file mode 100644 index 0000000..e609c4f --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/autoscaling-policies/autoscaling-policy-iaasprovider-attribute-test.json @@ -0,0 +1,14 @@ +{ + "id": "autoscaling-policy-iaasprovider-attribute-test", + "loadThresholds": { + "requestsInFlight": { + "threshold": 35 + }, + "memoryConsumption": { + "threshold": 45 + }, + "loadAverage": { + "threshold": 25 + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test-updated.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test-updated.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test-updated.json new file mode 100644 index 0000000..f9f883b --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test-updated.json @@ -0,0 +1,54 @@ +{ + "type": "cartridge-iaasprovider-attribute-test", + "category": "framework", + "provider": "wso2", + "host": "as.wso2.org", + "displayName": "WSO2 Default Cartridge", + "description": "WSO2 Default Cartridge", + "version": "1.0.0", + "multiTenant": false, + "loadBalancingIPType": "public", + "portMapping": [ + { + "name": "mgt-http", + "protocol": "http", + "port": 9763, + "proxyPort": 80 + } + ], + "iaasProvider": [ + { + "type": "mock", + "property": [ + { + "name":"tag:Name", + "value":"WSO2 PPaaS Default Server" + }, + { + "name":"property1", + "value":"cartridge_property_value_1" + } + ] + } + ], + "deployment": { + }, + "property": [ + { + "name": "payload_parameter.CONFIG_PARAM_WORKER_HOST_NAME", + "value": "default.wso2.com" + }, + { + "name": "payload_parameter.CONFIG_PARAM_CLUSTERING", + "value": "false" + }, + { + "name": "payload_parameter.CONFIG_PARAM_MEMBERSHIP_SCHEME", + "value": "stratos" + }, + { + "name": "payload_parameter.APPLICATION_PATH", + "value": "/var/www" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test.json new file mode 100644 index 0000000..f9f883b --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/cartridges/cartridge-iaasprovider-attribute-test.json @@ -0,0 +1,54 @@ +{ + "type": "cartridge-iaasprovider-attribute-test", + "category": "framework", + "provider": "wso2", + "host": "as.wso2.org", + "displayName": "WSO2 Default Cartridge", + "description": "WSO2 Default Cartridge", + "version": "1.0.0", + "multiTenant": false, + "loadBalancingIPType": "public", + "portMapping": [ + { + "name": "mgt-http", + "protocol": "http", + "port": 9763, + "proxyPort": 80 + } + ], + "iaasProvider": [ + { + "type": "mock", + "property": [ + { + "name":"tag:Name", + "value":"WSO2 PPaaS Default Server" + }, + { + "name":"property1", + "value":"cartridge_property_value_1" + } + ] + } + ], + "deployment": { + }, + "property": [ + { + "name": "payload_parameter.CONFIG_PARAM_WORKER_HOST_NAME", + "value": "default.wso2.com" + }, + { + "name": "payload_parameter.CONFIG_PARAM_CLUSTERING", + "value": "false" + }, + { + "name": "payload_parameter.CONFIG_PARAM_MEMBERSHIP_SCHEME", + "value": "stratos" + }, + { + "name": "payload_parameter.APPLICATION_PATH", + "value": "/var/www" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/deployment-policies/deployment-policy-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/deployment-policies/deployment-policy-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/deployment-policies/deployment-policy-iaasprovider-attribute-test.json new file mode 100644 index 0000000..54e4672 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/deployment-policies/deployment-policy-iaasprovider-attribute-test.json @@ -0,0 +1,15 @@ +{ + "id": "deployment-policy-iaasprovider-attribute-test", + "networkPartitions": [ + { + "id": "network-partition-iaasprovider-attribute-test", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 20 + } + ] + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/network-partitions/network-partition-iaasprovider-attribute-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/network-partitions/network-partition-iaasprovider-attribute-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/network-partitions/network-partition-iaasprovider-attribute-test.json new file mode 100644 index 0000000..b7c5ce8 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-iaas-attribute-test/network-partitions/network-partition-iaasprovider-attribute-test.json @@ -0,0 +1,19 @@ +{ + "id": "network-partition-iaasprovider-attribute-test", + "provider": "mock", + "partitions": [ + { + "id": "partition-1", + "property": [ + { + "name": "region", + "value": "default" + }, + { + "name": "zone", + "value": "default-1" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/28e65f2b/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml index 7620fbe..826b19a 100644 --- a/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml @@ -53,17 +53,18 @@ <property name="keyPair" value="keypair-name" /> <property name="securityGroups" value="default" /> </iaasProvider --> - <!-- iaasProvider type="ec2" name="Amazon EC2"> + <!--iaasProvider type="ec2" name="Amazon EC2"> <className>org.apache.stratos.cloud.controller.iaases.ec2.EC2Iaas</className> <provider>aws-ec2</provider> <identity svns:secretAlias="cloud.controller.ec2.identity">identity</identity> <credential svns:secretAlias="cloud.controller.ec2.credential">credential</credential> + <imageId>ap-southeast-1/ami-660ccb05</imageId> <property name="jclouds.ec2.ami-query" value="owner-id=owner-id;state=available;image-type=machine"/> <property name="availabilityZone" value="ap-southeast-1b"/> <property name="securityGroups" value="default"/> <property name="autoAssignIp" value="true" /> <property name="keyPair" value="keypair-name"/> - </iaasProvider --> + </iaasProvider--> <iaasProvider type="kubernetes" name="Kubernetes"> <className>org.apache.stratos.cloud.controller.iaases.kubernetes.KubernetesIaas</className> <provider>kubernetes</provider> @@ -75,7 +76,13 @@ <provider>mock</provider> <identity svns:secretAlias="cloud.controller.mock.identity">identity</identity> <credential svns:secretAlias="cloud.controller.mock.credential">credential</credential> + <imageId>RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e</imageId> <property name="api.endpoint" value="https://localhost:STRATOS_SECURE_DYNAMIC_PORT/mock-iaas/api"/> + <property name="availabilityZone" value="avaialbility_zone_in_cc"/> + <property name="securityGroups" value="default"/> + <property name="autoAssignIp" value="true" /> + <property name="keyPair" value="keypair-name"/> + <property name="property1" value="cc_property_value_1"/> </iaasProvider> </iaasProviders> </cloudController> \ No newline at end of file
