Browse Source

Merge "Remove congress and mistral functional integration tests"

Zuul 8 months ago
parent
commit
ba9f53100e
55 changed files with 17 additions and 2810 deletions
  1. 0
    18
      functionaltests/post_test_hook.sh
  2. 0
    8
      functionaltests/pre_test_hook.sh
  3. 0
    3
      functionaltests/pre_test_hook_common.sh
  4. 0
    6
      functionaltests/pre_test_hook_congress.sh
  5. 0
    5
      functionaltests/pre_test_hook_mistral.sh
  6. 0
    16
      functionaltests/run_tests_common.sh
  7. 0
    17
      functionaltests/run_tests_congress_mistral.sh
  8. 6
    0
      murano/tests/functional/README.rst
  9. 0
    0
      murano/tests/functional/__init__.py
  10. 0
    0
      murano/tests/functional/common/__init__.py
  11. 0
    49
      murano/tests/functional/common/tempest_utils.py
  12. 0
    546
      murano/tests/functional/common/utils.py
  13. 0
    30
      murano/tests/functional/common/zip_utils_mixin.py
  14. 0
    0
      murano/tests/functional/engine/__init__.py
  15. 0
    45
      murano/tests/functional/engine/config.conf.sample
  16. 0
    88
      murano/tests/functional/engine/config.py
  17. 0
    81
      murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml
  18. 0
    175
      murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/LICENSE
  19. 0
    8
      murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/index.html
  20. 0
    28
      murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/manifest.yaml
  21. 0
    55
      murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Classes/Lighttpd.yaml
  22. 0
    175
      murano/tests/functional/engine/io.murano.apps.test.Lighttpd/LICENSE
  23. 0
    27
      murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Resources/DeployLighttpd.template
  24. 0
    14
      murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Resources/scripts/deployLighttpd.sh
  25. 0
    24
      murano/tests/functional/engine/io.murano.apps.test.Lighttpd/manifest.yaml
  26. 0
    47
      murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Classes/UpdateExecutor.yaml
  27. 0
    175
      murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/LICENSE
  28. 0
    30
      murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Resources/Update.template
  29. 0
    14
      murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Resources/scripts/update.sh
  30. 0
    22
      murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/manifest.yaml
  31. 0
    48
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Classes/ExampleChef.yaml
  32. 0
    22
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/DeployExampleChef.template
  33. 0
    7
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/README.rdoc
  34. 0
    8
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/metadata.rb
  35. 0
    10
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/recipes/install.rb
  36. 0
    10
      murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/manifest.yaml
  37. 0
    46
      murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Classes/ExamplePuppet.yaml
  38. 0
    20
      murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Resources/DeployExamplePuppet.template
  39. 0
    4
      murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Resources/scripts/test/manifests/install.pp
  40. 0
    10
      murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/manifest.yaml
  41. 0
    238
      murano/tests/functional/engine/manager.py
  42. 0
    87
      murano/tests/functional/engine/test_conf_language_support.py
  43. 0
    138
      murano/tests/functional/engine/test_deployment.py
  44. 0
    0
      murano/tests/functional/integration/__init__.py
  45. 0
    156
      murano/tests/functional/integration/integration_base.py
  46. 0
    32
      murano/tests/functional/integration/io.murano.apps.test.MistralShowcaseApp/Classes/MistralShowcaseApp.yaml
  47. 0
    24
      murano/tests/functional/integration/io.murano.apps.test.MistralShowcaseApp/Resources/TestEcho_MistralWorkflow.yaml
  48. 0
    10
      murano/tests/functional/integration/io.murano.apps.test.MistralShowcaseApp/manifest.yaml
  49. 0
    48
      murano/tests/functional/integration/io.murano.apps.test.PolicyEnforcementTestApp/Classes/PolicyEnforcementTestApp.yaml
  50. 0
    10
      murano/tests/functional/integration/io.murano.apps.test.PolicyEnforcementTestApp/manifest.yaml
  51. 0
    18
      murano/tests/functional/integration/rules_murano_action.txt
  52. 0
    7
      murano/tests/functional/integration/rules_murano_system.txt
  53. 0
    61
      murano/tests/functional/integration/test_mistral.py
  54. 0
    88
      murano/tests/functional/integration/test_policy_enf.py
  55. 11
    2
      murano/tests/unit/engine/system/test_workflowclient.py

+ 0
- 18
functionaltests/post_test_hook.sh View File

@@ -1,18 +0,0 @@
1
-#!/bin/bash
2
-
3
-# This script is executed inside post_test_hook function in devstack gate.
4
-
5
-cd /opt/stack/new/murano/functionaltests
6
-
7
-# Allow to execute other run_tests_*.sh script based on first parameter
8
-RUN_TEST_SUFFIX=""
9
-if [ "$#" -ge 1 ]; then
10
-    RUN_TEST_SUFFIX=_$1
11
-fi
12
-sudo ./run_tests$RUN_TEST_SUFFIX.sh
13
-RETVAL=$?
14
-
15
-# Copy tempest log files to be published among other logs upon job completion
16
-sudo cp /opt/stack/new/murano/functionaltests/tempest.log /opt/stack/logs
17
-
18
-exit $RETVAL

+ 0
- 8
functionaltests/pre_test_hook.sh View File

@@ -1,8 +0,0 @@
1
-#!/bin/bash
2
-
3
-# This script is executed inside pre_test_hook function in devstack gate.
4
-
5
-# Install Murano devstack integration
6
-. ./pre_test_hook_common.sh
7
-MURANO_BASE=/opt/stack/new/murano/contrib/devstack
8
-

+ 0
- 3
functionaltests/pre_test_hook_common.sh View File

@@ -1,3 +0,0 @@
1
-#!/bin/bash
2
-
3
-DEVSTACK_BASE=/opt/stack/new/devstack

+ 0
- 6
functionaltests/pre_test_hook_congress.sh View File

@@ -1,6 +0,0 @@
1
-#!/bin/bash
2
-
3
-# Install Congress devstack integration
4
-. ./pre_test_hook_common.sh
5
-CONGRESS_BASE=/opt/stack/new/congress/contrib/devstack
6
-

+ 0
- 5
functionaltests/pre_test_hook_mistral.sh View File

@@ -1,5 +0,0 @@
1
-#!/bin/bash
2
-
3
-# Install Mistral devstack integration
4
-. ./pre_test_hook_common.sh
5
-MISTRAL_BASE=/opt/stack/new/mistral/contrib/devstack

+ 0
- 16
functionaltests/run_tests_common.sh View File

@@ -1,16 +0,0 @@
1
-#!/bin/bash
2
-
3
-# Intended be sourced by other scripts
4
-
5
-# How many seconds to wait for the API to be responding before giving up
6
-API_RESPONDING_TIMEOUT=20
7
-
8
-if ! timeout ${API_RESPONDING_TIMEOUT} sh -c "while ! curl -s http://127.0.0.1/application-catalog/v1/ 2>/dev/null | grep -q 'Unauthorized' ; do sleep 1; done"; then
9
-    echo "Murano API failed to respond within ${API_RESPONDING_TIMEOUT} seconds"
10
-    exit 1
11
-fi
12
-
13
-echo "Successfully contacted Murano API"
14
-
15
-# Where tempest code lives
16
-TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest}

+ 0
- 17
functionaltests/run_tests_congress_mistral.sh View File

@@ -1,17 +0,0 @@
1
-#!/bin/bash
2
-
3
-. ./run_tests_common.sh
4
-
5
-# Add tempest source tree to PYTHONPATH
6
-export PYTHONPATH=$PYTHONPATH:$TEMPEST_DIR
7
-
8
-# Add tempest config file path to env variables
9
-export TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc/}
10
-
11
-#installing requirements for tempest
12
-pip install -r $TEMPEST_DIR/requirements.txt
13
-
14
-#installing test requirements for murano
15
-pip install -r ../test-requirements.txt
16
-
17
-nosetests -sv ../murano/tests/functional/integration/test_policy_enf.py ../murano/tests/functional/integration/test_mistral.py

+ 6
- 0
murano/tests/functional/README.rst View File

@@ -0,0 +1,6 @@
1
+=====
2
+MOVED
3
+=====
4
+
5
+The Congress and Mistral functional integration tests has moved to
6
+http://git.openstack.org/cgit/openstack/murano-tempest-plugin

+ 0
- 0
murano/tests/functional/__init__.py View File


+ 0
- 0
murano/tests/functional/common/__init__.py View File


+ 0
- 49
murano/tests/functional/common/tempest_utils.py View File

@@ -1,49 +0,0 @@
1
-# Copyright (c) 2015 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-# http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import congressclient.v1.client as cclient
16
-from keystoneauth1 import identity
17
-from keystoneauth1 import session as ksasession
18
-import keystoneclient.v3 as ksclient
19
-from tempest import config
20
-
21
-import murano.tests.functional.common.utils as common_utils
22
-
23
-CONF = config.CONF
24
-
25
-
26
-class TempestDeployTestMixin(common_utils.DeployTestMixin):
27
-    """Overrides methods to use tempest configuration."""
28
-
29
-    @staticmethod
30
-    @common_utils.memoize
31
-    def keystone_client():
32
-        return ksclient.Client(username=CONF.auth.admin_username,
33
-                               password=CONF.auth.admin_password,
34
-                               tenant_name=CONF.auth.admin_project_name,
35
-                               auth_url=CONF.identity.uri_v3)
36
-
37
-    @staticmethod
38
-    @common_utils.memoize
39
-    def congress_client():
40
-        auth = identity.v3.Password(
41
-            auth_url=CONF.identity.uri_v3,
42
-            username=CONF.auth.admin_username,
43
-            password=CONF.auth.admin_password,
44
-            project_name=CONF.auth.admin_project_name,
45
-            user_domain_name=CONF.auth.admin_domain_name,
46
-            project_domain_name=CONF.auth.admin_domain_name)
47
-        session = ksasession.Session(auth=auth)
48
-        return cclient.Client(session=session,
49
-                              service_type='policy')

+ 0
- 546
murano/tests/functional/common/utils.py View File

@@ -1,546 +0,0 @@
1
-# Copyright (c) 2015 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-# http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import contextlib
16
-import json
17
-import os
18
-import random
19
-import re
20
-import socket
21
-import telnetlib
22
-import time
23
-
24
-from heatclient import client as heatclient
25
-from keystoneclient import exceptions as ks_exceptions
26
-import keystoneclient.v2_0 as keystoneclientv2
27
-import keystoneclient.v3 as keystoneclientv3
28
-from muranoclient import client as mclient
29
-import muranoclient.common.exceptions as exceptions
30
-from muranoclient.glance import client as glare_client
31
-from oslo_log import log as logging
32
-import yaml
33
-
34
-from murano.services import states
35
-import murano.tests.functional.common.zip_utils_mixin as zip_utils
36
-import murano.tests.functional.engine.config as cfg
37
-
38
-
39
-CONF = cfg.cfg.CONF
40
-
41
-LOG = logging.getLogger(__name__)
42
-
43
-
44
-@contextlib.contextmanager
45
-def ignored(*exceptions):
46
-    try:
47
-        yield
48
-    except exceptions:
49
-        pass
50
-
51
-
52
-def memoize(f):
53
-    """Saves result of decorated function to cache
54
-
55
-    Decorator, which saves result of a decorated function
56
-    to cache.
57
-    TTL for cache is 1800 sec
58
-
59
-    :param f: decorated function
60
-    :return: saved result of a decorated function
61
-    """
62
-    cache = {}
63
-
64
-    def decorated_function(*args):
65
-        if args in cache:
66
-            if time.time() - cache[args][1] < 1800:
67
-                return cache[args][0]
68
-            else:
69
-                cache[args] = (f(*args), time.time())
70
-                return cache[args][0]
71
-        else:
72
-            cache[args] = (f(*args), time.time())
73
-            return cache[args][0]
74
-
75
-    return decorated_function
76
-
77
-
78
-class DeployTestMixin(zip_utils.ZipUtilsMixin):
79
-    cfg.load_config()
80
-
81
-# -----------------------------Clients methods---------------------------------
82
-    @staticmethod
83
-    @memoize
84
-    def keystone_client():
85
-        region = CONF.murano.region_name
86
-        if re.match(".*/v3/?$", CONF.murano.auth_url):
87
-            ksclient = keystoneclientv3
88
-        else:
89
-            ksclient = keystoneclientv2
90
-        return ksclient.Client(username=CONF.murano.user,
91
-                               password=CONF.murano.password,
92
-                               tenant_name=CONF.murano.tenant,
93
-                               auth_url=CONF.murano.auth_url,
94
-                               region_name=region)
95
-
96
-    @classmethod
97
-    @memoize
98
-    def heat_client(cls):
99
-        heat_url = cls.keystone_client().service_catalog.url_for(
100
-            service_type='orchestration', endpoint_type='publicURL')
101
-        return heatclient.Client('1',
102
-                                 endpoint=heat_url,
103
-                                 token=cls.keystone_client().auth_token)
104
-
105
-    @classmethod
106
-    @memoize
107
-    def murano_client(cls):
108
-        murano_url = cls.get_murano_url()
109
-        if CONF.murano.packages_service == "glare":
110
-            glare_endpoint = "http://127.0.0.1:9494"
111
-            artifacts_client = glare_client.Client(
112
-                endpoint=glare_endpoint,
113
-                token=cls.keystone_client().auth_token,
114
-                insecure=False, key_file=None, ca_file=None, cert_file=None,
115
-                type_name="murano", type_version=1)
116
-        else:
117
-            artifacts_client = None
118
-        return mclient.Client('1',
119
-                              artifacts_client=artifacts_client,
120
-                              endpoint=murano_url,
121
-                              token=cls.keystone_client().auth_token)
122
-
123
-# --------------------------Specific test methods------------------------------
124
-
125
-    @classmethod
126
-    def deploy_apps(cls, name, *apps):
127
-        """Create and deploy environment.
128
-
129
-        :param name: Murano environment name
130
-        :param apps: App(s), described in JSON format
131
-        :return: Murano environment
132
-        """
133
-        environment = cls.murano_client().environments.create({'name': name})
134
-        cls.init_list("_environments")
135
-        cls._environments.append(environment)
136
-        session = cls.murano_client().sessions.configure(environment.id)
137
-        for app in apps:
138
-            cls.murano_client().services.post(
139
-                environment.id,
140
-                path='/',
141
-                data=app,
142
-                session_id=session.id)
143
-        cls.murano_client().sessions.deploy(environment.id, session.id)
144
-        return environment
145
-
146
-    @classmethod
147
-    def wait_for_final_status(cls, environment, timeout=300):
148
-        """Function for wait final status of environment.
149
-
150
-        :param environment: Murano environment.
151
-        :param timeout: Timeout for waiting environment to get any status
152
-               excluding DEPLOYING state
153
-        """
154
-        start_time = time.time()
155
-        status = environment.manager.get(environment.id).status
156
-        while states.SessionState.DEPLOYING == status:
157
-            if time.time() - start_time > timeout:
158
-                err_msg = ('Deployment not finished in {amount} seconds'
159
-                           .format(amount=timeout))
160
-                LOG.error(err_msg)
161
-                raise RuntimeError(err_msg)
162
-            time.sleep(5)
163
-            status = environment.manager.get(environment.id).status
164
-        dep = cls.murano_client().deployments.list(environment.id)
165
-        reports = cls.murano_client().deployments.reports(environment.id,
166
-                                                          dep[0].id)
167
-        return status, ", ".join([r.text for r in reports])
168
-
169
-# -----------------------------Reports methods---------------------------------
170
-
171
-    @classmethod
172
-    def get_last_deployment(cls, environment):
173
-        """Gets last deployment of Murano environment.
174
-
175
-        :param environment: Murano environment
176
-        :return:
177
-        """
178
-        deployments = cls.murano_client().deployments.list(environment.id)
179
-        return deployments[0]
180
-
181
-    @classmethod
182
-    def get_deployment_report(cls, environment, deployment):
183
-        """Gets reports for environment with specific deployment.
184
-
185
-        :param environment: Murano environment.
186
-        :param deployment: Murano deployment for certain environment
187
-        :return:
188
-        """
189
-        history = ''
190
-        report = cls.murano_client().deployments.reports(
191
-            environment.id, deployment.id)
192
-        for status in report:
193
-            history += '\t{0} - {1}\n'.format(status.created, status.text)
194
-        return history
195
-
196
-    @classmethod
197
-    def _log_report(cls, environment):
198
-        """Used for logging reports on failures.
199
-
200
-        :param environment: Murano environment.
201
-        """
202
-        deployment = cls.get_last_deployment(environment)
203
-        try:
204
-            details = deployment.result['result']['details']
205
-            LOG.warning('Details:\n {details}'.format(details=details))
206
-        except Exception as e:
207
-            LOG.error(e)
208
-        report = cls.get_deployment_report(environment, deployment)
209
-        LOG.debug('Report:\n {report}\n'.format(report=report))
210
-
211
-# -----------------------------Service methods---------------------------------
212
-
213
-    @classmethod
214
-    def add_service(cls, environment, data, session, to_dict=False):
215
-        """This function adds a specific service to environment.
216
-
217
-        :param environment: Murano environment
218
-        :param data: JSON with specific servive to add into
219
-        :param session: Session that is open for environment
220
-        :param to_dict: If True - returns a JSON object with service
221
-                        If False - returns a specific class <Service>
222
-        """
223
-
224
-        LOG.debug('Added service:\n {data}'.format(data=data))
225
-        service = cls.murano_client().services.post(environment.id,
226
-                                                    path='/', data=data,
227
-                                                    session_id=session.id)
228
-        if to_dict:
229
-            return cls._convert_service(service)
230
-        else:
231
-            return service
232
-
233
-    @classmethod
234
-    def services_list(cls, environment):
235
-        """Get a list of environment services.
236
-
237
-        :param environment: Murano environment
238
-        :return: List of <Service> objects
239
-        """
240
-        return cls.murano_client().services.list(environment.id)
241
-
242
-    @classmethod
243
-    def get_service(cls, environment, service_name, to_dict=True):
244
-        """Get a service with specific name from environment.
245
-
246
-        :param to_dict: Convert service to JSON or not to convert
247
-        :param environment: Murano environment
248
-        :param service_name: Service name
249
-        :return: JSON or <Service> object
250
-        """
251
-        for service in cls.services_list(environment):
252
-            if service.name == service_name:
253
-                return cls._convert_service(service) if to_dict else service
254
-
255
-    @classmethod
256
-    def _convert_service(cls, service):
257
-        """Converts a <Service> to JSON object.
258
-
259
-        :param service: <Service> object
260
-        :return: JSON object
261
-        """
262
-        component = service.to_dict()
263
-        component = json.dumps(component)
264
-        return yaml.safe_load(component)
265
-
266
-    @classmethod
267
-    def get_service_id(cls, service):
268
-        """Gets id on <Service> object.
269
-
270
-        :param service: <Service> object
271
-        :return: ID of the Service
272
-        """
273
-        serv = cls._convert_service(service)
274
-        serv_id = serv['?']['id']
275
-        return serv_id
276
-
277
-    @classmethod
278
-    def delete_service(cls, environment, session, service):
279
-        """This function removes a specific service from environment.
280
-
281
-        :param environment: Murano environment
282
-        :param session: Session fir urano environment
283
-        :param service: <Service> object
284
-        :return: Updated murano environment
285
-        """
286
-        cls.murano_client().services.delete(
287
-            environment.id, path='/{0}'.format(cls.get_service_id(service)),
288
-            session_id=session.id)
289
-        LOG.debug('Service with name {0} from environment {1} successfully '
290
-                  'removed'.format(environment.name, service.name))
291
-        updated_env = cls.get_environment(environment)
292
-        return updated_env
293
-
294
-
295
-# -----------------------------Packages methods--------------------------------
296
-
297
-    @classmethod
298
-    def upload_package(cls, package_name, body, app):
299
-        """Uploads a .zip package with parameters to Murano.
300
-
301
-        :param package_name: Package name in Murano repository
302
-        :param body: Categories, tags, etc.
303
-                     e.g. {
304
-                           "categories": ["Application Servers"],
305
-                           "tags": ["tag"]
306
-                           }
307
-        :param app: Correct .zip archive with the application
308
-        :return: Package
309
-        """
310
-        files = {'{0}'.format(package_name): open(app, 'rb')}
311
-        package = cls.murano_client().packages.create(body, files)
312
-        cls.init_list("_packages")
313
-        cls._packages.append(package)
314
-        return package
315
-
316
-# ------------------------------Common methods---------------------------------
317
-
318
-    @classmethod
319
-    def rand_name(cls, name='murano'):
320
-        """Generates random string.
321
-
322
-        :param name: Basic name
323
-        :return:
324
-        """
325
-        return name + str(random.randint(1, 0x7fffffff))
326
-
327
-    @classmethod
328
-    def init_list(cls, list_name):
329
-        if not hasattr(cls, list_name):
330
-            setattr(cls, list_name, [])
331
-
332
-    @classmethod
333
-    def get_murano_url(cls):
334
-        try:
335
-            url = cls.keystone_client().service_catalog.url_for(
336
-                service_type='application-catalog', endpoint_type='publicURL')
337
-        except ks_exceptions.EndpointNotFound:
338
-            url = CONF.murano.murano_url
339
-            LOG.warning("Murano endpoint not found in Keystone. "
340
-                        "Using CONF.")
341
-        return url if 'v1' not in url else "/".join(
342
-            url.split('/')[:url.split('/').index('v1')])
343
-
344
-    @classmethod
345
-    def verify_connection(cls, ip, port):
346
-        """Try to connect to specific ip:port with telnet.
347
-
348
-        :param ip: Ip that you want to check
349
-        :param port: Port that you want to check
350
-        :return: :raise RuntimeError:
351
-        """
352
-        tn = telnetlib.Telnet(ip, port)
353
-        tn.write('GET / HTTP/1.0\n\n')
354
-        try:
355
-            buf = tn.read_all()
356
-            LOG.debug('Data:\n {data}'.format(data=buf))
357
-            if len(buf) != 0:
358
-                tn.sock.sendall(telnetlib.IAC + telnetlib.NOP)
359
-                return
360
-            else:
361
-                raise RuntimeError('Resource at {0}:{1} not exist'.
362
-                                   format(ip, port))
363
-        except socket.error as e:
364
-            LOG.error('Socket Error: {error}'.format(error=e))
365
-
366
-    @classmethod
367
-    def get_ip_by_appname(cls, environment, appname):
368
-        """Returns ip of instance with a deployed application using app name.
369
-
370
-        :param environment: Murano environment
371
-        :param appname: Application name or substring of application name
372
-        :return:
373
-        """
374
-        for service in environment.services:
375
-            if appname in service['name']:
376
-                return service['instance']['floatingIpAddress']
377
-
378
-    @classmethod
379
-    def get_ip_by_instance_name(cls, environment, inst_name):
380
-        """Returns ip of instance using instance name.
381
-
382
-        :param environment: Murano environment
383
-        :param name: String, which is substring of name of instance or name of
384
-        instance
385
-        :return:
386
-        """
387
-        for service in environment.services:
388
-            if inst_name in service['instance']['name']:
389
-                return service['instance']['floatingIpAddress']
390
-
391
-    @classmethod
392
-    def get_k8s_ip_by_instance_name(cls, environment, inst_name, service_name):
393
-        """Returns ip of specific kubernetes node (gateway, master, minion).
394
-
395
-        Search depends on service name of kubernetes and names of spawned
396
-        instances
397
-        :param environment: Murano environment
398
-        :param inst_name: Name of instance or substring of instance name
399
-        :param service_name: Name of Kube Cluster application in Murano
400
-        environment
401
-        :return: Ip of Kubernetes instances
402
-        """
403
-        for service in environment.services:
404
-            if service_name in service['name']:
405
-                if "gateway" in inst_name:
406
-                    for gateway in service['gatewayNodes']:
407
-                        if inst_name in gateway['instance']['name']:
408
-                            LOG.debug(gateway['instance']['floatingIpAddress'])
409
-                            return gateway['instance']['floatingIpAddress']
410
-                elif "master" in inst_name:
411
-                    LOG.debug(service['masterNode']['instance'][
412
-                        'floatingIpAddress'])
413
-                    return service['masterNode']['instance'][
414
-                        'floatingIpAddress']
415
-                elif "minion" in inst_name:
416
-                    for minion in service['minionNodes']:
417
-                        if inst_name in minion['instance']['name']:
418
-                            LOG.debug(minion['instance']['floatingIpAddress'])
419
-                            return minion['instance']['floatingIpAddress']
420
-
421
-# -----------------------------Cleanup methods---------------------------------
422
-
423
-    @classmethod
424
-    def purge_uploaded_packages(cls):
425
-        """Cleanup for uploaded packages."""
426
-        cls.init_list("_packages")
427
-        try:
428
-            for pkg in cls._packages:
429
-                with ignored(Exception):
430
-                    cls.murano_client().packages.delete(pkg.id)
431
-        finally:
432
-            cls._packages = []
433
-        cls.init_list("_package_files")
434
-        try:
435
-            for pkg_file in cls._package_files:
436
-                os.remove(pkg_file)
437
-        finally:
438
-            cls._package_files = []
439
-
440
-    @classmethod
441
-    def purge_environments(cls):
442
-        """Cleanup for created environments."""
443
-        cls.init_list("_environments")
444
-        try:
445
-            for env in cls._environments:
446
-                with ignored(Exception):
447
-                    LOG.debug('Processing cleanup for environment {0} ({1})'.
448
-                              format(env.name, env.id))
449
-                    cls.environment_delete(env.id)
450
-                    cls.purge_stacks(env.id)
451
-                    time.sleep(5)
452
-        finally:
453
-            cls._environments = []
454
-
455
-    @classmethod
456
-    def purge_stacks(cls, environment_id):
457
-        stack = cls._get_stack(environment_id)
458
-        if not stack:
459
-            return
460
-        else:
461
-            cls.heat_client().stacks.delete(stack.id)
462
-
463
-# -----------------------Methods for environment CRUD--------------------------
464
-
465
-    @classmethod
466
-    def create_environment(cls, name=None):
467
-        """Creates Murano environment with random name.
468
-
469
-
470
-        :param name: Environment name
471
-        :return: Murano environment
472
-        """
473
-        if not name:
474
-            name = cls.rand_name('MuranoTe')
475
-        environment = cls.murano_client().environments.create({'name': name})
476
-        cls._environments.append(environment)
477
-        return environment
478
-
479
-    @classmethod
480
-    def get_environment(cls, environment):
481
-        """Refresh <Environment> variable.
482
-
483
-        :param environment: Murano environment.
484
-        :return: Murano environment.
485
-        """
486
-        return cls.murano_client().environments.get(environment.id)
487
-
488
-    @classmethod
489
-    def environment_delete(cls, environment_id, timeout=180):
490
-        """Remove Murano environment.
491
-
492
-        :param environment_id: ID of Murano environment
493
-        :param timeout: Timeout to environment get deleted
494
-        :return: :raise RuntimeError:
495
-        """
496
-        try:
497
-            cls.murano_client().environments.delete(environment_id)
498
-
499
-            start_time = time.time()
500
-            while time.time() - start_time < timeout:
501
-                try:
502
-                    cls.murano_client().environments.get(environment_id)
503
-                except exceptions.HTTPNotFound:
504
-                    LOG.debug('Environment with id {0} successfully deleted.'.
505
-                              format(environment_id))
506
-                    return
507
-            err_msg = ('Environment {0} was not deleted in {1} seconds'.
508
-                       format(environment_id, timeout))
509
-            LOG.error(err_msg)
510
-            raise RuntimeError(err_msg)
511
-        except Exception as exc:
512
-            LOG.debug('Environment with id {0} going to be abandoned.'.
513
-                      format(environment_id))
514
-            LOG.exception(exc)
515
-            cls.murano_client().environments.delete(environment_id,
516
-                                                    abandon=True)
517
-
518
-# -----------------------Methods for session actions---------------------------
519
-
520
-    @classmethod
521
-    def create_session(cls, environment):
522
-        return cls.murano_client().sessions.configure(environment.id)
523
-
524
-    @classmethod
525
-    def delete_session(cls, environment, session):
526
-        return cls.murano_client().sessions.delete(environment.id, session.id)
527
-
528
-
529
-# -------------------------------Heat methods----------------------------------
530
-
531
-    @classmethod
532
-    def _get_stack(cls, environment_id):
533
-
534
-        for stack in cls.heat_client().stacks.list():
535
-            stack_description = (
536
-                cls.heat_client().stacks.get(stack.id).description)
537
-            if not stack_description:
538
-                err_msg = ("Stack {0} description is empty".format(stack.id))
539
-                LOG.error(err_msg)
540
-                raise RuntimeError(err_msg)
541
-            if environment_id in stack_description:
542
-                return stack
543
-
544
-    @classmethod
545
-    def get_stack_template(cls, stack):
546
-        return cls.heat_client().stacks.template(stack.stack_name)

+ 0
- 30
murano/tests/functional/common/zip_utils_mixin.py View File

@@ -1,30 +0,0 @@
1
-# Copyright (c) 2015 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-# http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import os
16
-import zipfile
17
-
18
-
19
-class ZipUtilsMixin(object):
20
-    @staticmethod
21
-    def zip_dir(parent_dir, dir):
22
-        abs_path = os.path.join(parent_dir, dir)
23
-        path_len = len(abs_path) + 1
24
-        zip_file = abs_path + ".zip"
25
-        with zipfile.ZipFile(zip_file, "w") as zf:
26
-            for dir_name, _, files in os.walk(abs_path):
27
-                for filename in files:
28
-                    fn = os.path.join(dir_name, filename)
29
-                    zf.write(fn, fn[path_len:])
30
-        return zip_file

+ 0
- 0
murano/tests/functional/engine/__init__.py View File


+ 0
- 45
murano/tests/functional/engine/config.conf.sample View File

@@ -1,45 +0,0 @@
1
-[murano]
2
-# keystone url
3
-# auth_url = http://127.0.0.1:5000/v2.0/
4
-
5
-# keystone user
6
-# user = admin
7
-
8
-# password for keystone user
9
-# password = admin
10
-
11
-# keystone tenant
12
-# tenant = admin
13
-
14
-# keyname - used for debugging murano-agent
15
-# keyname = keyname
16
-
17
-# murano url
18
-# murano_url = http://127.0.0.1:8082
19
-
20
-# Flavor for sanity checks
21
-# standard_flavor = m1.medium
22
-
23
-# Flavor for advanced checks
24
-# advanced_flavor = m1.medium
25
-
26
-# image for linux services
27
-# linux_image = default_linux
28
-
29
-# murano instance type
30
-# instance_type = io.murano.resources.LinuxMuranoInstance
31
-
32
-# image for docker applications
33
-# docker_image = debian-8-docker.qcow2
34
-
35
-# image for kubernetes applications
36
-# kubernetes_image = ubuntu14.04-x64-kubernetes.qcow2
37
-
38
-# image for windows services
39
-# windows_image = default_windows
40
-
41
-# image for hdp sandbox
42
-# hdp_image = hdp-sandbox
43
-
44
-# region name for services
45
-# region_name = None

+ 0
- 88
murano/tests/functional/engine/config.py View File

@@ -1,88 +0,0 @@
1
-# Copyright (c) 2015 Mirantis, Inc.
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-#      http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import os
16
-
17
-from oslo_config import cfg
18
-
19
-
20
-murano_group = cfg.OptGroup(name='murano', title="murano")
21
-
22
-MuranoGroup = [
23
-    cfg.StrOpt('auth_url',
24
-               default='http://127.0.0.1:5000',
25
-               help="keystone url"),
26
-    cfg.StrOpt('user',
27
-               default='admin',
28
-               help="keystone user"),
29
-    cfg.StrOpt('password',
30
-               default='pass',
31
-               help="password for keystone user"),
32
-    cfg.StrOpt('tenant',
33
-               default='admin',
34
-               help='keystone tenant'),
35
-    cfg.StrOpt('keyname',
36
-               default='',
37
-               help='name of keypair for debugging'),
38
-    cfg.StrOpt('murano_url',
39
-               default='http://127.0.0.1:8082/v1/',
40
-               help="murano url"),
41
-    cfg.StrOpt('standard_flavor',
42
-               default='m1.medium',
43
-               help="flavor for sanity tests"),
44
-    cfg.StrOpt('advanced_flavor',
45
-               default='m1.large',
46
-               help="flavor for advanced tests"),
47
-    cfg.StrOpt('linux_image',
48
-               default='default_linux',
49
-               help="image for linux services"),
50
-    cfg.StrOpt('instance_type',
51
-               default='io.murano.resources.LinuxMuranoInstance',
52
-               help="murano instance type"),
53
-    cfg.StrOpt('docker_image',
54
-               default='ubuntu14.04-x64-docker',
55
-               help="image for docker applications"),
56
-    cfg.StrOpt('windows_image',
57
-               default='default_windows',
58
-               help="image for windows services"),
59
-    cfg.StrOpt('hdp_image',
60
-               default="hdp-sandbox",
61
-               help="image for hdp-sandbox"),
62
-    cfg.StrOpt('kubernetes_image',
63
-               default="ubuntu14.04-x64-kubernetes",
64
-               help="image for kubernetes"),
65
-    cfg.StrOpt('region_name', help="region name for services"),
66
-    cfg.StrOpt('packages_service',
67
-               default='murano',
68
-               help='murano packages service, either "murano" or "glare"')
69
-]
70
-
71
-CONF = cfg.CONF
72
-
73
-
74
-def register_config(config, config_group, config_opts):
75
-
76
-    config.register_group(config_group)
77
-    config.register_opts(config_opts, config_group)
78
-
79
-
80
-def load_config():
81
-    __location = os.path.realpath(os.path.join(os.getcwd(),
82
-                                  os.path.dirname(__file__)))
83
-    path = os.path.join(__location, "config.conf")
84
-
85
-    if os.path.exists(path):
86
-        CONF([], project='muranointegration', default_config_files=[path])
87
-
88
-    register_config(CONF, murano_group, MuranoGroup)

+ 0
- 81
murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Classes/ApacheHttpServer.yaml View File

@@ -1,81 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Namespaces:
14
-  =: io.murano.apps.test
15
-  std: io.murano
16
-  res: io.murano.resources
17
-  sys: io.murano.system
18
-  conf: io.murano.configuration
19
-
20
-
21
-Name: ApacheHttpServerCustom
22
-
23
-Extends: std:Application
24
-
25
-Properties:
26
-  name:
27
-    Contract: $.string().notNull()
28
-
29
-  instance:
30
-    Contract: $.class(res:Instance).notNull()
31
-
32
-  userName:
33
-    Contract: $.string()
34
-
35
-Methods:
36
-  initialize:
37
-    Body:
38
-      - $._environment: $.find(std:Environment).require()
39
-
40
-  deploy:
41
-    Body:
42
-      - If: not $.getAttr(deployed, false)
43
-        Then:
44
-          - $._environment.reporter.report($this, 'Creating VM for Apache Server.')
45
-          - $securityGroupIngress:
46
-            - ToPort: 80
47
-              FromPort: 80
48
-              IpProtocol: tcp
49
-              External: true
50
-            - ToPort: 443
51
-              FromPort: 443
52
-              IpProtocol: tcp
53
-              External: true
54
-          - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
55
-          - $.instance.deploy()
56
-          - $._environment.reporter.report($this, 'Instance is created. Deploying Apache')
57
-
58
-          - $resources: new(sys:Resources)
59
-          - $linux: new(conf:Linux)
60
-
61
-          - $linux.runCommand($.instance.agent, 'apt-get -y install apache2')
62
-          - $linux.runCommand($.instance.agent, 'iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT')
63
-          - $linux.runCommand($.instance.agent, 'iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT')
64
-          - $._environment.reporter.report($this, 'Apache is installed.')
65
-
66
-          - If: $.userName != ''
67
-            Then:
68
-              - $linux.runCommand($.instance.agent, 'service apache2 stop')
69
-              - $fileReplacements:
70
-                  "%USER_NAME%": $.userName
71
-              - $fileContent: $resources.string('index.html').replace($fileReplacements)
72
-              - $linux.putFile($.instance.agent, $fileContent, '/var/www/html/index.html')
73
-              - $linux.runCommand($.instance.agent, 'service apache2 start')
74
-
75
-          - If: $.instance.assignFloatingIp
76
-            Then:
77
-              - $host: $.instance.floatingIpAddress
78
-            Else:
79
-              - $host: $.instance.ipAddresses[0]
80
-          - $._environment.reporter.report($this, format('Apache is available at http://{0}', $host))
81
-          - $.setAttr(deployed, true)

+ 0
- 175
murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/LICENSE View File

@@ -1,175 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.

+ 0
- 8
murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/Resources/index.html View File

@@ -1,8 +0,0 @@
1
-<!DOCTYPE html>
2
-<html>
3
-<head>
4
-<title> Hello World</title>
5
-</head>
6
-<body>Hello world. This is my first web page. My name is %USER_NAME%.
7
-</body>
8
-</html>

+ 0
- 28
murano/tests/functional/engine/io.murano.apps.test.ApacheHttpServerCustom/manifest.yaml View File

@@ -1,28 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Format: 1.0
14
-Type: Application
15
-FullName: io.murano.test.apache.ApacheHttpServerCustom
16
-Name: Apache HTTP Server Custom
17
-Description: |
18
- The Apache HTTP Server Project is an effort to develop and maintain an
19
- open-source HTTP server for modern operating systems including UNIX and
20
- Windows NT. The goal of this project is to provide a secure, efficient and
21
- extensible server that provides HTTP services in sync with the current HTTP
22
- standards.
23
- Apache httpd has been the most popular web server on the Internet since
24
- April 1996, and celebrated its 17th birthday as a project this February.
25
-Author: 'Mirantis, Inc'
26
-Tags: [HTTP, Server, WebServer, HTML, Apache]
27
-Classes:
28
- io.murano.apps.test.ApacheHttpServerCustom: ApacheHttpServer.yaml

+ 0
- 55
murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Classes/Lighttpd.yaml View File

@@ -1,55 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Namespaces:
14
-  =: io.murano.apps.test
15
-  std: io.murano
16
-  sys: io.murano.system
17
-
18
-Name: Lighttpd
19
-
20
-Extends: std:Application
21
-
22
-Properties:
23
-  updater:
24
-    Contract: $.class(UpdateExecutor).notNull()
25
-
26
-Methods:
27
-  initialize:
28
-    Body:
29
-      - $._environment: $.find(std:Environment).require()
30
-
31
-  deploy:
32
-    Body:
33
-      - If: not $.getAttr(deployed, false)
34
-        Then:
35
-          - $securityGroupIngress:
36
-            - ToPort: 80
37
-              FromPort: 80
38
-              IpProtocol: tcp
39
-              External: true
40
-            - ToPort: 443
41
-              FromPort: 443
42
-              IpProtocol: tcp
43
-              External: true
44
-          - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
45
-          - $._environment.reporter.report($this, 'Ensuring Updater is deployed.')
46
-          - $.updater.deploy()
47
-          - $resources: new(sys:Resources)
48
-          - $template: $resources.yaml('DeployLighttpd.template')
49
-          - $.updater.instance.agent.call($template, $resources)
50
-
51
-          - If: $.updater.instance.assignFloatingIp
52
-            Then:
53
-              - $address: $.updater.instance.floatingIpAddress
54
-              - $._environment.reporter.report($this, format('Running at http://{0}', $address))
55
-          - $.setAttr(deployed, true)

+ 0
- 175
murano/tests/functional/engine/io.murano.apps.test.Lighttpd/LICENSE View File

@@ -1,175 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.

+ 0
- 27
murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Resources/DeployLighttpd.template View File

@@ -1,27 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-FormatVersion: 2.0.0
14
-Version: 1.0.0
15
-Name: Deploy Lighttpd
16
-
17
-Body: |
18
- deploy()
19
-
20
-Scripts:
21
-  deploy:
22
-    Type: Application
23
-    Version: 1.0.0
24
-    EntryPoint: deployLighttpd.sh
25
-    Options:
26
-      captureStdout: true
27
-      captureStderr: true

+ 0
- 14
murano/tests/functional/engine/io.murano.apps.test.Lighttpd/Resources/scripts/deployLighttpd.sh View File

@@ -1,14 +0,0 @@
1
-#!/bin/bash
2
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
3
-#  not use this file except in compliance with the License. You may obtain
4
-#  a copy of the License at
5
-#
6
-#       http://www.apache.org/licenses/LICENSE-2.0
7
-#
8
-#  Unless required by applicable law or agreed to in writing, software
9
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
-#  License for the specific language governing permissions and limitations
12
-#  under the License.
13
-
14
-sudo apt-get -y -q install lighttpd

+ 0
- 24
murano/tests/functional/engine/io.murano.apps.test.Lighttpd/manifest.yaml View File

@@ -1,24 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Format: 1.0
14
-Type: Application
15
-FullName: io.murano.apps.test.Lighttpd
16
-Name: Lighttpd
17
-Description: |
18
- Lighttpd... :)
19
-Author: 'Mirantis, Inc'
20
-Tags: [Web]
21
-Classes:
22
- io.murano.apps.test.Lighttpd: Lighttpd.yaml
23
-Require:
24
- io.murano.apps.test.UpdateExecutor:

+ 0
- 47
murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Classes/UpdateExecutor.yaml View File

@@ -1,47 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Namespaces:
14
-  =: io.murano.apps.test
15
-  std: io.murano
16
-  res: io.murano.resources
17
-  sys: io.murano.system
18
-
19
-
20
-Name: UpdateExecutor
21
-
22
-Extends: std:Application
23
-
24
-Properties:
25
-  name:
26
-    Contract: $.string().notNull()
27
-
28
-  instance:
29
-    Contract: $.class(res:Instance).notNull()
30
-
31
-Methods:
32
-  initialize:
33
-    Body:
34
-      - $._environment: $.find(std:Environment).require()
35
-
36
-  deploy:
37
-    Body:
38
-      - If: not $.getAttr(deployed, false)
39
-        Then:
40
-          - $._environment.reporter.report($this, 'Creating VM.')
41
-          - $.instance.deploy()
42
-          - $resources: new(sys:Resources)
43
-          - $template: $resources.yaml('Update.template')
44
-          - $._environment.reporter.report($this, 'Starting packages updating.')
45
-          - $.instance.agent.call($template, $resources)
46
-          - $._environment.reporter.report($this, 'Update completed.')
47
-          - $.setAttr(deployed, true)

+ 0
- 175
murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/LICENSE View File

@@ -1,175 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.

+ 0
- 30
murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Resources/Update.template View File

@@ -1,30 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-FormatVersion: 2.0.0
14
-Version: 1.0.0
15
-Name: Update
16
-
17
-Parameters:
18
-
19
-Body: |
20
-  update()
21
-
22
-Scripts:
23
-  update:
24
-    Type: Application
25
-    Version: 1.0.0
26
-    EntryPoint: update.sh
27
-    Files: []
28
-    Options:
29
-      captureStdout: true
30
-      captureStderr: true

+ 0
- 14
murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/Resources/scripts/update.sh View File

@@ -1,14 +0,0 @@
1
-#!/bin/bash
2
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
3
-#  not use this file except in compliance with the License. You may obtain
4
-#  a copy of the License at
5
-#
6
-#       http://www.apache.org/licenses/LICENSE-2.0
7
-#
8
-#  Unless required by applicable law or agreed to in writing, software
9
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
-#  License for the specific language governing permissions and limitations
12
-#  under the License.
13
-
14
-sudo apt-get update

+ 0
- 22
murano/tests/functional/engine/io.murano.apps.test.UpdateExecutor/manifest.yaml View File

@@ -1,22 +0,0 @@
1
-#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#  not use this file except in compliance with the License. You may obtain
3
-#  a copy of the License at
4
-#
5
-#       http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#  Unless required by applicable law or agreed to in writing, software
8
-#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#  License for the specific language governing permissions and limitations
11
-#  under the License.
12
-
13
-Format: 1.0
14
-Type: Application
15
-FullName: io.murano.apps.test.UpdateExecutor
16
-Name: Update Executor
17
-Description: |
18
- Test application, which updates packages on VM
19
-Author: 'Mirantis, Inc'
20
-Tags: [application]
21
-Classes:
22
- io.murano.apps.test.UpdateExecutor: UpdateExecutor.yaml

+ 0
- 48
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Classes/ExampleChef.yaml View File

@@ -1,48 +0,0 @@
1
-Namespaces:
2
-  =: io.murano.conflang.chef
3
-  std: io.murano
4
-  res: io.murano.resources
5
-  sys: io.murano.system
6
-
7
-
8
-Name: ExampleChef
9
-
10
-Extends: std:Application
11
-
12
-Properties:
13
-
14
-  instance:
15
-    Contract: $.class(res:Instance).notNull()
16
-
17
-
18
-
19
-Methods:
20
-  initialize:
21
-    Body:
22
-      - $._environment: $.find(std:Environment).require()
23
-
24
-  deploy:
25
-    Body:
26
-      - If: not $.getAttr(deployed, false)
27
-        Then:
28
-          - $._environment.reporter.report($this, 'Creating VM for  Chef example ')
29
-          - $securityGroupIngress:
30
-              - ToPort: 22
31
-                FromPort: 22
32
-                IpProtocol: tcp
33
-                External: true
34
-          - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
35
-          - $.instance.deploy()
36
-          - $resources: new(sys:Resources)
37
-          # Deploy Chef example
38
-          - $template: $resources.yaml('DeployExampleChef.template')
39
-
40
-          - $._environment.reporter.report($this, 'Instance is created. Deploying Chef example')
41
-          - $.instance.agent.call($template, $resources)
42
-          - If: $.instance.assignFloatingIp
43
-            Then:
44
-              - $host: $.instance.floatingIpAddress
45
-            Else:
46
-              - $host: $.instance.ipAddresses[0]
47
-          - $._environment.reporter.report($this, format('Chef example is installed at {0}', $host))
48
-          - $.setAttr(deployed, true)

+ 0
- 22
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/DeployExampleChef.template View File

@@ -1,22 +0,0 @@
1
-FormatVersion: 2.1.0
2
-Version: 1.0.0
3
-Name: Deploy Example Chef
4
-
5
-Parameters:
6
-  port: $port
7
-
8
-Body: |
9
-  return executeRecipe(args).stdout
10
-
11
-Scripts:
12
-  executeRecipe:
13
-    Type: Chef
14
-    Version: 1.0.0
15
-    EntryPoint: test::install
16
-    Files:
17
-        -  test/recipes/install.rb
18
-        -  test/metadata.rb
19
-        -  test/README.rdoc
20
-    Options:
21
-      captureStdout: true
22
-      captureStderr: true

+ 0
- 7
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/README.rdoc View File

@@ -1,7 +0,0 @@
1
-= DESCRIPTION:
2
-
3
-= REQUIREMENTS:
4
-
5
-= ATTRIBUTES:
6
-
7
-= USAGE:

+ 0
- 8
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/metadata.rb View File

@@ -1,8 +0,0 @@
1
-#comment
2
-maintainer       "Telefonica I+D"
3
-maintainer_email "henar@tid.es"
4
-name             "test"
5
-license          "All rights reserved"
6
-description      "Default cookbook for testing"
7
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
8
-version          "0.1.0"

+ 0
- 10
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/Resources/scripts/test/recipes/install.rb View File

@@ -1,10 +0,0 @@
1
-script "install" do
2
-  interpreter "bash"
3
-  user "root"
4
-  cwd "/opt"
5
-  code <<-EOH
6
-  echo test install
7
-  EOH
8
-end
9
-
10
-node.normal['test']['action_test'] = "install"

+ 0
- 10
murano/tests/functional/engine/io.murano.conflang.chef.ExampleChef/manifest.yaml View File

@@ -1,10 +0,0 @@
1
-Format: 1.0
2
-Type: Application
3
-FullName: io.murano.conflang.chef.ExampleChef
4
-Name: ExampleChef
5
-Description: |
6
-  Example Chef.
7
-Author: 'TID'
8
-Tags: [Test, Chef]
9
-Classes:
10
- io.murano.conflang.chef.ExampleChef: ExampleChef.yaml

+ 0
- 46
murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Classes/ExamplePuppet.yaml View File

@@ -1,46 +0,0 @@
1
-Namespaces:
2
-  =: io.murano.conflang.puppet
3
-  std: io.murano
4
-  res: io.murano.resources
5
-  sys: io.murano.system
6
-
7
-
8
-Name: ExamplePuppet
9
-
10
-Extends: std:Application
11
-
12
-Properties:
13
-
14
-  instance:
15
-    Contract: $.class(res:Instance).notNull()
16
-
17
-Methods:
18
-  initialize:
19
-    Body:
20
-      - $._environment: $.find(std:Environment).require()
21
-
22
-  deploy:
23
-    Body:
24
-      - If: not $.getAttr(deployed, false)
25
-        Then:
26
-          - $._environment.reporter.report($this, 'Creating VM for Example Chef example ')
27
-          - $securityGroupIngress:
28
-              - ToPort: 22
29
-                FromPort: 22
30
-                IpProtocol: tcp
31
-                External: true
32
-          - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
33
-          - $.instance.deploy()
34
-          - $resources: new(sys:Resources)
35
-          # Deploy Puppet example
36
-          - $template: $resources.yaml('DeployExamplePuppet.template')
37
-
38
-          - $._environment.reporter.report($this, 'Instance is created. Deploying Example Puppet')
39
-          - $.instance.agent.call($template, $resources)
40
-          - If: $.instance.assignFloatingIp
41
-            Then:
42
-              - $host: $.instance.floatingIpAddress
43
-            Else:
44
-              - $host: $.instance.ipAddresses[0]
45
-          - $._environment.reporter.report($this, format('Example Puppet is installed at {0}', $host))
46
-          - $.setAttr(deployed, true)

+ 0
- 20
murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Resources/DeployExamplePuppet.template View File

@@ -1,20 +0,0 @@
1
-FormatVersion: 2.1.0
2
-Version: 1.0.0
3
-Name: Deploy Example Puppet
4
-
5
-Parameters:
6
-  port: $port
7
-
8
-Body: |
9
-  return executeRecipe(args).stdout
10
-
11
-Scripts:
12
-  executeRecipe:
13
-    Type: Puppet
14
-    Version: 1.0.0
15
-    EntryPoint: test::install
16
-    Files:
17
-        -  test/manifests/install.pp
18
-    Options:
19
-      captureStdout: true
20
-      captureStderr: true

+ 0
- 4
murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/Resources/scripts/test/manifests/install.pp View File

@@ -1,4 +0,0 @@
1
-class test::install($version='default_version'){
2
-
3
-        notify {"version: test":}
4
-}

+ 0
- 10
murano/tests/functional/engine/io.murano.conflang.puppet.ExamplePuppet/manifest.yaml View File

@@ -1,10 +0,0 @@
1
-Format: 1.0
2
-Type: Application
3
-FullName: io.murano.conflang.puppet.ExamplePuppet
4
-Name: ExamplePuppet
5
-Description: |
6
-  Example Chef
7
-Author: 'TID'
8
-Tags: [Test, Puppet]
9
-Classes:
10
- io.murano.conflang.puppet.ExamplePuppet: ExamplePuppet.yaml

+ 0
- 238
murano/tests/functional/engine/manager.py View File

@@ -1,238 +0,0 @@
1
-# Copyright (c) 2015 Mirantis, Inc.
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-# http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import os
16
-import socket
17
-import time
18
-import uuid
19
-
20
-from oslo_log import log as logging
21
-import requests
22
-import testresources
23
-import testtools
24
-
25
-import murano.tests.functional.common.utils as utils
26
-import murano.tests.functional.engine.config as cfg
27
-
28
-
29
-CONF = cfg.cfg.CONF
30
-
31
-LOG = logging.getLogger(__name__)
32
-
33
-
34
-class MuranoTestsCore(testtools.TestCase, testtools.testcase.WithAttributes,
35
-                      testresources.ResourcedTestCase, utils.DeployTestMixin):
36
-    """This manager provides access to Murano-api service."""
37
-    @classmethod
38
-    def setUpClass(cls):
39
-        super(MuranoTestsCore, cls).setUpClass()
40
-
41
-        cfg.load_config()
42
-        cls._environments = []
43
-
44
-    def tearDown(self):
45
-        super(MuranoTestsCore, self).tearDown()
46
-        self.purge_environments()
47
-
48
-# --------------------------Specific test methods------------------------------
49
-
50
-    def wait_for_environment_deploy(self, environment):
51
-        """Wait for successful deployment of Murano environment.
52
-
53
-        Logging deployments and reports of failure.
54
-        :param environment: Murano environment
55
-        :return: Murano environment
56
-        """
57
-        start_time = time.time()
58
-        status = environment.manager.get(environment.id).status
59
-        while status != 'ready':
60
-            status = environment.manager.get(environment.id).status
61
-            if time.time() - start_time > 1800:
62
-                time.sleep(60)
63
-                self._log_report(environment)
64
-                self.fail(
65
-                    'Environment deployment is not finished in 1200 seconds')
66
-            elif status == 'deploy failure':
67
-                self._log_report(environment)
68
-                time.sleep(60)
69
-                self.fail('Environment has incorrect status {0}'.
70
-                          format(status))
71
-            time.sleep(5)
72
-        LOG.debug('Environment {env_name} is ready'.format(
73
-            env_name=environment.name))
74
-        return environment.manager.get(environment.id)
75
-
76
-    def status_check(self, environment, configurations, kubernetes=False):
77
-        """Function which gives opportunity to check any count of instances.
78
-
79
-        :param environment: Murano environment
80
-        :param configurations: Array of configurations.
81
-        :param kubernetes: Used for parsing multiple instances in one service
82
-               False by default.
83
-        Example: [[instance_name, *ports], [instance_name, *ports]] ...
84
-        Example k8s: [[cluster['name'], instance_name, *ports], [...], ...]
85
-        """
86
-        for configuration in configurations:
87
-            if kubernetes:
88
-                service_name = configuration[0]
89
-                LOG.debug('Service: {service_name}'.format(
90
-                    service_name=service_name))
91
-                inst_name = configuration[1]
92
-                LOG.debug('Instance: {instance_name}'.format(
93
-                    instance_name=inst_name))
94
-                ports = configuration[2:]
95
-                LOG.debug('Acquired ports: {ports}'.format(ports=ports))
96
-                ip = self.get_k8s_ip_by_instance_name(environment, inst_name,
97
-                                                      service_name)
98
-                if ip and ports:
99
-                    for port in ports:
100
-                        self.check_port_access(ip, port)
101
-                        self.check_k8s_deployment(ip, port)
102
-                else:
103
-                    self.fail('Instance does not have floating IP')
104
-            else:
105
-                inst_name = configuration[0]
106
-                ports = configuration[1:]
107
-                ip = self.get_ip_by_instance_name(environment, inst_name)
108
-                if ip and ports:
109
-                    for port in ports:
110
-                        self.check_port_access(ip, port)
111
-                else:
112
-                    self.fail('Instance does not have floating IP')
113
-
114
-    def deployment_success_check(self, environment, *ports):
115
-        """Old style deployment check.
116
-
117
-        Checks that environment deployment successfully. Only one instance in
118
-        environment for this function is permitted for using this function.
119
-        :param environment: Murano environment
120
-        :param ports:
121
-        """
122
-        deployment = self.murano_client().deployments.list(environment.id)[-1]
123
-
124
-        self.assertEqual('success', deployment.state,
125
-                         'Deployment status is {0}'.format(deployment.state))
126
-
127
-        ip = environment.services[0]['instance']['floatingIpAddress']
128
-
129
-        if ip:
130
-            for port in ports:
131
-                self.check_port_access(ip, port)
132
-        else:
133
-            self.fail('Instance does not have floating IP')
134
-
135
-    def check_port_access(self, ip, port):
136
-        """Check that ports are opened on specific instances.
137
-
138
-        :param ip: Instance's ip address
139
-        :param port: Port that you want to check
140
-        """
141
-        result = 1
142
-        start_time = time.time()
143
-        while time.time() - start_time < 600:
144
-            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
145
-            result = sock.connect_ex((str(ip), port))
146
-            sock.close()
147
-            if result == 0:
148
-                break
149
-            time.sleep(5)
150
-        self.assertEqual(0, result, '%s port is closed on instance' % port)
151
-
152
-    def check_k8s_deployment(self, ip, port):
153
-        start_time = time.time()
154
-        while time.time() - start_time < 600:
155
-            try:
156
-                LOG.debug('Checking: {ip}:{port}'.format(ip=ip, port=port))
157
-                self.verify_connection(ip, port)
158
-                return
159
-            except RuntimeError as e:
160
-                time.sleep(10)
161
-                LOG.debug(e)
162
-        self.fail('Containers are not ready')
163
-
164
-    def check_path(self, env, path, inst_name=None):
165
-        """Check path of deployed application using requests method 'GET'.
166
-
167
-        :param env: Murano environment.
168
-        :param path: Path to check
169
-        Example: wordpress. e.g. function will check http://<ip>/wordpress
170
-        :param inst_name: If defined, function will search through environment
171
-        for instance ip and after check path.
172
-        """
173
-        environment = env.manager.get(env.id)
174
-        if inst_name:
175
-            ip = self.get_ip_by_instance_name(environment, inst_name)
176
-        else:
177
-            ip = environment.services[0]['instance']['floatingIpAddress']
178
-        resp = requests.get('http://{0}/{1}'.format(ip, path))
179
-        if resp.status_code == 200:
180
-            return resp
181
-        else:
182
-            self.fail("Service path unavailable")
183
-
184
-    def deploy_environment(self, environment, session):
185
-        self.murano_client().sessions.deploy(environment.id, session.id)
186
-        return self.wait_for_environment_deploy(environment)
187
-
188
-    def _get_telnet_app(self):
189
-        return {
190
-            "instance": {
191
-                "?": {
192
-                    "type": "io.murano.resources.LinuxMuranoInstance",
193
-                    "id": str(uuid.uuid4())
194
-                },
195
-                "flavor": self.flavor,
196
-                "image": self.linux,
197
-                "name": "instance{0}".format(uuid.uuid4().hex[:5]),
198
-            },
199
-            "name": "app{0}".format(uuid.uuid4().hex[:5]),
200
-            "?": {
201
-                "type": "io.murano.apps.linux.Telnet",
202
-                "id": str(uuid.uuid4())
203
-            }
204
-        }
205
-
206
-    def get_test_app(self):
207
-        return {
208
-            "instance": {
209
-                "flavor": self.flavor,
210
-                "image": self.linux,
211
-                "assignFloatingIp": True,
212
-                "?": {
213
-                    "type": "io.murano.resources.LinuxMuranoInstance",
214
-                    "id": str(uuid.uuid4())
215
-                },
216
-                "name": self.rand_name('mrntest')
217
-            },
218
-            "name": self.rand_name('dummy'),
219
-            "?": {
220
-                "type": "io.murano.apps.test.UpdateExecutor",
221
-                "id": str(uuid.uuid4())
222
-            }
223
-        }
224
-
225
-    @classmethod
226
-    def upload_app(cls, app_dir, name, tags):
227
-        """Zip and upload application to Murano
228
-
229
-        :param app_dir: Unzipped dir with an application
230
-        :param name: Application name
231
-        :param tags: Application tags
232
-        :return: Uploaded package
233
-        """
234
-        zip_file_path = cls.zip_dir(os.path.dirname(__file__), app_dir)
235
-        cls.init_list("_package_files")
236
-        cls._package_files.append(zip_file_path)
237
-        return cls.upload_package(
238
-            name, tags, zip_file_path)

+ 0
- 87
murano/tests/functional/engine/test_conf_language_support.py View File

@@ -1,87 +0,0 @@
1
-# Copyright (c) 2015 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-# http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import uuid
16
-
17
-import murano.tests.functional.common.utils as common_utils
18
-import murano.tests.functional.engine.manager as core
19
-from nose.plugins.attrib import attr as tag
20
-
21
-
22
-class LanguageSupportTest(core.MuranoTestsCore):
23
-
24
-    @classmethod
25
-    def setUpClass(cls):
26
-        super(LanguageSupportTest, cls).setUpClass()
27
-        cls.linux = core.CONF.murano.linux_image
28
-        cls.flavor = core.CONF.murano.standard_flavor
29
-        cls.keyname = core.CONF.murano.keyname
30
-        cls.instance_type = core.CONF.murano.instance_type
31
-
32
-        try:
33
-            # Upload the Murano test package.
34
-            cls.upload_app('io.murano.conflang.chef.ExampleChef',
35
-                           'ExampleChef', {"tags": ["tag"]})
36
-            cls.upload_app('io.murano.conflang.puppet.ExamplePuppet',
37
-                           'ExamplePuppet', {"tags": ["tag"]})
38
-        except Exception:
39
-            cls.tearDownClass()
40
-            raise
41
-
42
-    @classmethod
43
-    def tearDownClass(cls):
44
-        with common_utils.ignored(Exception):
45
-            try:
46
-                cls.purge_uploaded_packages()
47
-            except Exception:
48
-                raise
49
-
50
-    def _test_deploy(self, environment_name, package_name, port):
51
-        post_body = {
52
-            "instance": {
53
-                "flavor": self.flavor,
54
-                "image": self.linux,
55
-                "keyname": self.keyname,
56
-                "assignFloatingIp": True,
57
-                'name': environment_name,
58
-                "?": {
59
-                    "type": "io.murano.resources.ConfLangInstance",
60
-                    "id": str(uuid.uuid4())
61
-                },
62
-            },
63
-            "name": environment_name,
64
-            "port": port,
65
-            "?": {
66
-                "type": package_name,
67
-                "id": str(uuid.uuid4())
68
-            }
69
-        }
70
-
71
-        environment_name = environment_name + uuid.uuid4().hex[:5]
72
-        environment = self.create_environment(name=environment_name)
73
-        session = self.create_session(environment)
74
-        self.add_service(environment, post_body, session)
75
-        self.deploy_environment(environment, session)
76
-        self.wait_for_environment_deploy(environment)
77
-        self.deployment_success_check(environment, port)
78
-
79
-    @tag('gate', 'all', 'coverage')
80
-    def test_deploy_example_chef_example(self):
81
-        self._test_deploy('chefExample',
82
-                          'io.murano.conflang.chef.ExampleChef', 22)
83
-
84
-    @tag('gate', 'all', 'coverage')
85
-    def test_deploy_example_puppet_example(self):
86
-        self._test_deploy('puppetExample',
87
-                          "io.murano.conflang.puppet.ExamplePuppet", 22)

+ 0
- 138
murano/tests/functional/engine/test_deployment.py View File

@@ -1,138 +0,0 @@
1
-# Copyright (c) 2015 Mirantis, Inc.
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-#      http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-import uuid
16
-
17
-from nose.plugins.attrib import attr as tag
18
-
19
-import murano.tests.functional.engine.manager as core
20
-
21
-
22
-class MuranoDeploymentTest(core.MuranoTestsCore):
23
-
24
-    @classmethod
25
-    def setUpClass(cls):
26
-        super(MuranoDeploymentTest, cls).setUpClass()
27
-
28
-        cls.linux = core.CONF.murano.linux_image
29
-        cls.flavor = core.CONF.murano.standard_flavor
30
-
31
-        cls.upload_app('io.murano.apps.test.UpdateExecutor',
32
-                       'UpdateExecutor',
33
-                       {"categories": ["Web"], "tags": ["tag"]})
34
-
35
-        cls.upload_app('io.murano.apps.test.Lighttpd',
36
-                       'Lighttpd',
37
-                       {"categories": ["Web"], "tags": ["tag"]})
38
-
39
-        cls.upload_app('io.murano.apps.test.ApacheHttpServerCustom',
40
-                       'Apache HTTP Server Custom',
41
-                       {"categories": ["Web"], "tags": ["test"]})
42
-
43
-    @classmethod
44
-    def tearDownClass(cls):
45
-        super(MuranoDeploymentTest, cls).tearDownClass()
46
-
47
-        cls.purge_environments()
48
-        cls.purge_uploaded_packages()
49
-
50
-    @tag('gate', 'all', 'coverage')
51
-    def test_app_deployment(self):
52
-        post_body = self.get_test_app()
53
-        environment_name = self.rand_name('dummyMurano')
54
-        environment = self.create_environment(name=environment_name)
55
-        session = self.create_session(environment)
56
-        self.add_service(environment, post_body, session)
57
-        self.deploy_environment(environment, session)
58
-
59
-    @tag('gate', 'all', 'coverage')
60
-    def test_resources_deallocation(self):
61
-        app_1 = self.get_test_app()
62
-        app_2 = self.get_test_app()
63
-        environment_name = self.rand_name('dummyMurano')
64
-        environment = self.create_environment(name=environment_name)
65
-        session = self.create_session(environment)
66
-        self.add_service(environment, app_1, session)
67
-        self.add_service(environment, app_2, session)
68
-        self.deploy_environment(environment, session)
69
-
70
-        environment = self.get_environment(environment)
71
-        app_for_remove = self.get_service(environment, app_1['name'],
72
-                                          to_dict=False)
73
-        session = self.create_session(environment)
74
-        environment = self.delete_service(environment, session, app_for_remove)
75
-        self.deploy_environment(environment, session)
76
-
77
-        instance_name = app_1['instance']['name']
78
-        stack = self._get_stack(environment.id)
79
-        template = self.get_stack_template(stack)
80
-        ip_addresses = '{0}-assigned-ip'.format(instance_name)
81
-        floating_ip = '{0}-FloatingIPaddress'.format(instance_name)
82
-
83
-        self.assertNotIn(ip_addresses, template['outputs'])
84
-        self.assertNotIn(floating_ip, template['outputs'])
85
-        self.assertNotIn(instance_name, template['resources'])
86
-
87
-    @tag('gate', 'all', 'coverage')
88
-    def test_dependent_apps(self):
89
-        post_body = self.get_test_app()
90
-        environment_name = self.rand_name('dummyMurano')
91
-        environment = self.create_environment(name=environment_name)
92
-        session = self.create_session(environment)
93
-        updater = self.add_service(environment, post_body, session,
94
-                                   to_dict=True)
95
-        post_body = {
96
-            "name": self.rand_name("lighttest"),
97
-            "updater": updater,
98
-            "?": {
99
-                "type": "io.murano.apps.test.Lighttpd",
100
-                "id": str(uuid.uuid4())
101
-            }
102
-        }
103
-        self.add_service(environment, post_body, session)
104
-        self.deploy_environment(environment, session)
105
-        self.status_check(environment,
106
-                          [[updater['instance']['name'], 22, 80]])
107
-
108
-    @tag('gate', 'all', 'coverage')
109
-    def test_simple_software_configuration(self):
110
-        post_body = {
111
-            "instance": {
112
-                "flavor": self.flavor,
113
-                "image": self.linux,
114
-                "assignFloatingIp": True,
115
-                "?": {
116