From 17f3bbcd166cbda7157a5e8ffe6e240631baf535 Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Fri, 16 Oct 2015 14:13:56 +0300 Subject: [PATCH] Streamline test_simple_software_configuration This commit modifies test_simple_software_configuration to not use deployment templates and only use .runCommand Removes unused files and parameters from the test application. Targets: blueprint dependent-apps-and-ssc-tests Change-Id: Ib597b09afbfd1dc9b286cf28e23d3beb0de75ed9 --- .../Classes/ApacheHttpServer.yaml | 15 +++++---- .../Resources/DeployApache.template | 31 ------------------- .../Resources/scripts/runApacheDeploy.sh | 23 -------------- .../functional/engine/test_deployment.py | 1 - 4 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/DeployApache.template delete mode 100644 murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/scripts/runApacheDeploy.sh diff --git a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml b/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml index 9a3fcafd..26a9b772 100644 --- a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml +++ b/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml @@ -26,10 +26,6 @@ Properties: name: Contract: $.string().notNull() - enablePHP: - Contract: $.bool() - Default: false - instance: Contract: $.class(res:Instance).notNull() @@ -57,15 +53,18 @@ Methods: External: true - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress) - $.instance.deploy() - - $resources: new(sys:Resources) - - $template: $resources.yaml('DeployApache.template').bind(dict(enablePHP => $.enablePHP)) - $._environment.reporter.report($this, 'Instance is created. Deploying Apache') - - $.instance.agent.call($template, $resources) + + - $resources: new(sys:Resources) + - $linux: new(conf:Linux) + + - $linux.runCommand($.instance.agent, 'apt-get -y install apache2') + - $linux.runCommand($.instance.agent, 'iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT') + - $linux.runCommand($.instance.agent, 'iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT') - $._environment.reporter.report($this, 'Apache is installed.') - If: $.userName != '' Then: - - $linux: new(conf:Linux) - $linux.runCommand($.instance.agent, 'service apache2 stop') - $fileReplacements: "%USER_NAME%": $.userName diff --git a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/DeployApache.template b/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/DeployApache.template deleted file mode 100644 index 1974d689..00000000 --- a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/DeployApache.template +++ /dev/null @@ -1,31 +0,0 @@ -# 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. - -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Apache - -Parameters: - enablePHP: $enablePHP - -Body: | - return apacheDeploy('{0}'.format(args.enablePHP)).stdout - -Scripts: - apacheDeploy: - Type: Application - Version: 1.0.0 - EntryPoint: runApacheDeploy.sh - Files: [] - Options: - captureStdout: true - captureStderr: true diff --git a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/scripts/runApacheDeploy.sh b/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/scripts/runApacheDeploy.sh deleted file mode 100644 index a1bf0207..00000000 --- a/murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/scripts/runApacheDeploy.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# 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. - -sudo apt-get update -sudo apt-get -y install apache2 - -if [[ $1 == "True" ]]; -then - sudo apt-get -y install php5 -fi - -sudo iptables -I INPUT 1 -p tcp -m tcp --dport 443 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTPS port 443" -sudo iptables -I INPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTP port 80" diff --git a/murano/tests/functional/engine/test_deployment.py b/murano/tests/functional/engine/test_deployment.py index 85b7e267..9d658088 100644 --- a/murano/tests/functional/engine/test_deployment.py +++ b/murano/tests/functional/engine/test_deployment.py @@ -119,7 +119,6 @@ class MuranoDeploymentTest(core.MuranoTestsCore): "name": self.rand_name("mrn-test"), }, "name": self.rand_name("ssc-test"), - "enablePHP": True, "userName": self.rand_name("user"), "?": { "type": "io.murano.apps.test.ApacheHttpServerCustom",