You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/02/10 15:29:28 UTC
stratos git commit: Implementing python cartridge agent automation
test
Repository: stratos
Updated Branches:
refs/heads/master 9ec6e0c28 -> 7f2182556
Implementing python cartridge agent automation test
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7f218255
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7f218255
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7f218255
Branch: refs/heads/master
Commit: 7f218255665a12f4653dd0ff3a2a7316e457c60d
Parents: 9ec6e0c
Author: Imesh Gunaratne <im...@apache.org>
Authored: Tue Feb 10 19:59:07 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Tue Feb 10 19:59:07 2015 +0530
----------------------------------------------------------------------
.../pom.xml | 76 ++++++
.../test/PythonCartridgeAgentTest.java | 245 +++++++++++++++++++
.../src/test/resources/agent.conf | 59 +++++
.../src/test/resources/jndi.properties | 22 ++
.../src/test/resources/log4j.properties | 41 ++++
.../src/test/resources/logging.ini | 52 ++++
.../src/test/resources/payload/launch-params | 1 +
7 files changed, 496 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/pom.xml b/components/org.apache.stratos.python.cartridge.agent.test/pom.xml
new file mode 100644
index 0000000..ef7a49d
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/pom.xml
@@ -0,0 +1,76 @@
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>stratos-components-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.stratos.python.cartridge.agent.test</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Stratos - Python Cartridge Agent Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.logging</artifactId>
+ <version>${wso2carbon.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang.wso2</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6.0.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.10.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/components/org.apache.stratos.python.cartridge.agent.test/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
new file mode 100644
index 0000000..29df956
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
@@ -0,0 +1,245 @@
+/*
+ * 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.python.cartridge.agent.test;
+
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+
+public class PythonCartridgeAgentTest {
+
+ private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
+
+ private static final String NEW_LINE = System.getProperty("line.separator");
+
+ @BeforeClass
+ public static void setUp(){
+ // Set jndi.properties.dir system property for initializing event receivers
+ System.setProperty("jndi.properties.dir", getResourcesFolderPath());
+ System.setProperty("mqtturl", "tcp://localhost:1883");
+ }
+
+ private static String getResourcesFolderPath() {
+ String path = PythonCartridgeAgentTest.class.getResource("/").getPath();
+ return StringUtils.removeEnd(path, File.separator);
+ }
+
+ @Test
+ public void testPythonCartridgeAgent() {
+
+ // Simulate CEP server socket
+ startServerSocket(7711);
+
+ String agentPath = setupPythonAgent();
+ log.info("Starting python cartridge agent...");
+ ByteArrayOutputStreamLocal outputStream = executeCommand("python " + agentPath + "/agent.py");
+
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if(newLines.size() > 0) {
+ for(String line : newLines) {
+ if(line.contains("Subscribed to 'topology/#'")) {
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ String topicName = MessagingUtil.getMessageTopicName(completeTopologyEvent);
+ EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+ eventPublisher.publish(completeTopologyEvent);
+
+ // Simulate server socket
+ startServerSocket(9080);
+ }
+ if(line.contains("Artifact repository found")) {
+ ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+ artifactUpdatedEvent.setClusterId("php.php.domain");
+ artifactUpdatedEvent.setTenantId("-1234");
+ artifactUpdatedEvent.setRepoURL("https://github.com/imesh/stratos-php-applications.git");
+ String topicName = MessagingUtil.getMessageTopicName(artifactUpdatedEvent);
+ EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+ eventPublisher.publish(artifactUpdatedEvent);
+ }
+ if (newLines.contains("Exception in thread") || newLines.contains("ERROR")) {
+ break;
+ }
+
+ log.info(line);
+ }
+ }
+ sleep(500);
+ }
+
+ sleep(5000);
+ }
+
+ private void startServerSocket(final int port) {
+ Thread socketThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ ServerSocket cep = new ServerSocket(port);
+ cep.accept();
+ } catch (IOException e) {
+ log.error("Could not start server socket", e);
+ }
+ }
+ });
+ socketThread.start();
+ }
+
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service("php", ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), "php.php.domain", "deployment-policy-1",
+ "autoscaling-policy-1", "application-1");
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), "php.member-1",
+ "cluster-1-instance-1", "network-partition-1", "partition-1", System.currentTimeMillis());
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Initialized);
+ cluster.addMember(member);
+
+ return topology;
+ }
+
+ private List<String> getNewLines(List<String> outputLines, String output) {
+ List<String> newLines = new ArrayList<String>();
+
+ if(StringUtils.isNotBlank(output)) {
+ String [] lines = output.split(NEW_LINE);
+ if(lines != null) {
+ for(String line : lines) {
+ if(!outputLines.contains(line)) {
+ outputLines.add(line);
+ newLines.add(line);
+ }
+ }
+ }
+ }
+ return newLines;
+ }
+
+ private void sleep(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException ignore) {
+ }
+ }
+
+ private String setupPythonAgent() {
+ try {
+ log.info("Setting up python cartridge agent...");
+ String srcAgentPath = getResourcesFolderPath() + "/../../../org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent";
+ String destAgentPath = getResourcesFolderPath() + "/../" + UUID.randomUUID() + "/cartridge.agent";
+ FileUtils.copyDirectory(new File(srcAgentPath), new File(destAgentPath));
+
+ List<File> extensionFiles = (List<File>) FileUtils.listFiles(new File(srcAgentPath + "/extensions"), new String[] { "sh"}, false);
+ for(File extensionFile : extensionFiles) {
+ executeCommand("chmod +x " + extensionFile.getAbsolutePath());
+ }
+
+ String srcAgentConfPath = getResourcesFolderPath() + "/agent.conf";
+ String destAgentConfPath = destAgentPath + "/agent.conf";
+ FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+ String srcLoggingIniPath = getResourcesFolderPath() + "/logging.ini";
+ String destLoggingIniPath = destAgentPath + "/logging.ini";
+ FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+ String srcPayloadPath = getResourcesFolderPath() + "/payload";
+ String destPayloadPath = destAgentPath + "/payload";
+ FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+ log.info("Python cartridge agent setup completed");
+
+ return destAgentPath;
+ } catch (Exception e) {
+ String message = "Could not copy cartridge agent distribution";
+ log.error(message, e);
+ throw new RuntimeException(message, e);
+ }
+ }
+
+ /**
+ * Execute shell command
+ * @param commandText
+ */
+ private ByteArrayOutputStreamLocal executeCommand(String commandText) {
+ final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+ try {
+ CommandLine commandline = CommandLine.parse(commandText);
+ DefaultExecutor exec = new DefaultExecutor();
+ PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+ exec.setStreamHandler(streamHandler);
+ exec.execute(commandline, new ExecuteResultHandler() {
+ @Override
+ public void onProcessComplete(int i) {
+ }
+
+ @Override
+ public void onProcessFailed(ExecuteException e) {
+ log.error(e);
+ }
+ });
+ return outputStream;
+ } catch (Exception e) {
+ log.error(outputStream.toString(), e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
+ private boolean closed;
+
+ @Override
+ public void close() throws IOException {
+ super.close();
+ closed = true;
+ }
+
+ public boolean isClosed() {
+ return closed;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/agent.conf b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/agent.conf
new file mode 100644
index 0000000..bb264ac
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/agent.conf
@@ -0,0 +1,59 @@
+# 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.
+
+[agent]
+mb.ip =localhost
+mb.port =1883
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7711
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =false
+auto.checkout =true
+artifact.update.interval =15
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =192.168.1.4
+monitoring.server.port =7611
+monitoring.server.secure.port =7711
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+log.file.paths =
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
+extension.instance.started =instance-started.sh
+extension.start.servers =start-servers.sh
+extension.instance.activated =instance-activated.sh
+extension.artifacts.updated =artifacts-updated.sh
+extension.clean =clean.sh
+extension.mount.volumes =mount_volumes.sh
+extension.member.started =member-started.sh
+extension.member.activated =member-activated.sh
+extension.member.suspended =member-suspended.sh
+extension.member.terminated =member-terminated.sh
+extension.complete.topology =complete-topology.sh
+extension.complete.tenant =complete-tenant.sh
+extension.subscription.domain.added =subscription-domain-added.sh
+extension.subscription.domain.removed =subscription-domain-removed.sh
+extension.artifacts.copy =artifacts-copy.sh
+extension.tenant.subscribed =tenant-subscribed.sh
+extension.tenant.unsubscribed =tenant-unsubscribed.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/jndi.properties b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/jndi.properties
new file mode 100644
index 0000000..21d7420
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61616
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/log4j.properties b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/log4j.properties
new file mode 100644
index 0000000..c0c6e78
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/log4j.properties
@@ -0,0 +1,41 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=cartridge-agent.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.cartridge.agent=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.apache.stratos.common.util=DEBUG
+log4j.logger.org.wso2.andes.client=ERROR
+log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/logging.ini
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/logging.ini b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/logging.ini
new file mode 100644
index 0000000..15cad9b
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/logging.ini
@@ -0,0 +1,52 @@
+# 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.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f218255/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/payload/launch-params
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/payload/launch-params b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/payload/launch-params
new file mode 100644
index 0000000..1f44a28
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent.test/src/test/resources/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos/app/path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883
\ No newline at end of file