Instead of having a separate function for id-based search, make
get_object accept any kwargs, including id=, and reuse it everywhere
where we used _find_object before.
John Schwarz [Tue, 30 Jun 2015 14:57:19 +0000 (17:57 +0300)]
Base infrastructure for QoS API tests
This introduces the basic methods in the tempest client, that allow the
testing of the QoS plugin. This also contains 2 (very) simple tests
which test creation and deletion of both policies and bandwidth rules,
as well as list/show for both resources. While creation is done
explicitly, deletion is done implicitly (all resources are deleted after
the test, during tearDown)
Minor fixes to the QoS plugin are included as well.
We don't use callbacks to extend resources anymore, instead relying on
ml2 extension drivers. No need for the patch to achieve QoS, and it also
breaks test_delete_subnet_with_callback that was added in master
recently.
===
3. updated requirements.txt and test-requirements.txt based on:
https://review.openstack.org/#/c/204398/
to avoid requirements gate checks failing due to incompatible
requirements comparing to global-requirements.txt
There may be projects that have not being created yet, so revise
the wording a bit to provide clarity that new projects can also
submit for inclusion right off the bat.
There is nothing Linux or agent specific in the function. I need to use
it outside agent code in one of depending patches, hence moving it into
better location while leaving the previous symbol in place, with
deprecation warning, for backwards compatibility.
Louis Taylor [Mon, 20 Jul 2015 17:20:29 +0000 (17:20 +0000)]
Port help text for dvr_base_mac from neutron.conf
The help text for the option in the current static configuration file
contained additional information which would be lost when we switch to
generating the file. This patch copies it over to the oslo.config help
parameter.
Following test cases are added:
Common scenarios:
1. No routers scheduled if no agents are present
2. No routers scheduled if it is already hosted
3. No routers scheduled if all agents are down
4. Router scheduled to the agent if router is not yet hosted
5. Router scheduled to the agent even if it already hosts a router
Following scenario specific to least routers scheduler is added:
1. Router is scheduled to agent hosting least routers
For each of Chance and Least Router schedulers auto scheduling is also verified.
Cedric Brandily [Fri, 8 May 2015 21:28:37 +0000 (23:28 +0200)]
Always use BridgeDevice to manage linuxbridges
BridgeDevice[1] class provides methods to manage linuxbridges through
brctl. This change adds some methods to BridgeDevice in order to
always use BridgeDevice to manage linuxbridges and respect DRY
principle.
Mike Kolesnik [Wed, 15 Jul 2015 07:44:15 +0000 (10:44 +0300)]
Handle qos_policy on network/port create/update
Added handling for qos_policy_id field in the network and port
entities via ML2 extension driver.
The QoS profile will be associated to the network/port when requested as
part of the entity creation or update.
Allow ML2 extension manager to not register for any api extension
(new use case).
===
Extend the resources using the QoS extension class
Since the QoS extension for plugins is handles by this class, it makes
sense for it to handle also property extension of resources.
For ML2 this means that that extend_{network,port}_dict functions will
handle the extension of resources by calling QosExtensionHandler.
This logic can easily be reused by other plugins.
Note: we should make sure that resource extension does not require db
access, otherwise we see DBDeadLock errors and random tempest failures.
To achieve this, we define a new SQLAlchemy joined relationship on
policy bindings to make networks and ports receive those bindings on
their fetch from database. After that, the only work to do left for
resource extension handler is to copy the fetched policy into resource
dictionary.
===
Also enable new qos ml2 extension until we configure it in gate via
project-config and devstack-gate to make sure it's enabled and tested.
Carl Baldwin [Tue, 14 Jul 2015 19:00:45 +0000 (19:00 +0000)]
Use only the lower 16 bits of iptables mark for marking
Since a packet can only have one mark, and we will need to mark a
packet for multiple purposes, we need to use a coordinated bitmask for
the two cases of simple marking that we currently do in Neutron
leaving the other bits for address scopes.
Mike Bayer [Fri, 17 Jul 2015 17:19:57 +0000 (13:19 -0400)]
Add address_scope_db to neutron/models/head.py
The head.py file ensures that all relevant models are
imported when ModelsMigrationSync tests are run in
neutron/tests/functional/db/test_migrations. This is
one of the models that needs to be present else the
"address_scopes" table comes out as missing. The
error is usually concealed by the fact that the module
was imported as a side effect of other tests but
is revealed if one runs test_migrations.py alone.
In Python 3:
>>> None > 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unorderable types: NoneType() > int()
This commit does not change the behaviour of the affected code, but fixes the
TypeError that is raised in Python 3.
Some tests have been added to the py34 section of tox.ini, but are currently
commented out: these are tests that work with this patch and a fixed version of
Routes.
shihanzhang [Tue, 30 Jun 2015 02:14:19 +0000 (10:14 +0800)]
Unplug the VIF if dhcp port is deleted
if user delete the dhcp port, dhcp-agent should unplug
the VIF for this dhcp port, then the driver do
'reload_allocations' will raise a exception, dhcp-agent
resync for this network and re-create dhcp port.
Kevin Benton [Fri, 17 Jul 2015 01:45:30 +0000 (18:45 -0700)]
Alter unit test to match bug and cleanup ext logic
The unit test for bug #1443342 was only testing that a side effect
leading to the bug didn't occur (comparing object identities). This
patch updates the unit test to fully assert that the bug itself
doesn't occur without checking implementation details.
This also eliminates the branching that led to the original issue by
using setdefault to always return a dict to update.
Carl Baldwin [Mon, 13 Jul 2015 18:44:38 +0000 (18:44 +0000)]
Make external_gateway_nat_rules easier to understand
Future patches will change these snat rules for address scopes. I
found it much easier to understand the changes needed after formatting
these like this.
Carl Baldwin [Thu, 9 Jul 2015 19:19:00 +0000 (19:19 +0000)]
Remove perform_snat_action indirection
This indirection seems complicated to me. I don't know the history
behind it but it made some of the address scope work more difficult
than I think it needs to be.
This patch introduces API and DB plugin for flavor framework.
API adds Flavors and Service Profiles which are resources
available only for admins to operate.
This framework then should be leveraged by advanced services.
Yusuke Ide [Sat, 4 Jul 2015 06:38:58 +0000 (15:38 +0900)]
Add breakages in public API of devref
In wiki it is intended to keep track of neutron changes that may affect
external plugins and drivers. The information should be kept in a living
document in the devref area of the neutron code tree.
objects.qos.policy: support per type rule lists as synthetic fields
This is a significant piece of work.
It enables neutron objects to define fields that are lazily loaded on
field access. To achieve that,
- field should be mentioned in cls.synthetic_fields
- obj_load_attr should be extended to lazily fetch and cache the field
Based on this work, we define per type rule fields that are lists of
appropriate neutron objects. (At the moment, we have only single type
supported, but I tried hard to make it easily extendable, with little or
no coding needed when a new rule type object definition is added to
rule.py: for example, we inspect object definitions based on
VALID_RULE_TYPES, and define appropriate fields for the policy object).
To implement lazy loading for those fields, I redefined get_by_id for
rules that now meld fields from both base and subtype db models into the
corresponding neutron object.
Added a simple test that checks bandwidth_rules attribute behaves for
policies.
Some objects unit test framework rework was needed to accomodate
synthetic fields that are not propagated to db layer.
Kevin Benton [Mon, 15 Jun 2015 09:18:36 +0000 (02:18 -0700)]
Network RBAC DB setup and legacy migration
This patch implements the database model required for the network
RBAC work. In addition it migrates the current network and subnet
'shared' attributes to leverage the new table.
'shared' is no longer a property of the DB model because its status
is based on the tenant ID of the API caller. From an API perspective
this is the same (tenants will see networks as 'shared=True' if the
network is shared with them). However, internal callers (e.g. plugins,
drivers, services) will not be able to check for the 'shared' attribute
on network and subnet db objects any more.
This patch just achieves parity with the current shared behavior so it
doesn't add the ability to manipulate the RBAC entries directly. The
RBAC API is in the following patch.
Kevin Benton [Thu, 16 Jul 2015 09:07:48 +0000 (02:07 -0700)]
Add oslo db retry decorator to non-CRUD actions
The previously added decorators to the create and update handlers
in the API layer only applied to actions that followed the standard
create/update path. However, for API operations like add_router_interface,
a different path is followed that wasn't covered by a retry decorator.
This patch adds the decorator to handle deadlocks in those operations as
well.
Miguel Angel Ajo [Tue, 14 Jul 2015 12:31:55 +0000 (14:31 +0200)]
QoS Service devref
This is initial version that should be ready for merge. After we get it
in the tree, we'll be able to expand on demand or even as part of
patches that change the implementation in significant way.
Kevin Benton [Thu, 16 Jul 2015 09:07:48 +0000 (02:07 -0700)]
Add oslo db retry decorator to non-CRUD actions
The previously added decorators to the create and update handlers
in the API layer only applied to actions that followed the standard
create/update path. However, for API operations like add_router_interface,
a different path is followed that wasn't covered by a retry decorator.
This patch adds the decorator to handle deadlocks in those operations as
well.
Jakub Libosvar [Thu, 16 Jul 2015 08:45:22 +0000 (10:45 +0200)]
Change prefix for namespace fixture
With fullstack in game namespace fixtures are not used only in
functional tests. This patch changes prefix to be "test-" instead of
"func-" to describe better its purpose.