Commit Graph

730 Commits

Author SHA1 Message Date
Slawek Kaplonski 17e95518ea Remove executable from python files which don't really needs it
Additionally fix length of the line in api/base.py file to fit 79 line
chars limit.

TrivialFix

Change-Id: I37253f28cbbddf58740d7f75cad6ee7cc9be8954
2024-05-02 14:12:31 +02:00
Frode Nordahl 395e6fa290
Add Active Active L3 GW API test cases
Depends-On: I34e2453ab206c13c3ca40c4181970c320bdd8e67
Change-Id: I8ee8d40d5fa0dbb1c3bbfd4bac7d38e4b108a58b
2024-03-26 10:15:15 +01:00
Zuul 7e3ba069dc Merge "Add extension "subnet-external-network"" 2024-03-25 16:49:23 +00:00
Zuul 0c9c484e87 Merge "Check device_owner with actual availability zone" 2024-03-25 12:39:10 +00:00
Slawek Kaplonski ad4ddcbaa1 [Stateless SG] Add test for port security and stateless SGs
This patch modifies exisitng port_security_removed_added to be run
for both stateful and stateless SGs.

Change-Id: Idb49963618c45dbe5976e32d5db466f35ed534c8
2024-03-14 11:15:59 +01:00
Rodolfo Alonso Hernandez 0da38af84c Add extension "subnet-external-network"
Added extension "subnet-external-network" to:
* neutron-tempest-plugin-base
* neutron-tempest-plugin-openvswitch
* neutron-tempest-plugin-openvswitch-iptables_hybrid

The ``SubnetsSearchCriteriaTest.test_list_validation_filters`` test
case now filters the subnets by 'shared' and 'router:external' fields,
same as the network test case. It should behave the same with this
new extension.

Related-Bug: #2051831
Change-Id: I13144e3d722c06c918cd47860f378bf4bdaa0bf7
2024-03-08 01:26:41 +00:00
Slawek Kaplonski ec162e0f56 Remove usage of testscenarios and replace it with ddt library
As our internal QE reported to us, ddt is producing more consistent
names of the same tests with different variables then testscenarios.
With testscenarios it is something like:

foo_tempest_plugin.tests.something.SomeClass.test_foo[id-123456](c1,c2)

and with ddt is more similar to tests without scenarios:

foo_tempest_plugin.tests.something.SomeClass.test_foo_1[id-123456]

Apparently due to this inconsistency results of some tests couldn't be
properly reported properly to some tools which we are using downstream.

So this patch proposes to remove usage of testscenarios in
neutron_tempest_plugin and replace it with ddt where it is needed.
Actually ddt was already used in some of the tests here so this will
make it also more consistent across the tests in that repo.

Also as part of this effort I relalised that in some cases testscenarios
where used, tests were running e.g. 2 times but actually variable set to
different value in different scenarios were not used at all. So in such
case I simply dropped usage of testscenarios and left only one variant
of the test to be run.

Change-Id: Ieabab4ccaa0e2a365939425dff0c0776839251eb
2024-03-06 14:27:39 +01:00
Zuul 468deaf6fb Merge "[OVN] Do not check L3 agents state with ML2/OVN" 2024-03-06 09:43:06 +00:00
Zuul 20549ceb92 Merge "Makes "segmentation_id" configurable" 2024-03-05 12:12:47 +00:00
Rodolfo Alonso Hernandez 9286588fc0 [OVN] Do not check L3 agents state with ML2/OVN
With [1], the ML2/OVN L3 plugin will have the "ha" API extension
enabled. The OVN L3 plugin does not have L3 agents; this check
should be skipped.

[1]https://review.opendev.org/c/openstack/neutron/+/910889

Related-Bug: #2020823
Change-Id: I09c12ba36b007d4f6fdd3723974ecfe9e4466b72
2024-03-04 20:33:33 +00:00
Roman Safronov 4d6ae07f5e Check device_owner with actual availability zone
test_floatingip_port_details was checking device_owner port field
against a hard-coded default value of 'compute:nova'. This was
causing a MismatchError in case custom availability zones were
configured on openstack environment.

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

Change-Id: Ibdb8bf6f90818c74f1198cd89d24778c74739f50
2024-02-21 17:57:45 +00:00
Zuul 9c55bfc364 Merge "Add router check, subnet attached gateway IP update or deletion" 2024-02-20 14:35:53 +00:00
Maor Blaustein fc274a0d18 Skip HA router tests when not meant for OVN driver
Change is needed to check "l3-ha" extension with OVN router flavors.
This change allows to check if OVN backend or not, and add test skips
accordingly.

The tests used to run only against OVS driver, a subset of them was
found useful also with OVN, for instance this bug noticed by altered
tests:
https://bugzilla.redhat.com/show_bug.cgi?id=2263225

Change-Id: I7c2c2f23417b3b43a2788b3c4bca2f8b532b7974
2024-02-19 13:21:08 +02:00
Rodolfo Alonso Hernandez 780d81ec00 Add router check, subnet attached gateway IP update or deletion
Added a new test to ``RoutersTest``. If a subnet has a router
interface, the subnet gateway IP cannot be modified or deleted.
Both operations will raise a ``GatewayIpInUse`` exception.

Depends-On: https://review.opendev.org/c/openstack/neutron/+/904713

Related-Bug: #2036423
Change-Id: I46a39c53017589e23e03ceabc45c2f144ca2f3bb
2024-02-09 12:41:01 +00:00
Takashi Kajinami 815b0d26b4 Replace usage of deprecated path for test decorators
These decorators were moved to the common module in tempest 17.0.0[1].

[1] cd36841ca25b39b9c8ad1b83e0abd0a191d538a0

Change-Id: Ic7a8ac8e98f4b56b2ae2b76071c6dc64c0f34066
2024-02-09 06:19:24 +00:00
Martin Kopec 71a7324508 Fix network sorting in API tests
There is a mismatch in some tests because sorted() sorts in ASCII
order - digits are followed by uppercase characters and then
lowercase characters. That doesn't work if a network's name starts
with a capital letter.

Closes-Bug: #2049211
Change-Id: I8328d7d8ca7b49b99feb24d77525abdc064aae80
2024-01-17 12:09:50 +01:00
ccamposr 873b7152f0 Remove duplicate setup in NetworksIpAvailabilityIPv6Test class
Change-Id: I2a51ba6999d853e526686292ccc110a4afe14f18
2023-12-19 10:40:10 +01:00
Zuul 14f44a0c29 Merge "Add API test for normalized CIDR attribute in the SG rule" 2023-12-12 20:26:33 +00:00
Slawek Kaplonski 63396f05fd Add API test for normalized CIDR attribute in the SG rule
This patch adds test which replaces fullstack test:
neutron.tests.fullstack.test_securitygroup.SecurityGroupRulesTest.test_normalized_cidr_in_rule

It is simple API test which can be done quickly in
neutron-tempest-plugin job. In fullstack instead it requires to prepare
whole environment with neutron-server, fake compute
node, agents, etc. so it takes much more time.

Change-Id: I4124f7f0a2edfe28c95693280b6490c8884fce11
2023-12-12 17:05:27 +01:00
Zuul 61cba1e24b Merge "Add test_port_shut_down API test" 2023-12-12 01:05:37 +00:00
Zuul eb109725f0 Merge "Test job for VPNaaS on OVN" 2023-12-07 10:16:02 +00:00
Slawek Kaplonski eec234d703 Add test_port_shut_down API test
This patch adds test which replaces fullstack test:
neutron.tests.fullstack.test_port_shut_down.PortShutDownTest

It is simple API test which can be done quickly in
neutron-tempest-plugin job. In fullstack instead it requires to prepare
whole environment with neutron-server, fake compute node, agents, etc.
so it takes much more time.

Change-Id: Ica5e72ab6d4c20fdcbd1f0dd38e6adcf627bcefd
2023-12-05 13:04:02 +01:00
Zuul 87f43c3c32 Merge "Remove test duplication between tempest and ntp NetworksTestDHCPv6" 2023-11-22 16:15:06 +00:00
Zuul 3d6f2976bf Merge "Remove test duplication between tempest and n-t-p RoutersDVRTest" 2023-11-22 13:46:40 +00:00
Zuul f6a47e8f7a Merge "Remove test duplications between tempest and n-t-p plugin" 2023-11-22 12:19:32 +00:00
Zuul c4802160f8 Merge "[Default SG rules] Test to check if SG rules are created from template" 2023-11-17 12:57:20 +00:00
Zuul ba65bbd6ea Merge "New basic API tests for the default SG rules templates CRUDs" 2023-11-17 11:05:48 +00:00
Slawek Kaplonski a1f654aa71 [Default SG rules] Test to check if SG rules are created from template
This patch adds new test which checks if SG rules actually created
automatically for new default and non-default SG are matching template
rules from neutron DB.

Depends-On: https://review.opendev.org/c/openstack/neutron/+/884474

Related-bug: #1983053
Change-Id: Ica0810413bef7f0e3e6dff21f6c9e4cda1945a43
2023-11-17 08:37:02 +00:00
Zuul a9b54e26a8 Merge "Fix importing security group tests" 2023-11-16 17:23:31 +00:00
Roman Safronov 052808c2e6 Fix importing security group tests
Importing StatelessSecGroupDualStackDHCPv6StatelessTest was causing
a type error in case CONF.neutron_plugin_options.firewall_driver
was set to 'openvswitch' [1]. This patch fixes the issue by
separation code to a class with base functions, that is never skipped
and classes with tests that optionally can be skipped.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2249407

Change-Id: I90b9cf495f35aca7a9171dc685696ae4cdd4d0f2
2023-11-15 15:53:04 +02:00
Elod Illes f2e985e8fd Add test documentation for docs tox target
Enable sphinx to generate documentation from docstrings by running
'tox -e docs'.

Change-Id: I5996e5f07493f69f14172b4bb0535852e89d5456
2023-11-08 15:52:37 +01:00
jskunda bc84489e49 Remove test duplication between tempest and ntp NetworksTestDHCPv6
NetworksTestDHCPv6 [1] has better
functionality in tempest than in neutron-tempest-plugin, so with
removing these tests from neutron-tempest-plugin we can get rid
of whole module, reducing the test duplications.

[1]cc0e9b1817/tempest/api/network/test_dhcp_ipv6.py (L31)

Change-Id: I080b83965acd69c3d1b4693527c1be0b730e80a6
2023-11-08 11:23:34 +00:00
Arkady Shtempler 88d1d5752a Makes "segmentation_id" configurable
We should add the segmentation_id as tempest option,
so that it can be changed to match the deployment if needed.

Change-Id: I42bea9217462226e8650e55997449e1cc05f085c
2023-11-01 13:06:05 +02:00
Bodo Petermann af70af3e07 Test job for VPNaaS on OVN
Add a new test job to test VPNaaS on OVN, that will be picked up
by the proposed patch [1] in neutron-vpnaas.
Since VPNaaS for OVN doesn't support IPv6 VMs, skip 6in4 and 6in6 tests.

[1] https://review.opendev.org/c/openstack/neutron-vpnaas/+/765353

Related-Bug: #1905391
Change-Id: I9e9e8e78fd22b5edbc794ec68dbe40302ed0f3fd
2023-10-26 12:09:59 +02:00
Slawek Kaplonski aa22c9e1bb New basic API tests for the default SG rules templates CRUDs
This patch adds some basic API tests for the new API for default SG
rules templates. Those new tests are checking if by default SG rules are
set in the same way as legacy rules which were there since "forever".
Second test checks basic lifecycle of the SG rule template.

Depends-On: https://review.opendev.org/c/openstack/neutron/+/883246/

Related-Bug: #1983053
Change-Id: I458f54ff6b73e277fe9506e90fa6af44d9c51101
2023-10-06 06:00:57 +00:00
jskunda 99c85da787 Remove test duplications between tempest and n-t-p plugin
ExtraDHCPOptionsIpV6TestJSON and ExtraDHCPOptionsTestJSON -
https://opendev.org/openstack/tempest/src/branch/master/tempest/\
api/network/test_dhcp_ipv6.py has same functionality in tempest
and neutron-tempest-plugin, so with removing these tests from
neutron-tempest-plugin we can get rid of whole module, reducing
the test duplications.

Change-Id: I111eeba5c29cd7d703e6663be12e8e7e7659919e
2023-09-25 15:41:26 +02:00
jskunda d8ed3fb42a Remove test duplication between tempest and n-t-p RoutersDVRTest
RoutersDVRTest -https://opendev.org/openstack/tempest/src/branch\
/master/tempest/api/network/admin/test_routers_dvr.py has same
functionality in tempest and neutron-tempest-plugin, so with
removing these tests from tempest we can get rid of whole module,
reducing the test duplications.

Change-Id: Ie7d37def794a3cbdb2444ebbeba237fd58ddfb8a
2023-09-21 16:05:27 +02:00
Rodolfo Alonso Hernandez 370f71e987 Mark "test_subport_connectivity_soft_reboot" as unstable
This issue is related to:
* https://bugs.launchpad.net/neutron/+bug/2033887: the patches
  previously merged in the Neutron repository [1][2] should be
  reverted.
* https://bugs.launchpad.net/neutron/+bug/2024160: this issue
  is still present.

[1]https://review.opendev.org/c/openstack/neutron/+/882581
[2]https://review.opendev.org/c/openstack/neutron/+/888776

Change-Id: I9d8d76810d15913c29610464ab1b8fa34863aaf6
Related-Bug: #2024160
Related-Bug: #2033887
2023-09-09 21:36:37 +00:00
Fiorella Yanac 7aa02077ac Add username in resource_setup
There is a condition when rhel is used as default image
in tempest, so default_image_is_advanced set as true
and validation.image_ssh_user is set but
advanced_image_ssh_user is not set.
test_fragmented_traffic_is_accepted was failing
because advanced_image_ssh_user was empty.

Change-Id: I7fa5b167ba27cc78e017765eca927a1dfb24825e
2023-09-07 13:32:00 +01:00
Slawek Kaplonski c1793ca2e8 Skip stateless SG dualstack tests when openvswitch fw driver is used
Openvswitch firewall driver does not support stateless SG so tests from
classes:
StatelessSecGroupDualStackDHCPv6StatelessTest
StatelessSecGroupDualStackSlaacTest

from the module neutron_tempest_plugin.scenario.test_security_groups
should be skipped in such case.

Closes-bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227138
Change-Id: Ice0f3573dd51851752c745c0b1d35c82bd7808fd
2023-08-02 16:55:10 +02:00
Zuul 9cf35d26c8 Merge "Using "Designate API" in addition to DNS query client check" 2023-07-19 20:07:12 +00:00
Arkady Shtempler d5acee3804 Using "Designate API" in addition to DNS query client check
As of now the only validation done in Neutron&Designate E2E scenario
test cases is based on DNS query client only.
As a result, we don't really know what's happens on the Designate side,
for example, we wouldn't expect to see the recordset on Backend if it
wasn't previously created on the Designate.
This patch improves the situation and it will definitely help on debugging.
It will use "Designate APIs" when "query client" throws an assertion.
For example, if "A" type recordset wasn't detected on backend (as expected
by test), "Designate APIs" will be used to provide more details on failure.

Change-Id: Ie2093e457e0b664f36204d61f3020ef84ef15a3e
2023-07-17 17:45:31 +03:00
Zuul 21874c703f Merge "Add "-d 1" option to the ncat client." 2023-07-05 10:30:20 +00:00
Slawek Kaplonski fddcd186a4 Add "-d 1" option to the ncat client.
In nc run as client, when it is provided by the nmap (nmap-ncat package
in Centos/RHEL for example) it could happend that client which was
started with input string given through pipe (echo "test" | nc ... ) was
closed sooner than it received response from the nc server. In such case
nc client was finished without error (exit code 0) but also without
printing any message from server and that causes tests failures.

To avoid that there is option "-d 1" (--delay) added. According to the
nc man page [1] this option can be used to configure "Wait between
read/writes".

[1] https://man7.org/linux/man-pages/man1/ncat.1.html

Change-Id: Id49654aa5ca59eeb0585646d3fd5aa0de22337b5
2023-07-04 12:15:56 +02:00
Zuul 75ce4eb4ad Merge "[Stateless SG] Add IPv6 and DHCP related tests" 2023-06-29 21:56:48 +00:00
Takashi Kajinami da45177a2f Replace deprecated tenant_id property
The tenant_id property of RestClient in tempest was deprecated in
25.0.0. This replaces the deprecated property by the new project_id
property to avoid the following warning.

WARNING tempest.lib.common.rest_client [-] Deprecated: "tenant_id"
property is deprecated for removal, use "project_id" instead

Depends-on: https://review.opendev.org/c/openstack/tempest/+/707938
Change-Id: Ie3c32f9f2278b78603a4214c5717df8691ba490a
2023-06-19 08:09:20 +09:00
Zuul 6e4d04071b Merge "Always run iptables-save as root" 2023-06-14 21:43:52 +00:00
Zuul 25e91da472 Merge "[fwaas]Disassociate all ports before deleting firewall group" 2023-06-06 23:34:07 +00:00
Zuul 19424c5cf1 Merge "Don't check exit status when nc_client is spawned" 2023-06-06 23:34:05 +00:00
Zuul fd95bf0b8e Merge "Don't use "Zero-I/O mode" in nc client in the TCP mode" 2023-06-05 22:29:05 +00:00