You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/06/01 13:35:14 UTC
[2/7] incubator-ariatosca git commit: ARIA-149 Enhance operation
configuration
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/api/test_task.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/api/test_task.py b/tests/orchestrator/workflows/api/test_task.py
index 642c785..9d91b6b 100644
--- a/tests/orchestrator/workflows/api/test_task.py
+++ b/tests/orchestrator/workflows/api/test_task.py
@@ -44,15 +44,15 @@ class TestOperationTask(object):
plugin = mock.models.create_plugin('test_plugin', '0.1')
ctx.model.node.update(plugin)
- inputs = {'test_input': True}
+ arguments = {'test_input': True}
interface = mock.models.create_interface(
ctx.service,
interface_name,
operation_name,
operation_kwargs=dict(plugin=plugin,
- implementation='op_path',
- inputs=inputs),)
+ function='op_path',
+ arguments=arguments),)
node = ctx.model.node.get_by_name(mock.models.DEPENDENT_NODE_NAME)
node.interfaces[interface_name] = interface
@@ -66,7 +66,7 @@ class TestOperationTask(object):
node,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs,
+ arguments=arguments,
max_attempts=max_attempts,
retry_interval=retry_interval,
ignore_failure=ignore_failure)
@@ -77,9 +77,9 @@ class TestOperationTask(object):
interface=interface_name,
operation=operation_name
)
- assert api_task.implementation == 'op_path'
+ assert api_task.function == 'op_path'
assert api_task.actor == node
- assert api_task.inputs['test_input'].value is True
+ assert api_task.arguments['test_input'].value is True
assert api_task.retry_interval == retry_interval
assert api_task.max_attempts == max_attempts
assert api_task.ignore_failure == ignore_failure
@@ -92,15 +92,15 @@ class TestOperationTask(object):
plugin = mock.models.create_plugin('test_plugin', '0.1')
ctx.model.plugin.update(plugin)
- inputs = {'test_input': True}
+ arguments = {'test_input': True}
interface = mock.models.create_interface(
ctx.service,
interface_name,
operation_name,
operation_kwargs=dict(plugin=plugin,
- implementation='op_path',
- inputs=inputs)
+ function='op_path',
+ arguments=arguments)
)
relationship = ctx.model.relationship.list()[0]
@@ -113,7 +113,7 @@ class TestOperationTask(object):
relationship,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs,
+ arguments=arguments,
max_attempts=max_attempts,
retry_interval=retry_interval)
@@ -123,9 +123,9 @@ class TestOperationTask(object):
interface=interface_name,
operation=operation_name
)
- assert api_task.implementation == 'op_path'
+ assert api_task.function == 'op_path'
assert api_task.actor == relationship
- assert api_task.inputs['test_input'].value is True
+ assert api_task.arguments['test_input'].value is True
assert api_task.retry_interval == retry_interval
assert api_task.max_attempts == max_attempts
assert api_task.plugin.name == 'test_plugin'
@@ -137,15 +137,15 @@ class TestOperationTask(object):
plugin = mock.models.create_plugin('test_plugin', '0.1')
ctx.model.node.update(plugin)
- inputs = {'test_input': True}
+ arguments = {'test_input': True}
interface = mock.models.create_interface(
ctx.service,
interface_name,
operation_name,
operation_kwargs=dict(plugin=plugin,
- implementation='op_path',
- inputs=inputs)
+ function='op_path',
+ arguments=arguments)
)
relationship = ctx.model.relationship.list()[0]
@@ -158,7 +158,7 @@ class TestOperationTask(object):
relationship,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs,
+ arguments=arguments,
max_attempts=max_attempts,
retry_interval=retry_interval)
@@ -168,9 +168,9 @@ class TestOperationTask(object):
interface=interface_name,
operation=operation_name
)
- assert api_task.implementation == 'op_path'
+ assert api_task.function == 'op_path'
assert api_task.actor == relationship
- assert api_task.inputs['test_input'].value is True
+ assert api_task.arguments['test_input'].value is True
assert api_task.retry_interval == retry_interval
assert api_task.max_attempts == max_attempts
assert api_task.plugin.name == 'test_plugin'
@@ -189,7 +189,7 @@ class TestOperationTask(object):
interface_name,
operation_name,
operation_kwargs=dict(plugin=plugin,
- implementation='op_path'))
+ function='op_path'))
dependency_node.interfaces[interface_name] = interface
with context.workflow.current.push(ctx):
@@ -198,7 +198,7 @@ class TestOperationTask(object):
interface_name=interface_name,
operation_name=operation_name)
- assert task.inputs == {}
+ assert task.arguments == {}
assert task.retry_interval == ctx._task_retry_interval
assert task.max_attempts == ctx._task_max_attempts
assert task.ignore_failure == ctx._task_ignore_failure
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/builtin/test_execute_operation.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/builtin/test_execute_operation.py b/tests/orchestrator/workflows/builtin/test_execute_operation.py
index 4cddbe6..88818ca 100644
--- a/tests/orchestrator/workflows/builtin/test_execute_operation.py
+++ b/tests/orchestrator/workflows/builtin/test_execute_operation.py
@@ -35,7 +35,7 @@ def test_execute_operation(ctx):
ctx.service,
interface_name,
operation_name,
- operation_kwargs={'implementation': 'test'}
+ operation_kwargs=dict(function='test')
)
node.interfaces[interface.name] = interface
ctx.model.node.update(node)
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/core/test_engine.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/core/test_engine.py b/tests/orchestrator/workflows/core/test_engine.py
index 8c0705b..6d2836c 100644
--- a/tests/orchestrator/workflows/core/test_engine.py
+++ b/tests/orchestrator/workflows/core/test_engine.py
@@ -57,17 +57,17 @@ class BaseTest(object):
@staticmethod
def _op(ctx,
func,
- inputs=None,
+ arguments=None,
max_attempts=None,
retry_interval=None,
ignore_failure=None):
node = ctx.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
interface_name = 'aria.interfaces.lifecycle'
- operation_kwargs = dict(implementation='{name}.{func.__name__}'.format(
+ operation_kwargs = dict(function='{name}.{func.__name__}'.format(
name=__name__, func=func))
- if inputs:
- # the operation has to declare the inputs before those may be passed
- operation_kwargs['inputs'] = inputs
+ if arguments:
+ # the operation has to declare the arguments before those may be passed
+ operation_kwargs['arguments'] = arguments
operation_name = 'create'
interface = mock.models.create_interface(node.service, interface_name, operation_name,
operation_kwargs=operation_kwargs)
@@ -77,7 +77,7 @@ class BaseTest(object):
node,
interface_name='aria.interfaces.lifecycle',
operation_name=operation_name,
- inputs=inputs or {},
+ arguments=arguments,
max_attempts=max_attempts,
retry_interval=retry_interval,
ignore_failure=ignore_failure,
@@ -189,8 +189,8 @@ class TestEngine(BaseTest):
def test_two_tasks_execution_order(self, workflow_context, executor):
@workflow
def mock_workflow(ctx, graph):
- op1 = self._op(ctx, func=mock_ordered_task, inputs={'counter': 1})
- op2 = self._op(ctx, func=mock_ordered_task, inputs={'counter': 2})
+ op1 = self._op(ctx, func=mock_ordered_task, arguments={'counter': 1})
+ op2 = self._op(ctx, func=mock_ordered_task, arguments={'counter': 2})
graph.sequence(op1, op2)
self._execute(
workflow_func=mock_workflow,
@@ -204,9 +204,9 @@ class TestEngine(BaseTest):
def test_stub_and_subworkflow_execution(self, workflow_context, executor):
@workflow
def sub_workflow(ctx, graph):
- op1 = self._op(ctx, func=mock_ordered_task, inputs={'counter': 1})
+ op1 = self._op(ctx, func=mock_ordered_task, arguments={'counter': 1})
op2 = api.task.StubTask()
- op3 = self._op(ctx, func=mock_ordered_task, inputs={'counter': 2})
+ op3 = self._op(ctx, func=mock_ordered_task, arguments={'counter': 2})
graph.sequence(op1, op2, op3)
@workflow
@@ -229,7 +229,7 @@ class TestCancel(BaseTest):
@workflow
def mock_workflow(ctx, graph):
operations = (
- self._op(ctx, func=mock_sleep_task, inputs=dict(seconds=0.1))
+ self._op(ctx, func=mock_sleep_task, arguments=dict(seconds=0.1))
for _ in range(number_of_tasks)
)
return graph.sequence(*operations)
@@ -270,7 +270,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 1},
+ arguments={'failure_count': 1},
max_attempts=2)
graph.add_tasks(op)
self._execute(
@@ -286,7 +286,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 2},
+ arguments={'failure_count': 2},
max_attempts=2)
graph.add_tasks(op)
with pytest.raises(exceptions.ExecutorException):
@@ -303,7 +303,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 1},
+ arguments={'failure_count': 1},
max_attempts=3)
graph.add_tasks(op)
self._execute(
@@ -319,7 +319,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 2},
+ arguments={'failure_count': 2},
max_attempts=3)
graph.add_tasks(op)
self._execute(
@@ -335,7 +335,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 1},
+ arguments={'failure_count': 1},
max_attempts=-1)
graph.add_tasks(op)
self._execute(
@@ -361,7 +361,7 @@ class TestRetries(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
- inputs={'failure_count': 1},
+ arguments={'failure_count': 1},
max_attempts=2,
retry_interval=retry_interval)
graph.add_tasks(op)
@@ -382,7 +382,7 @@ class TestRetries(BaseTest):
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_conditional_failure_task,
ignore_failure=True,
- inputs={'failure_count': 100},
+ arguments={'failure_count': 100},
max_attempts=100)
graph.add_tasks(op)
self._execute(
@@ -405,7 +405,7 @@ class TestTaskRetryAndAbort(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_task_retry,
- inputs={'message': self.message},
+ arguments={'message': self.message},
retry_interval=default_retry_interval,
max_attempts=2)
graph.add_tasks(op)
@@ -429,8 +429,8 @@ class TestTaskRetryAndAbort(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_task_retry,
- inputs={'message': self.message,
- 'retry_interval': custom_retry_interval},
+ arguments={'message': self.message,
+ 'retry_interval': custom_retry_interval},
retry_interval=default_retry_interval,
max_attempts=2)
graph.add_tasks(op)
@@ -452,7 +452,7 @@ class TestTaskRetryAndAbort(BaseTest):
@workflow
def mock_workflow(ctx, graph):
op = self._op(ctx, func=mock_task_abort,
- inputs={'message': self.message},
+ arguments={'message': self.message},
retry_interval=100,
max_attempts=100)
graph.add_tasks(op)
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/core/test_events.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/core/test_events.py b/tests/orchestrator/workflows/core/test_events.py
index 184071d..6d542e9 100644
--- a/tests/orchestrator/workflows/core/test_events.py
+++ b/tests/orchestrator/workflows/core/test_events.py
@@ -110,8 +110,7 @@ def run_operation_on_node(ctx, op_name, interface_name):
service=node.service,
interface_name=interface_name,
operation_name=op_name,
- operation_kwargs=dict(implementation='{name}.{func.__name__}'.format(name=__name__,
- func=func)))
+ operation_kwargs=dict(function='{name}.{func.__name__}'.format(name=__name__, func=func)))
node.interfaces[interface.name] = interface
eng = engine.Engine(executor=ThreadExecutor(),
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/core/test_task.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/core/test_task.py b/tests/orchestrator/workflows/core/test_task.py
index e488933..a717e19 100644
--- a/tests/orchestrator/workflows/core/test_task.py
+++ b/tests/orchestrator/workflows/core/test_task.py
@@ -43,7 +43,7 @@ def ctx(tmpdir):
relationship.source_node.service,
RELATIONSHIP_INTERFACE_NAME,
RELATIONSHIP_OPERATION_NAME,
- operation_kwargs={'implementation': 'test'}
+ operation_kwargs=dict(function='test')
)
relationship.interfaces[interface.name] = interface
context.model.relationship.update(relationship)
@@ -53,7 +53,7 @@ def ctx(tmpdir):
node.service,
NODE_INTERFACE_NAME,
NODE_OPERATION_NAME,
- operation_kwargs={'implementation': 'test'}
+ operation_kwargs=dict(function='test')
)
node.interfaces[interface.name] = interface
context.model.node.update(node)
@@ -92,7 +92,7 @@ class TestOperationTask(object):
node.service,
NODE_INTERFACE_NAME,
NODE_OPERATION_NAME,
- operation_kwargs=dict(plugin=storage_plugin, implementation='test')
+ operation_kwargs=dict(plugin=storage_plugin, function='test')
)
node.interfaces[interface.name] = interface
ctx.model.node.update(node)
@@ -103,9 +103,9 @@ class TestOperationTask(object):
assert storage_task.actor == core_task.context.node._original_model
assert core_task.model_task == storage_task
assert core_task.name == api_task.name
- assert core_task.implementation == api_task.implementation
+ assert core_task.function == api_task.function
assert core_task.actor == api_task.actor == node
- assert core_task.inputs == api_task.inputs == storage_task.inputs
+ assert core_task.arguments == api_task.arguments == storage_task.arguments
assert core_task.plugin == storage_plugin
def test_relationship_operation_task_creation(self, ctx):
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
index 2a96d01..5dd2855 100644
--- a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
+++ b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
@@ -32,7 +32,7 @@ def test_task_graph_into_execution_graph(tmpdir):
node.service,
interface_name,
operation_name,
- operation_kwargs={'implementation': 'test'}
+ operation_kwargs=dict(function='test')
)
node.interfaces[interface.name] = interface
task_context.model.node.update(node)
@@ -108,9 +108,9 @@ def test_task_graph_into_execution_graph(tmpdir):
def _assert_execution_is_api_task(execution_task, api_task):
assert execution_task.id == api_task.id
assert execution_task.name == api_task.name
- assert execution_task.implementation == api_task.implementation
+ assert execution_task.function == api_task.function
assert execution_task.actor == api_task.actor
- assert execution_task.inputs == api_task.inputs
+ assert execution_task.arguments == api_task.arguments
def _get_task_by_name(task_name, graph):
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/__init__.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/__init__.py b/tests/orchestrator/workflows/executor/__init__.py
index 41c4b2e..ac6d325 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -25,11 +25,11 @@ class MockTask(object):
INFINITE_RETRIES = models.Task.INFINITE_RETRIES
- def __init__(self, implementation, inputs=None, plugin=None, storage=None):
- self.implementation = self.name = implementation
+ def __init__(self, function, arguments=None, plugin=None, storage=None):
+ self.function = self.name = function
self.plugin_fk = plugin.id if plugin else None
self.plugin = plugin or None
- self.inputs = inputs or {}
+ self.arguments = arguments or {}
self.states = []
self.exception = None
self.id = str(uuid.uuid4())
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/test_executor.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_executor.py b/tests/orchestrator/workflows/executor/test_executor.py
index 29cb0e8..9ddaef4 100644
--- a/tests/orchestrator/workflows/executor/test_executor.py
+++ b/tests/orchestrator/workflows/executor/test_executor.py
@@ -38,16 +38,16 @@ import tests
from . import MockTask
-def _get_implementation(func):
+def _get_function(func):
return '{module}.{func.__name__}'.format(module=__name__, func=func)
def execute_and_assert(executor, storage=None):
expected_value = 'value'
- successful_task = MockTask(_get_implementation(mock_successful_task), storage=storage)
- failing_task = MockTask(_get_implementation(mock_failing_task), storage=storage)
- task_with_inputs = MockTask(_get_implementation(mock_task_with_input),
- inputs={'input': models.Parameter.wrap('input', 'value')},
+ successful_task = MockTask(_get_function(mock_successful_task), storage=storage)
+ failing_task = MockTask(_get_function(mock_failing_task), storage=storage)
+ task_with_inputs = MockTask(_get_function(mock_task_with_input),
+ arguments={'input': models.Parameter.wrap('input', 'value')},
storage=storage)
for task in [successful_task, failing_task, task_with_inputs]:
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/test_process_executor.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor.py b/tests/orchestrator/workflows/executor/test_process_executor.py
index e6333e8..058190e 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor.py
@@ -66,7 +66,7 @@ class TestProcessExecutor(object):
def test_closed(self, executor):
executor.close()
with pytest.raises(RuntimeError) as exc_info:
- executor.execute(task=MockTask(implementation='some.implementation'))
+ executor.execute(task=MockTask(function='some.function'))
assert 'closed' in exc_info.value.message
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
index 92f0fc4..6163c09 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
@@ -67,7 +67,7 @@ def _test(context, executor, lock_files, func, dataholder, expected_failure):
key = 'key'
first_value = 'value1'
second_value = 'value2'
- inputs = {
+ arguments = {
'lock_files': lock_files,
'key': key,
'first_value': first_value,
@@ -80,8 +80,8 @@ def _test(context, executor, lock_files, func, dataholder, expected_failure):
node.service,
interface_name,
operation_name,
- operation_kwargs=dict(implementation='{0}.{1}'.format(__name__, func.__name__),
- inputs=inputs)
+ operation_kwargs=dict(function='{0}.{1}'.format(__name__, func.__name__),
+ arguments=arguments)
)
node.interfaces[interface.name] = interface
context.model.node.update(node)
@@ -93,12 +93,12 @@ def _test(context, executor, lock_files, func, dataholder, expected_failure):
node,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs),
+ arguments=arguments),
api.task.OperationTask(
node,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs)
+ arguments=arguments)
)
signal = events.on_failure_task_signal
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/test_process_executor_extension.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_extension.py b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
index 30b23ed..e4944df 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_extension.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
@@ -27,7 +27,7 @@ from tests import storage
def test_decorate_extension(context, executor):
- inputs = {'input1': 1, 'input2': 2}
+ arguments = {'arg1': 1, 'arg2': 2}
def get_node(ctx):
return ctx.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
@@ -41,24 +41,23 @@ def test_decorate_extension(context, executor):
ctx.service,
interface_name,
operation_name,
- operation_kwargs=dict(implementation='{0}.{1}'.format(__name__,
- _mock_operation.__name__),
- inputs=inputs)
+ operation_kwargs=dict(function='{0}.{1}'.format(__name__, _mock_operation.__name__),
+ arguments=arguments)
)
node.interfaces[interface.name] = interface
task = api.task.OperationTask(
node,
interface_name=interface_name,
operation_name=operation_name,
- inputs=inputs)
+ arguments=arguments)
graph.add_tasks(task)
return graph
graph = mock_workflow(ctx=context) # pylint: disable=no-value-for-parameter
eng = engine.Engine(executor=executor, workflow_context=context, tasks_graph=graph)
eng.execute()
out = get_node(context).attributes.get('out').value
- assert out['wrapper_inputs'] == inputs
- assert out['function_inputs'] == inputs
+ assert out['wrapper_arguments'] == arguments
+ assert out['function_arguments'] == arguments
@extension.process_executor
@@ -66,16 +65,16 @@ class MockProcessExecutorExtension(object):
def decorate(self):
def decorator(function):
- def wrapper(ctx, **operation_inputs):
- ctx.node.attributes['out'] = {'wrapper_inputs': operation_inputs}
- function(ctx=ctx, **operation_inputs)
+ def wrapper(ctx, **operation_arguments):
+ ctx.node.attributes['out'] = {'wrapper_arguments': operation_arguments}
+ function(ctx=ctx, **operation_arguments)
return wrapper
return decorator
@operation
-def _mock_operation(ctx, **operation_inputs):
- ctx.node.attributes['out']['function_inputs'] = operation_inputs
+def _mock_operation(ctx, **operation_arguments):
+ ctx.node.attributes['out']['function_arguments'] = operation_arguments
@pytest.fixture
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
index 2b628a0..2d80a3b 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
@@ -62,19 +62,19 @@ def test_refresh_state_of_tracked_attributes(context, executor):
def test_apply_tracked_changes_during_an_operation(context, executor):
- inputs = {
+ arguments = {
'committed': {'some': 'new', 'properties': 'right here'},
'changed_but_refreshed': {'some': 'newer', 'properties': 'right there'}
}
expected_initial = context.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME).attributes
out = _run_workflow(
- context=context, executor=executor, op_func=_mock_updating_operation, inputs=inputs)
+ context=context, executor=executor, op_func=_mock_updating_operation, arguments=arguments)
expected_after_update = expected_initial.copy()
- expected_after_update.update(inputs['committed']) # pylint: disable=no-member
+ expected_after_update.update(arguments['committed']) # pylint: disable=no-member
expected_after_change = expected_after_update.copy()
- expected_after_change.update(inputs['changed_but_refreshed']) # pylint: disable=no-member
+ expected_after_change.update(arguments['changed_but_refreshed']) # pylint: disable=no-member
assert out['initial'] == expected_initial
assert out['after_update'] == expected_after_update
@@ -82,26 +82,26 @@ def test_apply_tracked_changes_during_an_operation(context, executor):
assert out['after_refresh'] == expected_after_change
-def _run_workflow(context, executor, op_func, inputs=None):
+def _run_workflow(context, executor, op_func, arguments=None):
@workflow
def mock_workflow(ctx, graph):
node = ctx.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
interface_name = 'test_interface'
operation_name = 'operation'
- wf_inputs = inputs or {}
+ wf_arguments = arguments or {}
interface = mock.models.create_interface(
ctx.service,
interface_name,
operation_name,
- operation_kwargs=dict(implementation=_operation_mapping(op_func),
- inputs=wf_inputs)
+ operation_kwargs=dict(function=_operation_mapping(op_func),
+ arguments=wf_arguments)
)
node.interfaces[interface.name] = interface
task = api.task.OperationTask(
node,
interface_name=interface_name,
operation_name=operation_name,
- inputs=wf_inputs)
+ arguments=wf_arguments)
graph.add_tasks(task)
return graph
graph = mock_workflow(ctx=context) # pylint: disable=no-value-for-parameter
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml
----------------------------------------------------------------------
diff --git a/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml b/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml
index 8e80640..4d53f9b 100644
--- a/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml
+++ b/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml
@@ -104,6 +104,16 @@ topology_template:
Maintenance:
enable: juju > charm.maintenance_on
disable: juju > charm.maintenance_off
+ Standard:
+ create:
+ implementation:
+ primary: create_node_cellar.sh
+ dependencies:
+ - "process.args.1 > { get_attribute: [ SELF, tosca_id ] }"
+ - "process.args.2 > { get_property: [ HOST, flavor_name ] }"
+ - ssh.user > admin
+ - ssh.password > '1234'
+ - ssh.use_sudo > true
requirements:
- database: node_cellar_database
capabilities:
@@ -161,16 +171,7 @@ topology_template:
relationship:
interfaces:
Configure:
- target_changed:
- implementation:
- primary: changed.sh
- dependencies:
- #- { concat: [ process.args.1 >, mongodb ] }
- - process.args.1 > mongodb
- - process.args.2 > host
- - ssh.user > admin
- - ssh.password > 1234
- - ssh.use_sudo > true
+ target_changed: changed.sh
nginx:
type: nginx.Nginx
@@ -251,6 +252,7 @@ topology_template:
Standard:
inputs:
openstack_credential: { get_input: openstack_credential }
+ create: create_data_volume.sh
groups: