Commit Graph

97 Commits

Author SHA1 Message Date
Vu Cong Tuan 655515bc97 Replace the usage of some aliases in tempest
In tempest, following aliases have been moved in version Pike
and will be removed in version Queens:ad
* manager > os_primary [1]
* admin_manager > os_admin [2]
* os_adm > os_admin [3]
* os > os_primary [4]
* alt_manager > os_alt [5]

[1] https://review.openstack.org/#/c/468036/
[2] https://review.openstack.org/#/c/467852/
[3] https://review.openstack.org/#/c/467605/
[4] https://review.openstack.org/#/c/466991/
[5] https://review.openstack.org/#/c/457555/

Closes-Bug: 1720000
Change-Id: I141c36c785bf4e8dcd5b538444afa6d2fc91e8c3
2017-10-16 15:38:56 +07:00
Jenkins 047ecdffd7 Merge "Add processed field with current time" 2017-08-14 14:35:55 +00:00
Marc Aubry 94d277c7ed DeprecationWarning os_adm becoming os_admin
Change-Id: Ibdd7530644ad4dfa36482e99d4587b82cd6653e8
2017-08-08 09:20:26 -04:00
Marc Aubry 082b29aa36 Add processed field with current time
Change-Id: I6deddefc3cb7fb85726f9958fce8e26ca50d578c
2017-08-07 19:32:26 -04:00
Vu Cong Tuan add74e4b01 Define hacking rules to ensure code quality
Enforce following codestyle rules:

* no xrange
* no LOG.warn usage (deprecated in favour of LOG.warning)
* usage of assertTrue(x) instead assertEqual(True, x)
* usage of assertIsNone(x) instead assertEqual(None, x)
* usage of assertIsNotNone(x) instead assertNotEqual(None, x)
  or assertIsNot(None, x)

Change-Id: I356a9c77986557a36144f503852fac5d6ba4bc20
2017-06-14 18:44:22 +07:00
Vu Cong Tuan d11423673f Replace oslo_utils.timeutils.isotime
Function 'oslo_utils.timeutils.isotime()' is deprecated in version '1.6'
and will be removed in a future version. We use
datetime.datetime.isoformat() instead.

For more informations:
https://docs.openstack.org/developer/oslo.utils/api/timeutils.html#oslo_utils.timeutil

Change-Id: Ie9161bbe036e24c657717b379f79bc64737587e2
2017-06-02 14:52:26 +07:00
Frédéric Guillot ef8897f58b Add API versioning
- All OpenStack projects have API versioning
- Existing endpoints are now prefixed with /v1
- Still fully backward compatible with old endpoints
- No HTTP redirects is used to avoid unexpected behaviors with
existing clients

Change-Id: If51f3291c44615991b3378b711dffacc1bd2591f
2017-05-12 14:53:12 -04:00
Jenkins ed9f99ae0a Merge "Write doc without flask autodoc" 2017-04-18 14:20:11 +00:00
Frédéric Guillot c22dc7babe Write doc without flask autodoc
- remove inline docs from routes.py
- correct certain response payloads
- add all api docs to index.rst

Change-Id: I58bb24f1a8ce173264ab9c1607cbe3af8d936fdb
2017-04-18 09:31:50 -04:00
Frédéric Guillot e1428c042f Do not try to stop failed listeners
Change-Id: Ic60e9330da7fa74e66d581bf01f6e901f8d5d4ed
2017-04-13 10:14:22 -04:00
Frédéric Guillot de22d48ad0 Add option to override default thread pool size
Change-Id: I1e9d4909c65092a2976f2b344c16a52fd3a95801
2017-04-05 09:47:31 -04:00
liangcui d1798c92f8 Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids.
We should only use that function when generating uuids for consistency.

Change-Id: I03a683f02ef0bb98afce2c91d4186ce63522dbeb
2017-03-24 17:17:27 +08:00
Ken'ichi Ohmichi 2bd049d1af Switch to use stable data_utils
Tempest provides stable library interfaces under tempest.lib.
This patch switches to use it for data_utils.

Change-Id: Id42ef764130b6fd82e089486775acdd4e709ecfc
2017-03-09 21:12:13 +00:00
Frédéric Guillot 4429e77ad3 Update code to latest changes in olso.messaging and tempest
See 94c818dc98 (diff-60d9d920c907281c0886983986a46a84)

Change-Id: I9483c15fb4fdf2763e9c891162713a5465fea020
2017-03-09 14:38:06 -05:00
Frédéric Guillot 262586195d Handle instances deleted before completion
This change avoid sending notification to critical queue
when instances are deleted before their completion.

Since we are never going to receive the create.end event,
we use a 15 minutes window to assume the instance was never
created. This check is made only if the entity is not found.

- Add more flexible filters system
- For now, filters are only for on delete events
- Add date helper to manipulate and parse date

Change-Id: Iba97f050bf6e164bf0d83035a884cdbe023d92fc
2017-02-22 16:27:50 +00:00
Anh Tran 45e76f87d4 Remove unused logging import
Change-Id: I17e56b7aadc8e66dd9c0341ef2e8542d696d68af
2017-02-22 13:58:36 +00:00
Frédéric Guillot b9893d4d82 Remove image metadata during teardown
Change-Id: I6194336a696ad524f67fbcdc9702619189ff1d95
2017-02-21 16:19:50 -05:00
Marc Aubry dcef52bbd3 Handle instance being rebuild causing integration-test failure
Tempest now have only 1 image instead of two.  This address the
concern by setting the metadata to all images and returning the
first one instead of assuming there is two.

Change-Id: I8ea8ae85d06c8dcc7373c9cf8cd5a9c978b15e28
2017-02-16 12:53:48 -05:00
Frédéric Guillot d888655fc7 Stdlib imports are always first
Change-Id: I219fda2121e8a3607dfcf42fb6ea3b3756c3614a
2017-01-20 09:11:41 -05:00
Frédéric Guillot 04c4fcf900 Fix wrong logic in notification error handling
Notifications are sent indefinitely to the error queue instead
of being sent again on info queue.

Change-Id: Ie8e946fdbe8a6c977a869fb4d58fb764effc2c35
2017-01-19 13:27:45 -05:00
Frédéric Guillot 4fbb9d7b56 Handle deletion of errored instances
When a new instance is created and the state is in error,
the event "compute.instance.create.end" is never sent.

However, when we delete an errored instance the deletion event is
sent, but the entity doesn't exists in te database.

This fix avoid false positives in the critical queue.

Change-Id: I70a4ae92bda37909cfd6021e0311a69b7ad189bc
2017-01-18 16:29:20 -05:00
Frédéric Guillot f66cc7ef44 Ignore unrelated notifications sent on error queue
- Nova can send notifications directly on the error queue.
- We should handle only notifications reported as error by Almanach.

Change-Id: Ic41e7115dd7d4f99d72d3319af67b204a0b62122
2017-01-18 13:40:55 -05:00
Paul Millette c024e7061c Remove last usages of flexmock
Change-Id: I4993bea250b96cc4f8fadabf03349ac9fcb6271a
2017-01-13 10:25:02 -05:00
Frédéric Guillot 53812aeb40 Fix broken logging
Allow-us to log to files.

Change-Id: I6864a7968967be6362d142b3d7ffee74abce9dc2
2017-01-12 16:28:13 -05:00
Paul Millette 308a04d678 Remove all remaining usages of hamcrest
Change-Id: Ia6ebcf8be699c378c812c3a4771d20d62e7c8235
2017-01-12 13:40:12 -05:00
Paul Millette 00ff775da4 Remove hamcrest from all api test classes
- required for removal of the last occurence of flexmock
- bit of a big bang change but all must be changed at the same time

Change-Id: Ib329056e5904b726490173d5e43a0ac74592722f
2017-01-12 10:22:31 -05:00
Frédéric Guillot 54b56940db Handle multiple listeners
The collector service can now receive notifications
from multiple RabbitMQ servers.

Change-Id: Ie06cae29ed929ea46397a76796a6b575a859bce7
2017-01-11 21:25:47 +00:00
Jenkins 3d8c3d5f68 Merge "Fix tempest tests" 2017-01-11 18:30:21 +00:00
Frédéric Guillot 50d9681854 Fix tempest tests
- The argument service doesn't exists anymore and
set the value of the variable scope to None instead.
- Make tests a little bit less flaky by using waiters
inspired by tempest waiters

Change-Id: Ic376f22d9244d3ddb8d9e8ed0e00c4a64f5cede5
2017-01-11 12:38:33 -05:00
Paul Millette ad1104de6e Use builtin-mock in Api MixedAuth
Change-Id: I25428a7eed5aa1596490f2b13a295c2f7a72a5bd
2017-01-11 11:14:36 -05:00
Paul Millette 2f6e86049b Restore entity controller test call
Change-Id: Id32a0c7afab93eac4b96b301cccc71acfb8e5383
2017-01-06 15:10:03 -05:00
Paul Millette 3d175cdae4 Entity controller unit test use built-in mock
Change-Id: Icbdf9eb1a6bfeefe06e7da774b1e1cf138f9d9a4
2017-01-06 13:42:12 -05:00
Jenkins 6593961855 Merge "Volume controller unit test use built-in mock" 2017-01-06 16:18:56 +00:00
Paul Millette 4732b22f42 Instance controller unit test use built-in mock
Change-Id: I2534455ec87376cc89c5829d8fb4108a21461cc6
2017-01-06 10:24:54 -05:00
Paul Millette a41d3d982f Volume controller unit test use built-in mock
Change-Id: Ie6e0fca86ca7285d01c2bf40a1db48942cdfcedb
2017-01-06 08:56:16 -05:00
Frédéric Guillot c344ad0d80 Add unit test for application controller
Change-Id: I3b663b39d94f2b56559faf753e3b46d47a1ca000
2016-12-29 11:15:03 -05:00
Frédéric Guillot 4793264851 Use same naming convention everywhere for test classes
Change-Id: If619973f203a811dedd5fdfd9a6c32373e3afe85
2016-12-29 10:35:08 -05:00
Frédéric Guillot 1f62249bae Models refactoring
- Add unit tests for models
- Avoid default method arguments with mutable values
- Simplify object serialization/unserialization
- Model objects are self-contained and do not use global functions
- Do not hardcode specific image metadata in the code
- Rename "os" key to the standard name "image_meta"
- Both keys "os" and "image_meta" are stored in the db for backward compatibility
- List of image metadata is configurable in config file

Change-Id: I2826713e438de63a49aae71cf7100288bde6bee1
2016-12-29 10:16:03 -05:00
Frédéric Guillot fb553cea34 Remove hamcrest from mongo driver unit test
Change-Id: I2ac1f45afaf05bebc6cced3a6c47e7abf9b6a1ab
2016-12-27 15:55:15 -05:00
Frédéric Guillot 8a8e7fa781 Remove flexmock from volume type controller test
Change-Id: I96ed858aa2a32ec031f604862d2e38165bab5cf0
2016-12-27 15:19:53 -05:00
Frédéric Guillot 1d007ad09f Move entity builders to builders package
Change-Id: Iecce1bfd080612ae7ab5752047236069ae0d8d99
2016-12-27 15:00:41 -05:00
Frédéric Guillot 03b1d2ce86 Cleanup Mongo driver and use specific exceptions
- Raise appropriate exceptions
- Rename some methods
- Make unit test more readable

Change-Id: I2a5ae5ef863184c08af7be6860c96d4956fe38e7
2016-12-27 14:20:35 -05:00
Frédéric Guillot 7fd58f7d8f Add service and core factory classes
Change-Id: Ic5bbe30ec13cd8ee95c4aad0dc58f53fa1d6d159
2016-12-21 11:27:37 -05:00
Jenkins 9d4c3955e6 Merge "Split controller into multiple classes" 2016-12-21 14:54:32 +00:00
Frédéric Guillot 5026f02d1d Split controller into multiple classes
Change-Id: Id4a2c6227400312d9e0477c29c516d190c5b774e
2016-12-21 14:18:07 +00:00
Marc Aubry 2ed8eb01ec Add Tempest scenario for volume API
Change-Id: I06ad630ff9d453bdaebd5e9e2842b66afc095a65
2016-12-20 23:41:43 +00:00
Marc Aubry 22f4e62a25 Avoid hardcoded RabbitMQ URL in devstack plugin
Change-Id: Ibc9bbfa622f20b5b64eb7d6c4062b59efd81d249
2016-12-20 17:13:31 -05:00
Marc Aubry 0d5ba59482 Add Tempest scenario for API
Change-Id: If1c38b1a2004295675a7c66722d79ce80dec8dcf
2016-12-16 09:57:08 -05:00
Marc Aubry 51f1fa1d3d Fixing rst of tempest readme
Change-Id: Ib337b23fe07e4f8114154cd4dd4558a9d533606d
2016-12-14 18:09:07 -05:00
Frédéric Guillot 08eab5f105 Add tempest scenario for instance rebuild
Change-Id: If8e4f0af61bb5ebdb56c1b4e31ea9bc2aabf14c2
2016-12-14 11:02:40 -05:00