Commit Graph

40 Commits

Author SHA1 Message Date
Sahid Orentino Ferdjaoui be0996c308 segment: enable multisegments support for host
This updates the exception with a log message informing that
multi-segments is supported by OVS only at that point.

This also add fullstack tests that validates multisegs deployment on a
physnet.

Closes-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: I3811a4ca28906dd29100c602de7fa4a3595393ab
2022-12-15 16:55:39 +01:00
LIU Yulong f1a082ce50 Fullstack tests of packet rate limit for ovs qos driver
Depends-On: https://review.opendev.org/c/openstack/python-neutronclient/+/818717

Partially-Implements: bp/packet-rate-limit
Related-Bug: #1938966
Related-Bug: #1912460
Change-Id: If2d8f4e89987dcb55fcbef126a02bff4433c6aa8
2022-05-07 13:11:51 +08:00
Oleg Bondarev 0ce584bd9a Add Local IP fullstack test cases
The test:
- creates 3 VMs in the same network on 2 hosts
- creates Local IP and associates first VM's port with it
- pings first VM from the second one (same host) by
  local IP address and checks pings are ok
- pings first VM from the third one (diff host) by
  local IP and verifies local IP is not accessible

Second test does the same but with openvswitch security groups
enabled on hosts and with static NAT rules for Local IPs.

Partial-Bug: #1930200
Change-Id: I27a57170b88eda951ff3ef1d5320cb8c692a074a
2022-01-14 12:41:40 +00:00
LIU Yulong 4b22eea4be Add fullstack test case for OVS DHCP extension
This patch will create two fake VMs to verify the DHCP R/R
for its NIC. Ping 4/6 will be run after the interface request
and config the IP address via DHCPv4/6 by using dhclient.

For fullstack test fake environment, setting enable_traditional_dhcp
to False means enable DHCP extension for OVS agent automatically.

Partially-Implements: bp/distributed-dhcp-for-ml2-ovs
Closes-Bug: #1900934
Change-Id: I40d6464953fbc4d4ca2c05a6051eba43cd05fedd
2021-06-28 17:27:47 +08:00
Rodolfo Alonso Hernandez 303d24ab8a Allow to manually define the gateway IP when using subnet pools
Now is possible to define a gateway IP when creating a subnet using a
subnet pool. The IPAM subnet generator retrieves the available IP
ranges in the subnet pool and generates a list of candidate subnets
with the prefix lenght defined. If the gateway IP can be allocated in
one of those candidate subnets, the IPAM returns a valid IpamSubnet
that will be used to create a Neutron subnet.

Closes-Bug: #1904436

Change-Id: Ib1d1f591c4d0f59ebff3ddcb3be7b10b0b5e67dc
2021-02-27 10:06:35 +00:00
Nurmatov Mamatisa 26f3de0f78 Add minimum bw qos rule validation for network
Minimum bandwidth QoS rule is only applicable for the network which is
backed by physical networks.
It will raise exception when you want to set Minimum bandwidth QoS rule
or update rule on network without ports.

Closes-Bug: #1913180
Change-Id: I6ab945086b13730ad60957760bbc2eb5c321aca2
2021-02-19 11:26:40 +03:00
elajkat c6034bf7f4 New fullstack test for subnet port delete race condition
Segment delete can fail if the subnet related to the segment is deleted.

Related-Bug: #1878632
Depends-On: https://review.opendev.org/727796

Change-Id: I9a656cee769d2ba515d00d2acbd28a3c2f641ff7
2020-12-17 11:54:08 +01:00
Lina He 2a36ea26cc Add fullstack tests for stateless security groups
Blueprint: stateless-security-groups

Change-Id: I0ecb52ef78a2fc264d1d5d29366c56ecf4503bb7
2020-04-06 05:33:49 +00:00
Rodolfo Alonso Hernandez 936bd67aa4 Check "security_group_rule" quota during security group creation
The tracked resources quota check is done at the beginning of an API
call to the Neutron server. The API call contains a resource and an
action over the resource. In case of creation, the server checks if
the number of items requested fits in the existing quota.

In case of security group creation, the tracked resource checked is
"security_group". But "SecurityGroupDbMixin.create_security_group"
method also creates several default rules for the new group and the
quota for "security_group_rule" is not enforced.

This patch checks the number of security group rules being created
("delta") and checks in the plugin method (not in the API method) if
there is enough room for those new rules (tracked resource
"security_group_rule").

Change-Id: I0a9b91b09d6260ff96fdba2f0a455de53bbc1f00
Closes-Bug: #1858680
2020-01-28 12:02:52 +00:00
Rodolfo Alonso Hernandez 0b3cff33c1 Subnet gateway should be a valid IP
When a subnet is created and allocated, the gateway IP is created
based on the subnet CIDR. In case of IPv6 prefix delegation, this
CIDR is a temporary one. In this case the gateway IP cannot be
assigned yet and the value stored in the DB should be "None".

IpamBackendMixin._gateway_ip_str must read properly the IP version
stored in the "subnet" variable, under the key "ip_version"
instead of "version".

Closes-Bug: #1856726
Closes-Bug: #1856675

Change-Id: I9313c880cc458f08dc3a1b0ff13187b764ba7042
2019-12-23 10:13:23 +00:00
Brian Haley 040b550a86 Use admin context when updating router gateway
When a router gateway is updated and the subnet changes,
we need to use the admin context in order for the operation
to succeed.  Since the target network has already been
verified to be external, this is OK. The other operations
in this area such as create and delete already do the
same thing.

Added a fullstack test that moves a gateway between subnets
and verifies it's reachable afterwards.

Change-Id: Iead87ba6182d633f0f808032166e02e767fcffae
Closes-bug: #1812118
2019-10-07 14:47:19 -04:00
LIU Yulong 78629e0d37 Remove L3 IP QoS cache when router is down
When router admin-state is down or removed, fip-qos and gateway-ip-qos
extension should delete the router IPs' QoS rate limit cache. Then if
the router is up again the router floating IPs QoS can be reconfigured.
This patch achives these:
1. make sure floating IP or gateway IP QoS cache removed.
2. floating IP QoS can be re-configured to snat device when router
   doing admin_state down/up.

Closes-Bug: #1826695
Change-Id: I24fcecd9686ad17fa50093bb8bccab0d6c711298
2019-08-16 23:36:27 +08:00
Rodolfo Alonso Hernandez cc8808d539 Add QoS minimum egress bandwidth rule into ovs-agent
Add minimum egress bandwidth support for Open vSwitch.

The scope of this implementation is reduced to N/S traffic.
There is no QoS applied on traffic between VMs.

The QoS rules are aplied to exit ports in bridges other than
br-int; that means all physical bridges. No tunneled traffic
will be shaped. This feature will be implemented in a following
patch.

Partial-Bug: #1560963
Change-Id: I0a2ef52b13151a39e678e9a3e6f75babb47298d0
2019-02-26 11:05:04 +00:00
LIU Yulong 8c17df7138 Notify router_update after directly gateway IP change
If directly change router gateway port IP address, the gateway IP
does not changed in router related namespace in l3 agent side. This
patch adds a method to catch a 'PORT' IP change event, and notify
the L3 agent.

Closes-Bug: #1795222
Change-Id: If276a7613c156f8c826967c9c8cbd6f2a8d32674
2018-11-12 16:13:20 -05:00
Nguyen Phuong An 0649112113 Add fullstack test for logging
Since Queens, the security group logging has been merged. But there
is no fullstack test for this feature. So this patch add fullstack
test to avoid regression as https://review.openstack.org/#/c/587681

Co-Authored-By: Yushiro FURUKAWA <y.furukawa_2@jp.fujitsu.com>
Change-Id: Id9bbedc96e399338ea568556bdb17923392512b4
Partially-implements: blueprint security-group-logging
2018-09-04 16:57:16 +07:00
Zuul f6bcfe1d89 Merge "Fix the tests for filtering with qos_policy_id" 2018-07-11 23:49:22 +00:00
Reedip 006113e3bf Skip MTU check during deletion of Networks
MTU check can be skipped during deletion of Networks.
The MTU check doesn't provide any additional support during deletion
of the networks.

Also, if a network is created with MTU 'X' and the
global_mtu later on is decreased to 'Y', the created
network cannot be deleted due to the MTU check.

Change-Id: Ia838d2a661c5098f90b58b2cb31557f2ebf78868
Closes-Bug: #1713499
2018-06-21 14:25:22 +00:00
Hongbin Lu 6f5946d34b Fix the tests for filtering with qos_policy_id
Some QoS tests tried to list ports by attribute qos_policy_id
but this attribute is not a valid filter. In before, the tests
passed because neutron ignored the invalid filter and returned
all the ports which happened to be the correct set. However,
using qos_policy_id as filter is incorrect and this patch fixes it.

Change-Id: Ic3ab5b3ffdc378d570678b9c967cb42b0c7a8a9b
Related-Bug: #1749820
2018-06-15 21:48:06 +00:00
OmarM ce01b70ef8 [OVS] Shut down the port on changing the admin-state to false
On changing the port-admin-state to false, the port goes down.

Change-Id: Ica46e39d8858f4235a8a1b9caeb696346a86f38b
Closes-bug: #1672629
2018-01-04 01:44:01 -05:00
Ihar Hrachyshka cc69828ff0 Apply network MTU changes to l3 ports
This patch makes L3 agent to update its ports' MTU when it's changed on
core plugin side.

Related-Bug: #1671634
Change-Id: I4444da6358e8b8420a3a365e1107b02f5bb1161d
2017-08-11 11:10:10 -04:00
Akihiro Motoki f64110f652 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file exists
and causes hacking rule unit tests.

Change-Id: Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d
2017-07-05 03:15:27 +00:00
Sławek Kapłoński 2d0d1a2d76 Add support for ingress bandwidth limit rules in ovs agent
Add support for QoS ingress bandwidth limiting in
openvswitch agent.
It uses default ovs QoS policies on bandwidth limiting
mechanism.

DocImpact: Ingress bandwidth limit in QoS supported by
           Openvswitch agent

Change-Id: I9d94e27db5d574b61061689dc99f12f095625ca0
Partial-Bug: #1560961
2017-06-14 11:11:43 +00:00
Rodolfo Alonso Hernandez 9d69822e43 Add "default" behaviour to QoS policies
This patch implements the "default" behaviour for QoS policies.
If this flag is enabled for a QoS policy in a project, all
new networks created will have this QoS policy assigned by default.

If a new QoS policy is created or updated with this flag and another
QoS policy in the same project is set as the default policy, the new
one won't be created or updated. To set another QoS policy as default,
the current one must be unset.

DocImpact: A "default" flag is introduced for QoS policies. If this flag
           is enabled in a QoS policy (attached to a project), then all
           networks created in this project would have this QoS policy
           assigned, unless an explicit policy is specified.
APIImpact

Closes-Bug: #1639220
Change-Id: If5ff2b00fa828f93aa089e275ddbd1ff542b79d4
2017-05-26 23:31:36 +00:00
Boden R 7bd521e7ce use neutron_lib's portbindings api-def
Neutron-lib 1.1.0 is now out and contains the portbindings
API definition (as per commit [1]). This patch moves neutron
references over to the neutron-lib version.

NeutronLibImpact
- Consumers using the public constants within neutron's
portbindings API extension must now use the values
from neutron-lib.

[1] 87e42f993c07ae320159d5123662ee9f3bd4d903

Change-Id: I669af9b4c712877772d91a03857ab108714001d4
2017-03-31 09:16:22 -06:00
Hynek Mlnarik 27aee4a9c5 Connectivity tests for OVS agent failures/restarts
Adding two tests:

* A test that for native ovs-ofctl interface verifies that stopping the
  ovs-neutron-agent does not disrupt network traffic. Stopping the agent
  means also stopping the OVS bridge controller, hence OVS can decide to
  take over management of OpenFlow rules, clear them up, and this way
  cause network traffic disruption.

* A test that creates two ports in a single network, then starts
  pinging one from the other while restarting OVS agents. The test verifies
  that no packet is lost during OVS agent restarts.

Change-Id: I2cd1195fc0622c8c8d614f00e9dd6884ad388d69
Related-Bug: 1514056
Related-Bug: 1607787
2017-01-24 11:19:27 -05:00
IWAMOTO Toshihiro ff9c6e219b fullstack: Add security group tests
Change-Id: Ie1fbc3c253805120f44692e3459a64537b7ae340
2016-10-13 07:01:21 +00:00
Jakub Libosvar f0439a04ad fullstack: VLAN aware VMs test
Patch tests basic life-cycle of a trunk associated with a port. Test
creates a trunk with one subport - this tests interaction between
agent and ovsdb handler that calls via RPC to server.
Later a new subport is added which tests RPC interaction between
server and agent. Then deletes the first created subport. Finally trunk
is removed and checked that no patch ports remain on the integration
bridge.

Future work:
 - Run this test with linuxbridge
 - Test re-using port associated with trunk.
 - Test re-using subports.
 - Test with OVS firewall.

Partially-implements: blueprint vlan-aware-vms
Change-Id: Ie79a010e6751c1f1c2be5b1bf52511b9e100ad20
2016-09-29 13:23:39 -04:00
Ihar Hrachyshka 31e1aeb66b Forbid importing neutron.tests.* from outside tests subtree
neutron-sanity-check tool was importing neutron.tests.base module, which
may be not present on some systems (f.e. RDO splits neutron/tests/
subtree in a separate python-neutron-tests package). It made the tool
not usable in some setups.

https://bugzilla.redhat.com/show_bug.cgi?id=1374282

This is not the first time when we by mistake import from
neutron.tests.* and break distributions. It's time to stop it by
proactively forbidding that pattern via a new hacking check.

Some functions were moved from neutron.tests.base to
neutron.common.utils to fulfill the need requirement. They were moved
using debtcollector, no current consumers should be affected.

Closes-Bug: #1621782
Change-Id: I790777ddcbd1b02218b3db54ae3d5c931d72d4fa
2016-09-15 18:42:45 +00:00
Jenkins 77e03443ff Merge "QoS DSCP fullstack tests" 2016-06-15 16:14:57 +00:00
Nate Johnston 73546f8503 QoS DSCP fullstack tests
This patch introduces fullstack testing for the QoS/DSCP
Open vSwitch implementation. It depends on the python-neutronclient
patches, therefore it could not be merged in the main patch.

Co-Authored-By: Miguel Angel Ajo <majopela@redhat.com>
Change-Id: I0ab6a1a0d1430c5791fea1d5b54106c6cc93b937
Closes-Bug: #1468353
Depends-On: I25ad60c1b9a66e568276a772b8c496987d9f8299
2016-06-08 12:50:53 +00:00
sridhargaddam 45d363241d fullstack: test for IPv6 east-west traffic
This patch validates east west IPv6 traffic through legacy router.

Partial-Bug: #1583028
Change-Id: Id18065340d49dfd389d88cc625f5a80be8da9a50
2016-05-27 17:17:04 +00:00
venkata anil b73f849f89 fullstack: test for snat and floatingip
Fullstack test to test snat and floatingip through legacy router.
This test creates external network and boots a vm with external
network's gateway and connected to central-external-br.
Tenant vm is booted on internal network.
Tenant Router is connected to internal and external networks.

To test SNAT, it pings external vm from tenant vm.
To test floatingip, a new floatingip is assigned to tenant vm
and tests pinging to tenant vm's floatingip from external vm.

Partial-Bug: #1583028
Change-Id: I1f30c240419ec93a26368ed1623bb2ede595e3d1
2016-05-20 13:25:59 +00:00
venkata anil 936fe6c9af fullstack: test for east west traffic
Fullstack test to test east west traffic through
legacy router.

Partial-Bug: #1583028
Change-Id: I3bfdd6cfafd5d4d1aa6a310efc9c8a8cb817ac46
2016-05-19 22:02:08 +00:00
Gary Kotton 19de679e8a Use the constant HOST_ID instead of 'binding:host_id'
This patch makes use of the constant defined in the extension.
In addition to this having value of debing defined in one place it
also enables the caller to understand that the portbindings
extension is required.

Note: the constant is not used in the API tests. This has import
issues so it is not relevant.

TrivialFix

Change-Id: I7bfe2528dbbd8017ddbdcf949dbb6264ce1eb5d8
2015-12-20 14:00:29 +00:00
Jakub Libosvar 1b94f3f3d9 Add QoS fullstack test
Test the qos policy and rule CRUD lifecycle with port. Future plans are
to add similar testing with ports belonging to network with set qos
policy.

Change-Id: Iebe9b3e9d612d3533381a8cf4d0b9c587f8fda42
2015-09-15 15:42:26 +00:00
Jenkins bbf213a87d Merge "fullstack: Skip NotFound in safe_client cleanup" 2015-08-21 01:39:21 +00:00
Assaf Muller 53fe9ddd6c Add a fullstack fake VM, basic connectivity test
* Full stack tests' fake VMs are represented via a namespace,
  MAC, IP address and default gateway. They're plugged to an OVS
  bridge via an OVS internal port. As opposed to the current
  fake machine class used in functional testing, this new fake
  machine also creates a Neutron port via the API and sets the
  IP and MAC according to it. It also sets additional attributes
  on the OVS port to allow the OVS agent to do its magic.
* The functional fake machine and the full stack fake machine
  should continue to share commonalities.
* The fullstack fake machine currently takes the IP address
  from the port and statically assigns it to the namespace
  device. Later when I'll add support for the DHCP agent
  in full stack testing this assignment will look for the dhcp
  attribute of the subnet and either assign the IP address
  via 'ip' or call a dhcp client.
* Added a basic L2 connectivity test between two such machines
  on the same Neutron network.
* OVSPortFixture now uses OVSInterfaceDriver to plug the port
  instead of replicate a lot of the code. I had to make a
  small change to _setup_arp_spoof_for_port since all OVS ports
  are now created with their external-ids set.

Change-Id: Ib985b7e742f58f1a6eb6fc598df3cbac31046951
2015-08-19 20:09:55 +03:00
Jakub Libosvar a84216b1e0 fullstack: Skip NotFound in safe_client cleanup
If we explicitly remove resource in the test we don't need to fail in
safe_client during cleanup phase.

Change-Id: Ia3b0756b7aa9b159de1949889ae03ca5248bc5fa
Closes-Bug: 1486081
2015-08-19 09:18:03 +00:00
Assaf Muller 0de917e09b Enable fullstack multinode tests, add L3 HA test exemplar
* Created a 'resources' subdir and moved all fixture files
  to it.
* Split ML2ConfigFixture to the server-side ml2 configuration
  fixture, and the OVS agent configuration fixture.
* Neutron process logs were using H:M:S format as their file name,
  but when starting multiple agents of the same type my machine
  was fast enough to do that in the same second so that different
  processes were outputting to the same log file. No good!
  Added ms to the log name format. I also changed the log time
  from UTC to local timezone.
* Renamed and moved 'FullstackFixture' to neutron/tests/fullstack/
  resources/environment.Environment
* Added a 'Host' abstraction that groups agents that report with
  the same 'host' value. Hosts may be interconnected by the
  environment via shared bridges.
* The 'Environment' class will accept global
  attributes (This will be later filled with stuff like tunneling,
  l2pop or other environment-level flags), and in this patch accepts
  a  list of host attributes (Configuration that may differ between
  hosts like the l3 agent mode [legacy, dvr, dvr_snat]).
* Made OVS agent and L3 agent fixtures expose their bridges
  so that I could interconnect them.
* Added a super simple L3 HA test to show that this entire thing
  works.

Change-Id: Ie64de9f35bd6ab7cbad494061613ecf5e0ccd806
2015-08-05 15:47:28 +00:00
Cedric Brandily 25baeccac9 Define fullstack router/network/subnet management fixture
This change defines the generic fixture ClientFixture for managing
neutron resources:

* router create/cleanup
* network create/cleanup
* subnet create/cleanup
* router interface add/cleanup

And uses it in neutron.test.fullstack.test_l3_agent.

Change-Id: I09fe40d65db60aeee1ff57a7e45c1978a5433517
2015-07-21 23:33:19 +02:00