You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2015/11/10 08:16:18 UTC
[1/2] stratos git commit: unit test for IaaSProvider's ComputeService
Repository: stratos
Updated Branches:
refs/heads/stratos-4.1.x 540726691 -> f7263a885
unit test for IaaSProvider's ComputeService
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d2a32378
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d2a32378
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d2a32378
Branch: refs/heads/stratos-4.1.x
Commit: d2a32378d6014e7be2ebdfbdf7b1a207122aba4f
Parents: fde5c2d
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Nov 10 12:42:41 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Nov 10 12:44:50 2015 +0530
----------------------------------------------------------------------
.../iaasprovider/IaaSProviderTest.java | 66 ++++++++++++++++++++
.../resources/cloud-controller-ec2-iaas.xml | 55 ++++++++++++++++
2 files changed, 121 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/d2a32378/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/iaasprovider/IaaSProviderTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/iaasprovider/IaaSProviderTest.java b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/iaasprovider/IaaSProviderTest.java
new file mode 100644
index 0000000..8c4c029
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/iaasprovider/IaaSProviderTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.cloud.controller.iaasprovider;
+
+import junit.framework.TestCase;
+import org.apache.axiom.om.OMElement;
+import org.apache.stratos.cloud.controller.config.CloudControllerConfig;
+import org.apache.stratos.cloud.controller.config.parser.CloudControllerConfigParser;
+import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.iaases.Iaas;
+import org.apache.stratos.common.util.AxiomXpathParserUtil;
+
+import java.io.File;
+import java.util.ArrayList;
+
+public class IaaSProviderTest extends TestCase {
+
+ private static final String IAAS_TYPE_EC2 = "ec2";
+ private static final String IAAS_PROVIDER_EC2 = "aws-ec2";
+ private static final String EC2_IAAS_IMPL_CLASS = "org.apache.stratos.cloud.controller.iaases.ec2.EC2Iaas";
+
+ private IaasProvider iaasProvider;
+ private File xmlFile = new File("src/test/resources/cloud-controller-ec2-iaas.xml");
+ private OMElement docElt;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ docElt = AxiomXpathParserUtil.parse(xmlFile);
+ CloudControllerConfigParser.parse(docElt);
+ assertEquals(IAAS_TYPE_EC2, CloudControllerConfig.getInstance().
+ getIaasProvider(IAAS_TYPE_EC2).getType());
+ assertEquals(EC2_IAAS_IMPL_CLASS, CloudControllerConfig.getInstance().
+ getIaasProvider(IAAS_TYPE_EC2).getClassName());
+ assertEquals(IAAS_PROVIDER_EC2, CloudControllerConfig.getInstance().
+ getIaasProvider(IAAS_TYPE_EC2).getProvider());
+ }
+
+ public void testComputeService () {
+ iaasProvider = CloudControllerConfig.getInstance().getIaasProvider(IAAS_TYPE_EC2);
+ iaasProvider.getIaas();
+ assertNotNull(iaasProvider.getComputeService());
+ }
+
+ protected void tearDown() throws Exception {
+ CloudControllerConfig.getInstance().setIaasProviders(new ArrayList<IaasProvider>());
+ iaasProvider = null;
+ super.tearDown();
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/d2a32378/components/org.apache.stratos.cloud.controller/src/test/resources/cloud-controller-ec2-iaas.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cloud-controller-ec2-iaas.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cloud-controller-ec2-iaas.xml
new file mode 100644
index 0000000..4be09d4
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cloud-controller-ec2-iaas.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ # 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.
+ -->
+<cloudController xmlns:svns="http://org.wso2.securevault/configuration">
+ <svns:secureVault provider="org.wso2.securevault.secret.handler.SecretManagerSecretCallbackHandler"/>
+
+ <!-- BAM data publisher configuration -->
+ <dataPublisher enable="false">
+ <bamServer>
+ <!-- BAM server URL should be specified in carbon.xml -->
+ <adminUserName>admin</adminUserName>
+ <adminPassword svns:secretAlias="cloud.controller.bam.server.admin.password">admin</adminPassword>
+ </bamServer>
+ <!-- Default cron expression is '1 * * * * ? *' meaning 'first second of every minute'.
+ Optional element. -->
+ <cron>1 * * * * ? *</cron>
+ </dataPublisher>
+
+ <!-- Complete topology event publisher cron configuration -->
+ <topologySync enable="true">
+ <property name="cron" value="1 * * * * ? *"/>
+ </topologySync>
+
+ <!-- Specify the properties that are common to an IaaS here. This element
+ is not necessary [0..1]. But you can use this section to avoid specifying
+ same property over and over again. -->
+ <iaasProviders>
+ <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">xxxxxxxxx</identity>
+ <credential svns:secretAlias="cloud.controller.ec2.credential">yyyyyyyyy</credential>
+ <property name="jclouds.ec2.ami-query" value="owner-id=742434826329;state=available;image-type=machine"/>
+ <property name="securityGroups" value="sampleSecGroup"/>
+ <property name="autoAssignIp" value="true" />
+ <property name="keyPair" value="sampleKey"/>
+ </iaasProvider>
+ </iaasProviders>
+</cloudController>
\ No newline at end of file
[2/2] stratos git commit: Merge branch 'stratos-4.1.x' of
https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Posted by is...@apache.org.
Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f7263a88
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f7263a88
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f7263a88
Branch: refs/heads/stratos-4.1.x
Commit: f7263a885aecd35993e3e02332b499f4fca22d51
Parents: d2a3237 5407266
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Nov 10 12:45:27 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Nov 10 12:45:27 2015 +0530
----------------------------------------------------------------------
.../cartridge.agent/healthstats.py | 94 +-
.../src/main/python/README.md | 40 +-
.../src/main/python/cli/CLI.py | 1530 ----------------
.../src/main/python/cli/Configs.py | 32 -
.../src/main/python/cli/Exceptions.py | 25 -
.../src/main/python/cli/Logging.py | 29 -
.../src/main/python/cli/Main.py | 66 -
.../src/main/python/cli/Stratos.py | 489 -----
.../src/main/python/cli/Utils.py | 99 -
.../src/main/python/cli/cli.py | 1690 ++++++++++++++++++
.../src/main/python/cli/config.py | 32 +
.../src/main/python/cli/exception.py | 26 +
.../src/main/python/cli/logutils.py | 29 +
.../src/main/python/cli/main.py | 71 +
.../src/main/python/cli/restclient.py | 493 +++++
.../src/main/python/cli/utils.py | 38 +
.../src/main/python/setup.cfg | 2 -
.../src/main/python/setup.py | 46 -
.../GadgetLoadAverage/Load_Average/js/igviz.js | 2 +-
.../GadgetMemoryUsage/Memory_Usage/js/igviz.js | 2 +-
.../integration/tests/CEPHAModeTestCase.java | 292 +++
.../test/resources/CEPHAModeTestCase/agent.conf | 46 +
.../resources/CEPHAModeTestCase/logging.ini | 52 +
.../CEPHAModeTestCase/payload/launch-params | 1 +
.../distribution/src/main/assembly/bin.xml | 13 +-
.../distribution/src/main/bin/stratos.sh | 34 +
26 files changed, 2878 insertions(+), 2395 deletions(-)
----------------------------------------------------------------------