Commit Graph

34 Commits

Author SHA1 Message Date
hparekh 568bbf5384 Removed mistral/tests/functional
All the changes has been merged to mistral_tempest_tests.
Also scrits has been changed.

Change-Id: I6c514a3c75f1b6e3b94b0e9b0e542697b68d9a02
Partially-Implements: blueprint mistral-tempest-plugin
2016-01-29 11:04:03 +09:00
hparekh 2e133aa556 Updated dynamic credential support for funtional test.
Now devstack does not setup the deprecated configured cred on Tempest
which is being used here. - https://review.openstack.org/#/c/256164/

get_configured_credential use the deprecated cred and these tests use
that for initiating Manager.

Change-Id: I89713806cb98abaca29b24de585a77f75602bcd7
Closes-bug: #1531049
2016-01-05 07:56:30 +00:00
hparekh f3d3e25235 Get "cron trigger" list using model query.
If cron-trigger is created in different tenant
than workflow's tenant, associated cron-trigger
can not be got. So "model_query" has been used
instead of "secure_query".

Change-Id: Ief78f2cad76e6ca16893bff80c5e75c9015e9c74
Closes-bug: #1522286
2015-12-14 16:41:04 +09:00
Moshe Elisha 976667c0a2 Fix concurrency issues by using READ_COMMITTED
The state of a workflow execution was not updated even when all task
executions were completed if some tasks finished at the same time as
other tasks.
Because we were using our connections with transaction isolation
level = REPEATABLE_READ - Each process was using a snapshot of the DB
created at the first read statement in that transaction.
When a task finished and evaluated the state of all the other tasks
it did not see the up-to-date state of those tasks - and so, because
not all tasks were completed - the task did not change the workflow
execution state.

Similar behavior happened with multiple action executions under same
task. On completion, each action execution checked the status of the
other action executions and did not see the up-to-date state of these
action execution - causing task execution to stay in RUNNING state.

Change-Id: I12f66134d92b8ed39df9d6128d7de5ee49aa8623
Closes-Bug: #1518012
Closes-Bug: #1513456
2015-12-09 08:01:38 +00:00
Anastasia Kuznetsova c11ef5c435 Pass creds into the clients.Manager() in functional tests
Because of some changes in tempest now it is nesessary to
set credentials to the client.Manager()

Change-Id: I37e95118064317797dc3277ce79b195a8ebd328b
2015-11-20 14:54:11 +03:00
Anastasia Kuznetsova dbdc29531c Fix all H405 pep8 errors
Improved code style, fixed all H405 (Multi line docstring
summary not separated with an empty line) errors.

Change-Id: I6639a2e1a9dc5d3802cb1bda05c5bf9b302bc82f
2015-11-16 18:00:18 +03:00
hparekh 13ec6e8b2c filter() is wrapped around list().
In py2 filter returns list, but in py3
it returns iterator.

Change-Id: I71db21027bab11c8de715d39e71d0f6317a3f9e0
Partially-Implements: blueprint mistral-py3
2015-10-19 09:26:33 +05:30
Nikolay Mahotkin 42d3ce7630 Adding functional tests for SSH actions
* Added 2 tests: for SSHAction and SSHProxiedAction
 * 2 VMs are created for test purposes

 * SSHProxiedAction test checks that ssh command was
   executed on certain VM (which is in guest network)

Closes-Bug: #1505175

Change-Id: I664885b5743c0915f5c42aeecdd3c6c538894453
2015-10-15 08:05:08 +00:00
Lingxian Kong 47e13ffb48 Using six.iteritems() to avoid some python3 tests failure
Fixed the following failure:
AttributeError: 'dict' object has no attribute 'iteritems'

This patch belongs to improvement of python3 compatibility in Mistral.

Partial-Bug: #1378537
Change-Id: Ie6253483bc11fb76f8a93229035ffe2232bb4e3c
2015-09-23 15:56:14 +00:00
Lingxian Kong f2eaea5a12 Support action_execution deletion
With this patch, users can perform operation as following:
DELETE http://127.0.0.1:8989/v2/action_executions/<action_execution_id>

NOTE:
* Added a new config item 'allow_action_execution_deletion', with default
  value 'False'.
* The 'allow_action_execution_deletion' item is set to 'True' for
  functional testing.
* Only ad-hoc action-execution can be deleted.
* Only completed action execution can be deleted.

Implements: blueprint mistral-action-execution-deletion
Closes-Bug: #1488157
Change-Id: I3729636911a42c273c5a7b2d7fbdaae0da398e31
2015-09-07 13:18:41 +00:00
Nikolay Mahotkin 11adbf4a0c Fixing occasional fail of test_create_action_execution
* Fixed functional test 'test_create_action_execution'
 * Sometimes action execution is still not completed and
   response contains no output. Changed that mechanism to
   wait for completeness.

Change-Id: I6c27dd87e754e9cffc809922ad963ccebdcf7930
2015-09-01 13:11:22 +03:00
Renat Akhmerov a4175da422 Refactor action execution controller and tests
* Fixing custom WSME type for json fields. Making it able to convert
  values in both direction (to base type and from base type).
* Changed type of ActionExecution resource fields 'input' and 'output'
  to new custom json type.
* Fixed action execution controller where necessary.
* Adjusted and refactored action execution controller tests.

Change-Id: I28d0f3204518a2688cb72acefd910d9d99ada66d
2015-08-27 13:03:50 +00:00
Nikolay Mahotkin 786b7adb46 Implementing action_execution POST API
* Mistral API now enables POST on /action_executions
 * 2 ways of work - synchronous and asynchronous:
     returns result immediately or saving action_execution
     to the DB. it is controlled by 'save_result' option in
     'params' key of the request.
 * fixed returning error back in executior

TODO (next commit):
  - Implementing 'run-action' cmd in python-mistralclient

Implements blueprint mistral-run-individual-action

Change-Id: I365ec8b92e9bed72bb05c618323f18f5ca7b82e5
2015-06-25 09:50:15 +03:00
Anastasia Kuznetsova c6b536e5d0 Fix dsvm gate failure
Tempest module 'auth' was moved into tempest-lib repo, this change
caused import error, that was fixed in this commit.

Change-Id: I8b93a9ce47cc24afe9b4f52fbc78de79a42b7fa8
2015-05-05 14:02:32 +03:00
Renat Akhmerov b38328513a Deleting all v1 related stuff
* Old engine
* Endpoints
* Tests
* Fixed launch.cmd script
* Fixed the bug with incorrect RPC objects creation in tests

Change-Id: I8579d0878e8a295823124d3c3452f3c26151d43a
2015-04-07 20:07:24 +06:00
Pierre-Arthur MATHIEU f2cb7524e4 Trigger remaining-executions and first-exec-date
Adds the support of two optionals parameters for the cron-trigger resource:
  -first_execution_date : supersedes to the first calculation of
"next_execution_time".
  -remaining_occurrences: number of occurrences after which the trigger should
be deleted.

The parameter "pattern" is now optional if first-execution-date only is used.

Implements: blueprint mistral-cron-triggers-start-and-repeat
Change-Id: I55bc28e98f89ffdfdce9cb3daa3848a17d85fd20
2015-03-19 11:06:50 +00:00
Renat Akhmerov bdefdc6a6f Refactoring task output: full redesign of DB models
* Created a Execution hierarcy mapped on a single table:
  - ActionExecution
  - WorkflowExecution
  - TaskExecution
* Created necessary associations within Execution hierarchy
* Created necessary methods for Execution objects on DB API
* Created Definition hierarchy mapped on separate tables:
  - Workbook
  - WorkflowDefinition
  - ActionDefinition
* Renamed attributes
  - 'wf_name' -> 'workflow_name'
  - 'wf_spec' -> 'spec'
* Fixed all unit tests

TODO:
* Complete renaming throughout the code
* Further refactoring of workflow engine

Change-Id: I0032bea573d9200025f9f7dd951e93cb6f1661bb
2015-03-03 16:50:55 +06:00
Anastasia Kuznetsova 765fc5e496 Add simple integration tests for OpenStack actions
For the current moment we have tests for some OpenStack action for Mistral v1,
to cover main functionality of these actions in v2 new test suite was added.
New tests will check that all implemented OpenStack actions are in the working
state and Mistral can connect to OpenStack components like Heat, Nova, etc.
and execute basic operation: get list of objects.

Change-Id: Ie6cda877c12509e23a81ccf5da48d870229b3779
2015-02-18 12:15:47 +04:00
Anastasia Kuznetsova 8919453e10 Fix H904 pep8 error
Change-Id: I6540c5547a68721cc40b46b96da3648be00fa766
2015-02-09 15:23:06 +04:00
Anastasia Kuznetsova 15e92ff4a5 Fix imports due to changes in tempest
Change-Id: I4705912e25e2e7517b78cf98fd87c36ab8402bc2
2015-01-21 15:33:46 +04:00
Anastasia Kuznetsova fa0bbe0842 Fix mistralclient initialization
Change-Id: I2ea334cecbcd5992bb8e5dd944ed6c49c5aff3e4
2015-01-12 16:45:50 +04:00
Anastasia Kuznetsova 407eeb5551 Refactor API tests for v2
- Separated v1 and v2 api tests for workbooks and executions;
- Added more tests scenarios;
- Optimize methods realization for v2 tests.

Change-Id: Ic24383bc7e6c059088e98eeeeab28ae7bda2de6a
Closes-Bug: #1384564
2014-11-27 17:03:04 +04:00
Anastasia Kuznetsova 3672b7947f Add API integration tests for actions
Added positive and negative API tests for 'actions'
endpoint.

Change-Id: I6e5fdb83359371e53c28873b74a77138dd38b6fe
2014-10-29 11:43:14 +04:00
Anastasia Kuznetsova e00ad25ca6 Add functional API tests for cron-triggers
- Added API tests which check main api calls to cron-trigger endpoint
- Fixed tearDown method (there was a problem when item array
had a few elements, not all of them were deleted)

Partly implements: blueprint mistral-triggers-functional-tests

Change-Id: Ibba7cd03e6ccdf06c76ea4ea161542b954faee0f
2014-10-20 15:48:50 +04:00
Anastasia Kuznetsova 888fefc37e Update tearDown methods in API integration tests
After testing new script run_functional_tests one destructive issue
was discovered that after this script all executions were deleted.

This situation was fixed. Now in all create methods identifier of
created object saves in array and in tearDown methods tests delete
only objects which were saved in appropriate arrays.

Change-Id: I442aecd346c003cd38ce6977e4f69f9bfa32e894
2014-10-02 12:11:53 +04:00
Anastasia Kuznetsova aacdb47af3 Add script to run functional tests locally
- Added script that can run part of functional tests locally
- Added needed mocks in base.py file so that we don't interact with keystone
- Added small a description how to run new script

Change-Id: I1867fb93f540c8f061fd09c40a283ce1ef2c072c
2014-09-25 22:53:43 +00:00
Anastasia Kuznetsova 411812e5fd Fix API tests for v2 version
Change-Id: I2e7b70d15de95639d1536fc3e2709dbbfc31002c
2014-09-25 11:45:52 +04:00
Anastasia Kuznetsova 763b091565 Add param 'name' to the test definition
Change-Id: Idce966178ef835b493fce928dc6e6be516fc6552
2014-09-22 12:50:38 +04:00
Anastasia Kuznetsova b5724cae4a Add API integration tests for v2
- Added integration tests for API version 2
- Refactor base.py, separate methods for v1 and v2
- Created second endpoint /v2 in keystone in devstack installation

Change-Id: Ibe23971b2335242ed72b837bfc1f861d0a74e395
2014-09-18 13:19:05 +04:00
Nikolay Mahotkin 6c0cc7e456 Fix execution state ERROR if task_spec has on-finish
* We shouldn't set execution state in ERROR if
   task has on-error or on-finish property
 * Fix wait_success method in functional tests

Change-Id: I48e452d5974dd854eb14dcaf23d13e81107a03dc
2014-09-01 17:50:59 +04:00
Jenkins 9f0672bc5b Merge "Cosmetic changes in integration tests" 2014-08-22 08:25:08 +00:00
Anastasia Kuznetsova e35b98d4af Fix small issues in tests
- Inserted blank lines
- Renamed value in test_workflow_execution.py to avoid the confusion

Change-Id: I8145a8f416717c2804193f2d4ae8df60431e36e9
2014-08-19 12:50:41 +04:00
Nikolay Mahotkin c9b0ed8900 Cosmetic changes in integration tests
* Cosmetic changes in integration tests on
   OpenStack Actions according comments in
   https://review.openstack.org/#/c/113881/

Change-Id: I660e1435e34d000b9de9b59769c73b04842ff724
2014-08-19 10:55:02 +04:00
Nikolay Mahotkin c6b1aa11d7 Add integration tests on nova actions
* Small refactoring
 * Added nova_actions scenario
 * Added Nova action tests

Change-Id: I0185ba5bcf2638559a5c6375360726192f3e93a5
2014-08-18 17:55:35 +04:00