Commit Graph

80 Commits

Author SHA1 Message Date
Chandan Kumar 4f57c90d69 Remove intree mistral tempest plugin
* https://review.openstack.org/524869 moves the intree mistral
  tempest plugin to a new home openstack/mistral-tempest-plugin
  let's use it.

* It also removed intree mistral tempest plugin as well as fix the
  jobs to use the same.

Change-Id: I28ba8408452637aa093b343441f3715dc4754a3f
2017-12-26 07:49:14 +00:00
Dougal Matthews 33db0ad5d7 Disable unstable tempest test_run_ssh_proxied_action test
This disables test_run_ssh_proxied_action. Currently it causes the tests to
fail frequently which makes them less useful and blocks patches incorrectly.

Related-Bug: #1736685
Change-Id: I9bd4cb8f828eca3e3227d8e52ef916191a36b45f
2017-12-19 13:23:50 +00:00
Dougal Matthews b291e502b2 Re-work the direct action call tempest test
The current version calls the Mistral API, this seems to be unstable.
Using another std action is enough to validate that this works
correctly.

Related-Bug: #1736685
Change-Id: I2ea70b228f3240ed89c3a3d4bd991459a6736f8c
2017-12-08 09:23:26 +00:00
Dougal Matthews d53c1a9834 Disable unstable tempest test_create_action_execution_sync test
This disables test_create_action_execution_sync.
Doing so allows us to mvoe towards a voting tempest job. We need to come
back and fix or replace this test later.

Related-Bug: #1736685
Change-Id: Icfa134d391476cad6ef925c84e93754d8a625ef2
2017-12-06 11:43:51 +00:00
Dougal Matthews cd37173c8c Disable unstable tempest multi_vim_authentication test
This disables test_multi_vim_support_target_headers_and_service_catalog.
Doing so allows us to mvoe towards a voting tempest job. We need to come
back and fix or replace this test later.

Related-Bug: #1736685
Change-Id: Ie6a9e67837fb8c6386f915209ecf11974ab052c6
2017-12-06 11:43:51 +00:00
Zuul f1e2385f80 Merge "Allow filtering executions by their root_execution_id" 2017-12-06 10:30:24 +00:00
Brad P. Crochet c7089bf21c Add new tempest tests for swift and zaqar client actions
Change-Id: I58c20ec36086a812ae7fad4637e977d1bc7c9838
2017-11-29 14:47:02 -05:00
Dougal Matthews 28130bb862 Allow filtering executions by their root_execution_id
With this filter, it will be possible to find all the workflow
executions started by a root execution.

Implements: blueprint mistral-root-execution-id
Change-Id: Ie18493c8f59f5d77107f0adf5db491b0db05cee2
2017-11-28 11:19:52 +00:00
Kaustuv Royburman 9f8719024b Decoupling of Mistral tempest test from Mistral code base
The Mistral Tempest tests have a hard-coded dependency on Mistral being present
when Tempest tests are executed.
When trying to sparse-checkout the mistral_tempest_tests folder to run
the Mistral tests as a Tempest plugin; it fails due to Mistral not
being installed as some utilities and resources which are written in
the Mistral Tempest tests are being hard referenced from Mistral
being installed in the same environment.

This patch decouples the Mistral Tempest Tests so that they can be executed in
a stand-alone mode along with the necessary resources that are required to
execute the Tempest tests.

Change-Id: Ifd6a3a65a14c4ad4736dccc3e72cd564b6f53a0a
Closes-Bug: #1714732
2017-10-09 23:20:06 -05:00
Jenkins 418e27f9c6 Merge "Fix test for decoding utf8" 2017-09-01 05:06:41 +00:00
Michal Gershenzon 869e752976 Fix test for decoding utf8
Google sometimes returns 302 json, causing the test to fail.
This commit switches to httpbin.

New url used in test:
https://httpbin.org/encoding/utf8

Change-Id: I095f468310c58cede509f520feb005901a48c0c6
2017-08-15 08:31:54 +00:00
Eyal e1ee92d455 import fails in python3
use six to solve this

Change-Id: I0057fd2173deeab30001499ed19f2178ccd02b45
2017-08-14 10:44:51 +03:00
Jenkins f2ed583540 Merge "Create and run a workflow within a namespace" 2017-08-01 20:02:02 +00:00
Michal Gershenzon cbee740de5 Create and run a workflow within a namespace
Allow adding many workflows with the same name.
The way this works is by adding the new workflows under another
namespace.

Notice that:
  1. Namespaces are not part of the mistral DSL.
  2. When executing a workflow, the namespace passes down to the
     subworkflow.
  3. When searching for the sub-workflow definition -
     If no workflow was found in the given namespace, than the defualt
     namespace will be used.
  4. The default namespace is an empty string.
  5. The namespace property or the workflow execution will be under
     params

Partially-Implements: blueprint create-and-run-workflows-within-a-namespace

Change-Id: Id248ec5906a0899d188675d002b45f6249d36d90
2017-08-01 13:51:05 +00:00
Michal Gershenzon 4e38d9d789 Remove deprecation warning from tests
manager and alt_manager are marked for removal in Queens[1]
This commit replaces them with os_primary and os_alt.

[1] https://github.com/openstack/tempest/blob/master/tempest/test.py#L369-#L385

Change-Id: Icd3e9e3a52369fa159898346057c8322c63ef993
2017-07-31 15:33:44 +00:00
Jenkins 8367452608 Merge "Use 'related_bug' decorator from stable interface" 2017-07-27 14:52:30 +00:00
Jenkins 80fd476f62 Merge "Add a hacking rule for string interpolation at logging" 2017-07-26 20:11:38 +00:00
Sharat Sharma b38dceec50 Add a hacking rule for string interpolation at logging
From [1], string interpolation should be delayed to be handled by
the logging code, rather than being done at the point of the logging
call. Add a hacking rule, [M331], to delay the string interpolation.

[1] https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
Change-Id: Ibf0ac960ae84e935979f93f3a0dec8d774aade78
Closes-Bug: #1705634
2017-07-26 11:13:15 +00:00
Jenkins ca307415a1 Merge "Tests: Remove the redundant method" 2017-07-25 12:29:54 +00:00
ghanshyam 1b731be29c Use 'related_bug' decorator from stable interface
Tempest has made 'related_bug' decorator as stable interface.

This commit move the usage accordingly.

Change-Id: I20497d48a46195644a114dd9f6b86aca59303097
2017-07-25 12:00:43 +00:00
Luong Anh Tuan dd8399a0db Replace test.attr with decorators.attr
Function 'tempest.test.attr()' has moved to 'tempest.lib.decorators
.attr()' in Pike and will be removed in a future version.
This patch replaces the 'tempest.test.attr()' with the 'tempest.lib
.decorators.attr().'

Change-Id: Iba7361382ff3b3d2b055a0507af9a8a88cd4a4ce
2017-07-18 18:12:15 +07:00
junboli a2e6eb010d Tests: Remove the redundant method
This patch removes the redundant setUp() methods in order to
keep the code clean, In the subclass, setUp() methods has no
benefit from that, the one in superclass could satisfy that

Change-Id: I0114e4dcfe99b1c151ce84cace0fecb7952e3ef8
2017-07-12 16:41:31 +08:00
Van Hung Pham 6f92b6fb13 Replace the usage of 'admin_manager' with 'os_admin'
In tempest, alias 'admin_manager' has been moved to 'os_admin'
in version Pike, and it will be removed in version Queens [1].

[1] https://review.openstack.org/#/c/467852/

Change-Id: I9c8890b3e39648fdce01c8f3be9fdc51927dc37a
2017-06-26 10:32:20 +07:00
Vu Cong Tuan e6c6710283 Replace assertEqual([], items) with assertEmpty(items)
Since assertEmpty() function has already been implemented,
let's use this function instead of generic assertEqual() function.
This change makes the code and the error messages to be more readable.
Therefore it improves maintainability a little bit.

Change-Id: I953aea98b2aad21552bafcb673d7872334cc99a5
2017-06-12 16:13:13 +07:00
Jenkins 7334a7602c Merge "Fix gate failure" 2017-04-10 09:57:42 +00:00
Jenkins 2bee4b7992 Merge "Replace six.iteritems() with .items()" 2017-04-10 05:46:38 +00:00
Lingxian Kong 7e2dcaea03 Fix gate failure
The failure:
http://logs.openstack.org/45/454945/1/check/gate-mistral-devstack-dsvm-ubuntu-xenial-nv/e9daa6e/console.html#_2017-04-08_11_50_48_519100

When populate workflow actions in database, no actual authentication is
made, as a result, for Keystone client, the 'service_catalog' property
value is None. After the patch[1], the 'service_catalog' related
actions won't be inserted into the database and can not be used in
workflow definition.

This change removes 'service_catalog' related actions from the mapping
file and modify the keystone action test case accordingly.

Change-Id: I469d38cad165b57690c43db485f86e898f08de06
2017-04-09 22:43:28 +12:00
Lingxian Kong b398ae5b43 Role based resource access control - delete executions
We already supported role based api access control, this series patches
will implement resource access control for mistral, so that
administrator could define the rules of resource accessibility, e.g.
admin user could get/delete/update the workflows of other tenants
according to the policy.

Delete executions by admin already supported after following patch
merged: https://review.openstack.org/#/c/451160/

This patch adds some tests.

Partially implements: blueprint mistral-rbac

Change-Id: I918708d5bf76abdf2c2c08bb147fa50bd715f526
2017-04-06 10:11:52 +00:00
Sharat Sharma 16997f5184 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I79c7bd34c37ef5bd9e789ccdb24e04bc547e5027
2017-04-05 17:37:17 +05:30
Anastasia Kuznetsova a46dfbfb7b Change Http action result content encoding
Sometimes action result is present not in "utf-8", it cases
to "UnicodeDecodeError: 'utf8' codec can't decode byte" so
need to pass proper encoding format in serialiser and deserialiser
if it is different from default, but it should be resolved in
general as a fix for another bug (#1676411).

As a hotfix for linked bug, encoding was changed in the
run Http action method directly.

Also default encoding value in the FakeHTTPResponse was changed
from 'utf8' to 'utf-8' like in official python request lib docs.

Change-Id: I0ab9ec84c0973f362b57ab82248f27768a984678
Closes-Bug: #1667415
2017-04-03 18:36:22 +04:00
Jenkins 5d98ccd114 Merge "Add hacking for code style checks" 2017-03-16 14:45:41 +00:00
Sharat Sharma e986cb8542 Add hacking for code style checks
The following style checks are added:
 * do not use dict.iteritems
 * do not use dict.iterkeys
 * do not use dict.itervalues

Partial_implements: blueprint mistral-hacking

Change-Id: I25d846c80652d7746c3b958239797ce524ec235f
2017-03-16 07:38:09 +00:00
Lingxian Kong a392f4ceb6 Fix multi_vim tempest test failure
Change-Id: Id763e741b5c131843fdd0a966b793b533d36776b
2017-03-16 13:32:19 +13:00
Lingxian Kong 936452e08a Fix update workflow by admin
Change-Id: I38cada2e467d2b2b2ca0f332e9331caa2fc64f47
Closes-Bug: #1667174
2017-03-06 09:04:00 +00:00
Jenkins f919666421 Merge "Add idempotent_id decorator to tempest testcases" 2017-03-05 11:46:59 +00:00
Jenkins be9a0d7264 Merge "Add idempotent_id decorator to tempest testcases" 2017-03-05 11:09:47 +00:00
Jeremy Liu 36a7d8ebd0 Add idempotent_id decorator to tempest testcases
The idempotent_id decorator allows for tracking of tests even
after they have been renamed [1]. This patch adds idempotent_id
decorator to api related testcases for mistral_tempest_tests.

[1] https://github.com/openstack/tempest/blob/master/
    HACKING.rst#test-identification-with-idempotent-id

Change-Id: I70f5ec2e18fd0845b7189b26cb40b9b260126146
Partial-Implements: blueprint add-idempotentid
2017-03-03 20:54:24 +08:00
yushangbin 4ea86fccf5 Add idempotent_id decorator to tempest testcases
The idempotent_id decorator allows for tracking of tests even
after they have been renamed [1]. This patch adds idempotent_id
decorator to scenario related testcases for mistral_tempest_tests.

[1] https://github.com/openstack/tempest/blob/master/
    HACKING.rst#test-identification-with-idempotent-id

Change-Id: I955cd8b063b5a5d7d94cbd769b93521e35c9649b
Partial-Implements: blueprint add-idempotentid
2017-03-03 17:21:37 +08:00
Michal Gershenzon 861d572b23 Remove output from list action executions API
output field should be returned only when getting one action execution

Change-Id: I9913f4893b3eaf30faca1a747eeeda493dbc0fb2
Closes-Bug: #1610817
2017-03-02 10:40:37 +00:00
Brad P. Crochet f78b0a6228 Use utcnow() instead of now()
The ActionTestsV2.test_get_list_actions_greater_than_filter test will
fail if the system running the tests has a TZ that is behind UTC. By
using utcnow(), it will compare the times correctly.

Change-Id: I0bf6cadac9c3f01681e603b9c77c55ba87029dbd
2017-01-12 17:45:12 -05:00
Jenkins 47a7274c76 Merge "Role based resource access control - get workflows" 2017-01-10 11:54:03 +00:00
Ji zhaoxuan 08f186a6e1 Python3 common patterns
Modify some codes in order to make them meet
the Python3 common pattern.
In this patch,I replace filter(lambda obj: test(obj),data)
with[obj for obj in data if test(obj)]

Change-Id: I68e76f91dc31aa0e00124c1eb76a0a1f0178cc44
2017-01-10 07:54:48 +00:00
Lingxian Kong 965db538aa Role based resource access control - get workflows
We already supported role based api access control, this series patches
will implement resource access control for mistral, so that
administrator could define the rules of resource accessibility, e.g.
admin user could get/delete/update the workflows of other tenants
according to the policy.

TODO:
- Implement update workflow by admin
- Implement delete workflow by admin
- Implement for other resources(workfbook/execution/task/action, etc.)

Partially implements: blueprint mistral-rbac

Change-Id: I8b00e8a260a74457ad037ee7322a7cba9ae34fab
2016-12-22 14:12:33 +13:00
Spencer Yu 3b1ed4ec3e Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Iff88f55dc51981ce502d7d3e67c467242980f20c
2016-12-16 08:24:10 -08:00
Jenkins eb286afe1e Merge "Replace uuid4() with generate_uuid() from oslo_utils" 2016-11-09 13:20:26 +00:00
Jenkins 532db4bf63 Merge "Add type to tasks API" 2016-11-09 10:55:22 +00:00
pawnesh.kumar e9ba374707 Replace uuid4() with generate_uuid() from oslo_utils
As of now, UUID is being generated using either uuid.uuid4()
or uuidutils.generate_uuid(). In order to maintain consistency,
we propose to use uuidutils.generate_uuid() from oslo_utils.

Change-Id: I620cb1f396ce011b9846ff2dad2c9811bc5d0652
Closes-Bug: #1082248
2016-11-09 09:22:19 +00:00
Michal Gershenzon 553c2b7983 Add type to tasks API
In order for a user to know if the task execution is
of type workflow execution or action execution,
the type should be returned in the API

Partially implements: blueprint mistral-task-subexecutions-endpoint

Change-Id: I9ff474797df0f9cbbddfeda3292d582dfeb2b702
2016-11-08 14:56:18 +00:00
Cao Xuan Hoang 195f6972e9 Remove logging import unused
This patch removes logging import unused in
mistral/auth/__init__.py
mistral/tests/unit/workbook/v2/test_tasks.py
mistral_tempest_tests/tests/api/v2/*.py

Change-Id: I66233ba2f458801fb1543e5b4001a4300e74cec2
2016-10-11 13:59:59 +07:00
Nishant Kumar cab2734a94 Stop adding ServiceAvailable group option
Service available group already exists.Therefore we don't need to
register this group here again.

Change-Id: I570cb7c1d2e13318a102b9f01a85fd24ffb89f9a
Closes-Bug: #1621036
2016-10-01 13:50:30 +05:30