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
This commit is contained in:
Kirill Zaitsev 2015-10-16 14:13:56 +03:00
parent 5c2f385fc1
commit 17f3bbcd16
4 changed files with 7 additions and 63 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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",