Commit Graph

46 Commits

Author SHA1 Message Date
Chandan Kumar 1f2e722e04 Refactored blazar tempest plugin
* In order to complete the tempest plugin split goal, we need to
  refactor the blazar tempest plugin so that we can easily consume.

* use six.moves import range instead xrange to avoid flake8 error

Change-Id: I88f2a961d770d6deebd9af567d6407e677c102ae
2017-12-15 15:37:55 +09:00
Maho Koshiya 5cd53f3308 Add a termination scenario test
When the user specifies end_time and executes update API,
check that resources are correctly released at lease end time.
It confirm that the instance created during the lease period
have been removed by lease end.

Change-Id: Ic1076905ad5f2fc894036b045743eacb5c2db9bd
Partial-bug: #1694181
2017-11-27 05:24:05 +00:00
Zuul e6cf6fd428 Merge "Add scenario test of lease expiration" 2017-11-27 03:32:32 +00:00
Ngo Quoc Cuong c878da337f Add log hacking rules
- [C312] Validate that logs are not translated.
- [H904] Delay string interpolations at logging calls. [1]

[1]https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages

Change-Id: I58930b6b42b00b28d80bda917834b077c380b0a0
2017-10-09 07:18:19 +00:00
Jenkins 0004c21b99 Merge "Fix typos" 2017-10-06 03:12:02 +00:00
ghanshyam 331be644b4 Shrink Tempest scenario manager copy
scenario manager in tempest plugin was copied from
Tempest to avoid any plugin break.

This copied version of scenario manager is using lot of
Tempest interfaces. Many of them are not stable and might
change which can break plugin.

For example - https://review.openstack.org/#/c/503875/3

This commit shrinks the scenario manager copy to keep
only required methods.

Change-Id: I1a3b654afed303bdea77177d18aa294fd6d00d7d
2017-09-23 17:06:53 +00:00
shangxiaobj a25b350c87 Fix typos
Fix a typo and update a http doc link.

Change-Id: I242a4173742973f2024e5151d8c92ef8cd80a07a
2017-09-12 02:15:09 +00:00
Jenkins fc940e565e Merge "Validate physical host reservation parameters" 2017-07-07 03:04:55 +00:00
Maho Koshiya adeb401abc Add scenario test of lease expiration
The reserved host for blazar users are released when the lease expires,
and host aggregate that created for Blazar is deleted.
Check the instance created during the expiration has been removed
by release of host.

Change-Id: Ied3c766a1d7d839eb4301b494e4b35c75151f242
Partial-bug: #1694181
2017-07-06 15:16:07 +09:00
Pierre Riteau e5fe79cd20 Fix eventlet monkey patching
Eventlet monkey patching needs to be done as early as possible,
otherwise previous library imports are not patched correctly. This fixes
issues with concurrent requests receiving a 500 Internal Server Error
with a traceback including the following message:

    AttributeError: 'function' object has no attribute 'get'

This commit also adds a new Tempest scenario to test for this issue by
running concurrent requests against the Blazar service.

Change-Id: I9be2b6787a151d54ca9cce5c91fa9e11e727ce0b
2017-07-05 17:58:50 +01:00
Pierre Riteau 13ec3e61f5 Validate physical host reservation parameters
If min or max are missing or cannot be converted to integers, a Blazar
exception is returned.

Change-Id: I2f4b51a4e122345de221e51e6e977c12f5e2b867
2017-07-05 16:23:02 +01:00
deepakmourya b49ffc4170 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: Ia4db56b3561f5019a61abdc8650729b7777c1289
2017-06-28 15:22:45 +00:00
Pierre Riteau dbc8e4bc77 Fix code for deleting instances when leases end
The code deleting instances when leases end runs Nova queries as the
Blazar service user. Because it was not using the optional all_tenants
parameter, the query would only return instances owned by the service
project.

This commit sets the all_tenants parameter, allowing the query to return
all existing instances on the host no matter which project started them.
It also extends the Tempest host reservation scenario to delete the
lease and verifies that the instance is correctly terminated.

Change-Id: I6fed0ca12505c94a709f8070dfc6e26d2093345f
Closes-Bug: #1699107
2017-06-20 13:31:06 +01:00
Masahito Muroi f2466e85c9 Use manager name in tempest test
Some tempest variables have changed name in Pike. This patch follows
the changes.

Change-Id: I7768f18da41e79c2e99bbfccf8a93853ab8b8359
2017-06-12 22:38:45 +00:00
Masahito Muroi ecba2a85af Revert "Fix gate issue in scenario test"
This reverts commit 124ac0557a.
The root cause of the gate issue is fixed in Nova
I142f97d691fa55e9824714c9c224f998ad72337e.

Change-Id: I50081d615b1d47215e1e35e62ac2cb14fb1c63ad
2017-06-05 23:36:16 +09:00
Hiroaki Kobayashi 7b8d6765c5 Replace deprecated tempest decorators
The function 'tempest.test.attr()' has been moved in Pike to
'tempest.lib.decorators.attr()' and will be removed in a future
version[1]. This patch replaces 'tempest.test.attr()' with
'tempest.lib.decorators.attr().'

[1] Iaafbb112b6eee458089cc49918359a8a8d0485e2

Change-Id: I2598c6ad24fe4df172db56b79f4aaa4a96a2d23e
2017-05-26 00:20:30 +00:00
Masahito Muroi 124ac0557a Fix gate issue in scenario test
The host reservation scenario test fails because of a bug in Nova:
https://bugs.launchpad.net/nova/+bug/1693438. This patch is a temporary
workaround until the issue is fixed in Nova.

Change-Id: I50b6c92ab930f70479f4524ea675509019567f6a
2017-05-25 09:15:06 +00:00
Hiroaki Kobayashi 1855aa5bd6 Copy Tempest scenario base classes into blazar tree
The QA team will refactor scenario tests in Pike. They asked all
projects which use tempest.scenario.manager to hold a copy of the file
in a projects tree[1].

This patch copy the file into blazar tree.

Note: We should migrate to consume Tempest stable interfaces and remove
the file (contrib/tempest/tempest/scenario/manager_freeze.py) in the
future.

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-February/112938.html

Change-Id: I66f3652ef6322c89f418ca91b321ff766514e099
2017-03-15 11:18:16 +09:00
Masahito Muroi 68d769bf71 Migrate climate namespace to blazar
Although the Climate project was renamed to Blazar in 2014, the code has
still been using the climate namespace.

This patch moves all code to the blazar directory and allows users and
operators to use the 'blazar' command namespace. The 'climate' namespace
remains O release to allow users of Blazar time to move their own
code to the blazar namespace, but will be removed in P release
development cycle.

Change-Id: Icbe6fab1051aae4ac819982a1fa4f323cb0bf2d0
Partial-Bug: #1662734
2017-03-02 09:36:14 +00:00
Masahito Muroi 51c093b0b6 Support host reservation scenario test
The existing Tempest scenario test in Blazar only supports instance
reservation. However, the Blazar service currently only supports host
reservations.

This patch adds a Tempest scenario test for host reservation. It checks
that Blazar correctly reserves a host for a reservation and that an
instance created with the reservation ID as scheduler hint is correctly
scheduled to the host.

Change-Id: Ibbf33ff6344bdc26e005e1fa4252c317fdbdfb90
Closes-Bug: #1659216
2017-02-21 12:44:29 +00:00
Ken'ichi Ohmichi cd9a1f88c6 Switch to use test_utils.call_until_true
test.call_until_true has been deprecated since Newton on Tempest side,
and now Tempest provides test_utils.call_until_true as the stable
library method. So this patch switches to use the stable method before
removing old test.call_until_true on Tempest side.

Change-Id: Ifa2b736c566d178ef7f5aa10056381f592a813dd
Needed-by: Ide11a7434a4714e5d2211af1803333535f557370
2017-02-17 09:50:08 -08:00
Masahito Muroi 3ee6234c1c Mark instance reservation scenario tests skipped
Instance reservation feature in Blazar is now not supported because
of commit 97a4a7e89fbfca53018e096236ea6ed7ab4c0cf2 that stops Nova v2
API to support its API extentions mechanism. It causes the
Tempest gate job to always fail.

Change-Id: I5e515f077b030a85563cc55aeb7e4240627d2f6f
2017-02-09 17:42:19 +09:00
Masahito Muroi a6dd9b89dd Follow latest Tempest framework
Tempest has changed its test framework, but blazar's scenario test
doesn't follow the changes. It causes some scenario test errors.

This patch makes the blazar's scenario test follow up-to-date Tempest
framework.

Change-Id: I1bfe5c5fc61c8036d3e016f3efb8ec2703745848
Depends-On: I0e57f4ee4655a8658419bfaaffad524369ee10b9
2017-02-09 17:40:40 +09:00
Masahito Muroi 5ad2ad4824 Stop using climate python client for testing blazar API
It's better not to use python-client for API testing in gate since
if both server side and client side use the wrong schema and so on,
gate test can't detect the error.

Change-Id: I87b5fccd6354e3725f615fb67b3eea0083a80407
2017-02-09 17:37:49 +09:00
Hiroaki Kobayashi e6ebd0878e Remove contrib/devstack
DevStack doesn't use extras.d to install external repository plugins
anymore. It has been replaced by the plugins interface [1][2]. However,
extras.d related code was still contained in the contrib/devstack
directory.

This commit removes contrib/devstack and its contents.

[1] http://docs.openstack.org/developer/devstack/plugins.html
[2] https://github.com/openstack-dev/devstack/blob/51ecf0a8/functions-common#L1882

Change-Id: I86545cd8436b5a82f4700c01720798ea9f97599e
Closes-Bug: #1649221
2017-01-24 04:36:53 +00:00
Masahito Muroi ca227e6e97 Replace tempest logging module with oslo_log
Tempest removed the oslo-incubator logging module from their
code base in March 2015. Our tempest tests were still using it,
which was causing import errors.

Change-Id: I3bb9a832cd9c9c2b4136cb5ce20d06dbb8f2c837
2016-12-09 17:37:23 +09:00
venkatamahesh 2504221a95 Change repository from stackforge to OpenStack
Change-Id: Id6d427268387a1226e3a69193498b7a7f084725d
2015-10-18 15:50:10 +05:30
Sylvain Bauza 53059527c1 Update requirements, fix oslo imports and correct tests
Since Blazar was in Winter, lots of tech debt was added.

This big change is actually trying to provide a +1 from Jenkins voting jobs.
ie.

 - fix calls to oslo_config
 - correct unittests failing due to removed assert_called()
 - remove pep8 check for verifying blazar.conf (can be readded later)
 - fix oslo_messaging imports

Not sure it's fully functional, Tempest needs to be fixed too but I
hope the gate will allow that change to pass.

Change-Id: Ib70b5b48b47626fc2613ee894d1162219417994f
2015-09-04 13:17:25 +02:00
Harsh Shah fe6352532d Use openstack client to create climate accounts
Climate's Devstack library currently uses keystone client to create
users, services and endpoints. Use openstack client instead of keystone
client to create the same. This seems to be the Devstack preferred way
to do these things.

Change-Id: I7f93460903de530ec88274ba43c78316dc7b6316
Closes-Bug: 1312215
2014-07-08 17:19:48 -07:00
Harsh Shah 12547fec67 Renamed Climate references to Blazar in the docs
References to climate in the docs have been renamed to blazar reflect the new name and enable uploadig docs to readthedocs. Also updated the docs to reference the new architecture image.

Change-Id: I594849afb6268892a03cc716a1707dcde835fa52
Closes-Bug: 1324581
2014-06-27 14:34:31 -07:00
Nikolay Starodubtsev ffe65876e8 Fix style errors close to new hacking update
This patch fix a bunch of errors which will arrive after we
will start use new hacking version.

Change-Id: I49721f1ba9f3f017da00212a9fdc5b87d5afaedf
Closes-Bug: #1330536
2014-06-18 13:51:54 -07:00
Pablo Andres Fuente 30165b015e Updated scenario tests to latest Tempest master
The __init__ method of the OfficialClientManager Tempest class changed
since we implemented our Tempest test. Now this method receives only one
parameter with all the credentials instead of three (user, password,
project). To fix this the ResourceReservationScenarioTest was modified
to use the new API. Also a not valid import was fixed and some minor
things of the test were fixed.

Change-Id: Ic79bdfb0e85d7a47310978a5c3ebd6a37195795e
Closes-Bug: #1326532
2014-06-05 16:14:37 -03:00
Sylvain Bauza 23e327f79c Add extensions for API v2 controllers
Controllers (and API endpoints) should be able to be selected using
configuration flags, as we do for plugins

TODO:
 - Extra Hooks to be configured using stevedore

Implements blueprint: pecan-wsme
Implements blueprint: api-extensions

Change-Id: I12f1bc1accbc870aacb0d1e08c9e0d08223c4b18
2014-05-30 11:19:19 +02:00
Jay Lau 954f5034ce blazar install failed with devstack
The code repo for climate has been change to blazar, but devstack
is still using old climate repo, this caused devstack install failed.

This patch was update the repo to blazar for climate in devstack.

Change-Id: I864aa6e4c4c91fac5521bc63ed984286e1935a22
2014-05-27 12:26:03 -04:00
Jay Lau 06e9244e60 Do not change nova scheduler filters after installed climate
After climate was installed by devstack, it was changing nova default
scheduler filters:
scheduler_available_filters = climatenova.scheduler.filters.climate_filter.ClimateFilter
scheduler_default_filters = ClimateFilter

But the default scheduler filters for nova is the following after
installed by devstack without climate.
scheduler_available_filters = nova.scheduler.filters.all_filters
scheduler_default_filters = RetryFilter, AvailabilityZoneFilter,
RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter,
ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter

So after installed devstack with climate, nova scheduler filters should
be as following:
scheduler_available_filters = climatenova.scheduler.filters.climate_filter.ClimateFilter
scheduler_available_filters = nova.scheduler.filters.all_filters
scheduler_default_filters = RetryFilter, AvailabilityZoneFilter,
RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter,
ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, ClimateFilter

Change-Id: I74272d3282425baeb96a2862b22a26ab0a35a5df
Closes-Bug: #1316417
2014-05-06 14:08:23 +08:00
cmart 77835b768a Add scenario testing support
Adding infrastructure to support standalone scenario testing
for Climate.

To make it happen, we had to mimic the way that tempest was
handling the scenario tests and since we weren't allow to modify
tempest code, we built a similar hierachy (check manager and scenario
classes and their parents).
As long for the config_resource_reservation file, we added some
params to handle the timeout checks

The test added follow these steps:
    1) Create an instance with the hint parameters
      * start_date: now + 1 minute
      * end_date: start_date + 3 minutes
    2) check vm was shelved
    3) check vm became active
    4) check that a new lease is created on climate
    5) check its param
    6) wait lease end
    7) make sure VM was snapshoted and removed
Test duration: between 3 and 5 minutes

Partially implements: blueprint climate-tempest-testing
Change-Id: I023866ec8f19cfa8fec16c8fb9af4ed014160fe0
2014-04-28 12:29:25 +00:00
Pablo Andres Fuente 542c89c559 Set osapi_compute_extensions default value
The Devstack commit 3317437caca5eb769ab4c6d3ea7c5d3e062517e2 removed
the osapi_compute_extensions configuration option from lib/nova.
This caused that when our Devstack implementation sets this
configuration option, the default value were missed. This default value
is important because is the one that loads all the default Nova
extensions, which causes a lot of HTTP 404 at Nova API.
For this reason, our Devstack implementation was modified in order to
set this default value when this option is not set by any other project.

Change-Id: I04698643ac00b4b52b05f28a6c46522991734fc4
Closes-Bug: #1312368
2014-04-25 11:30:14 -03:00
Pablo Andres Fuente c2bada17ce Added V2 API auth configuration to devstack
Added to Devstack the auth configuration needed by the V2 API.

Change-Id: Ib737416f3f441a6ad65b4a59a1cec10193ad7cbc
Closes-Bug: #1306224
2014-04-21 17:56:06 -03:00
Pablo Andres Fuente 07ae1900af Removed DefaultReservationController from devstack
The configuration that sets the DefaultReservationController as
nova extension in devstack was removed. This configuration made
some tempest test fail because the VMs were not in active state.

Change-Id: I6b12f236db764fd95b2b7a44f4340612cb52d817
Closes-Bug: #1300365
2014-04-21 14:23:41 +00:00
Cristian A Sanchez 6b26ecaf75 Change references of tenant to project
Refernces from tenant to project were made in several
places, including DB, HTTP Headers, configuration items,
json in responses and devstack integration. Additionally,
a migration script using Alembic was included.

Implements: blueprint tenant-to-project-ref
Change-Id: I4b21182f555ccd412a4ca4e0ce753f07edcd07f8
2014-04-17 11:16:09 -03:00
Christian Martinez fc913961c8 Add primary folder structure for Tempest support
Adding folder structure for integration testing with Tempest.
Also, adding cli tests for basic testing functionality

Change-Id: I69896958495ddf57040a05ff73004662b7b28891
Partially implements: blueprint climate-tempest-testing
2014-04-07 12:47:58 -03:00
Pablo Andres Fuente ce13bf6c5d Support for DB migrations using Alembic
Added support for DB migration using Alembic.
Modified devstack/lib/climate to sync the database during the
configuration of Climate.

Added the actual state of the sqlalchemy models in a migration script.
This will be the first version, and will be used by devstack and the
migration tests.

Added a new console_script to the setup.cfg: climate-db-manage. This is
the CLI is used as a wrapper of the alembic functionality.

Added alembic>=0.4.1 as dependecy.

Added some README with documentation about the DB migrations.

Change-Id: I390ccfac1e436db0b04339e60f9f6795b22b8f7e
Implements: blueprint schema-data-migration-with-alembic
2014-03-25 11:11:22 -03:00
Swann Croiset 7d86411dee Devstack : create the freepool used by reservation host plugin
Change-Id: Ib8ddefe5030afc82246c48ec52acec0126a4cf29
2014-03-13 10:23:11 +01:00
Swann Croiset b4e1700e00 Enable verbose logging in devstack
Change-Id: Iac208423d81ea7acb846d68aa7ac6417ed950943
2014-02-28 10:45:15 +01:00
Dina Belova 8a35fdcabd Fix issue with devstack Climate config file
Change-Id: I29bd81800afcdaad47c0917d71b0fda057503bf0
Closes-Bug: #1284675
2014-02-25 21:12:15 +04:00
Sergey Lukjanov 4ceafd0d64 Initial devstack support implemented
* Install climate, climate-nova and climate client
* Sets all needed climate configs, even the nova ones in order to use
climate-nova
* Starts/Stops climate-api and climate-manager
* Creates the Keystone V3 service/endpoint if don't exists.

Change-Id: I7c5014fc61238206ea589b01f3ec0ecac005d846
Implements: blueprint climate-devstack-gating
Co-Authored-By: Pablo Andres Fuente <pablo.a.fuente@intel.com>
2014-02-18 12:38:17 -03:00