Repository: stratos Updated Branches: refs/heads/stratos-4.1.x 16034523a -> ca3edb283
Adding PCA integration test for STRATOS-1549 Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ca3edb28 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ca3edb28 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ca3edb28 Branch: refs/heads/stratos-4.1.x Commit: ca3edb283ae2642ceba6b156b8016b604dfe7392 Parents: fe29fcb Author: Akila Perera <[email protected]> Authored: Sat Oct 10 13:46:47 2015 +0530 Committer: Akila Perera <[email protected]> Committed: Sat Oct 10 13:47:16 2015 +0530 ---------------------------------------------------------------------- .../resources/ADCExtensionTestCase/agent.conf | 46 +++++++++++++++++ .../extensions/py/checkout-job-handler.py | 34 +++++++++++++ .../py/checkout-job-handler.yapsy-plugin | 27 ++++++++++ .../extensions/py/commit-job-handler.py | 27 ++++++++++ .../py/commit-job-handler.yapsy-plugin | 27 ++++++++++ .../resources/ADCExtensionTestCase/logging.ini | 52 ++++++++++++++++++++ .../ADCExtensionTestCase/payload/launch-params | 1 + 7 files changed, 214 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/agent.conf ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/agent.conf b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/agent.conf new file mode 100755 index 0000000..d01a246 --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/agent.conf @@ -0,0 +1,46 @@ +# 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 =1885 +mb.username =system +mb.password =manager +listen.address =localhost +thrift.receiver.urls =localhost:7712 +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 =true +auto.checkout =true +artifact.update.interval =15 +artifact.clone.retries =5 +artifact.clone.interval =10 +port.check.timeout =600000 +enable.data.publisher =false +monitoring.server.ip =localhost +monitoring.server.port =7612 +monitoring.server.secure.port =7712 +monitoring.server.admin.username =admin +monitoring.server.admin.password =admin +log.file.paths =/tmp/agent.screen-adc-test.log +metadata.service.url =https://localhost:9443 +super.tenant.repository.path =/repository/deployment/server/ +tenant.repository.path =/repository/tenants/ http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.py ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.py b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.py new file mode 100644 index 0000000..3636e61 --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.py @@ -0,0 +1,34 @@ +# ------------------------------------------------------------------------ +# +# Copyright 2005-2015 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# +# ------------------------------------------------------------------------ + +from plugins.contracts import ICartridgeAgentPlugin +from modules.util.log import LogFactory +from entity import * +from modules.artifactmgt.git.agentgithandler import * + + +class CheckoutJobHandler(ICartridgeAgentPlugin): + def run_plugin(self, values): + log = LogFactory().get_log(__name__) + try: + log.info("Running extension for checkout job") + repo_info = values['REPO_INFO'] + git_repo = AgentGitHandler.create_git_repo(repo_info) + AgentGitHandler.add_repo(git_repo) + except Exception as e: + log.exception("Error while executing CheckoutJobHandler extension: %s" % e) http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.yapsy-plugin ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.yapsy-plugin b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.yapsy-plugin new file mode 100644 index 0000000..fb383a7 --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/checkout-job-handler.yapsy-plugin @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------------ +# +# Copyright 2005-2015 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# +# ------------------------------------------------------------------------ + +[Core] +Name = checkout-job-handler +Module = checkout-job-handler + +[Documentation] +Description = ArtifactCheckoutJob +Author = Stratos +Version = 0.1 +Website = stratos.apache.org http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.py ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.py b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.py new file mode 100644 index 0000000..8b68dfc --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.py @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------------ +# +# Copyright 2005-2015 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# +# ------------------------------------------------------------------------ + +from plugins.contracts import ICartridgeAgentPlugin +from modules.util.log import LogFactory +from entity import * + + +class CommitJobHandler(ICartridgeAgentPlugin): + def run_plugin(self, values): + log = LogFactory().get_log(__name__) + log.info("Running extension for commit job") http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.yapsy-plugin ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.yapsy-plugin b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.yapsy-plugin new file mode 100644 index 0000000..90624b5 --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/extensions/py/commit-job-handler.yapsy-plugin @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------------ +# +# Copyright 2005-2015 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# +# ------------------------------------------------------------------------ + +[Core] +Name = commit-job-handler +Module = commit-job-handler + +[Documentation] +Description = ArtifactCommitJob +Author = Stratos +Version = 0.1 +Website = stratos.apache.org http://git-wip-us.apache.org/repos/asf/stratos/blob/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/logging.ini ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/logging.ini b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/logging.ini new file mode 100755 index 0000000..15cad9b --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/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/ca3edb28/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/payload/launch-params ---------------------------------------------------------------------- diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/payload/launch-params b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/payload/launch-params new file mode 100755 index 0000000..b1f45f7 --- /dev/null +++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/resources/ADCExtensionTestCase/payload/launch-params @@ -0,0 +1 @@ +APPLICATION_ID=application1,SERVICE_NAME=tomcat,HOST_NAME=tomcat.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/ADCExtensionTestCase,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
