22 Commits

Author SHA1 Message Date
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
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
Slawek Kaplonski
fdfb4741f6 [S-RBAC] Update DSCP marking rule create API test
In the test_qos_dscp_create_and_update API test, qos policy was made as
admin user (which is correct) but was also owned by admin project. And
later, to check if DSCP marking rule was created in that policy
properly, regular client is used instead.
The problem is that with new S-RBAC API policies, rules are visible to
owners of the policy, not to all users. And due to that this test is
failing with new S-RBAC policies enforced.

This patch fixes it by changing owner of the qos policy to the regular
client's project.

Related-Bug: #2018727
Change-Id: Iadf69c167cdda0017084e482a58116520a1ea80f
2023-05-10 12:52:31 +02:00
Rodolfo Alonso Hernandez
3de3cd9781 Retrieve the DSCP valid marks from the API
Instead of relying on a constant, read the DSCP valid supported marks
from the API, using the 'qos-rule-type-details' call [1].

[1]https://docs.openstack.org/api-ref/network/v2/index.html?expanded=show-qos-rule-type-details-detail#show-qos-rule-type-details

Related-Bug: #1987378
Change-Id: I207e32a966fb43d6f34fac4a160d69944a19217b
2022-08-26 15:14:44 +00:00
Chandan Kumar (raukadah)
255586cca9 Move RULE_TYPE_MINIMUM_PACKET_RATE under setup method
On Wallaby, We have pinned tempest[1] to particular commit[2]
to fix lp#1963907.

https://review.rdoproject.org/r/c/rdoinfo/+/40273 pinned
neutron-tempest-plugin at master commit to fix neutron tempest
tests in wallaby.

But the tempest tests are throwing
```
AttributeError: module 'neutron_lib.services.qos.constants'
has no attribute 'RULE_TYPE_MINIMUM_PACKET_RATE'
```

On wallaby, neutron-lib=2.10.2 is used in the RDO/Tripleo
Deployment.

https://review.opendev.org/c/openstack/neutron-lib/+/816447
Moves RULE_TYPE_MINIMUM_PACKET_RATE to neutron-lib which is available
in Yoga release and not available in wallaby neutron-lib
leading to above failure.

Moving the RULE_TYPE_MINIMUM_PACKET_RATE variable to the setup
method fixes the issue.

[1]. https://review.opendev.org/c/openstack/tempest/+/822560
[2]. https://review.rdoproject.org/r/c/rdoinfo/+/40228

Related-Bug: #1963907

Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Change-Id: If2badd6cbac13ddaf86fe81b48ebd69d2857f1b0
2022-03-10 13:42:41 +05:30
Zuul
f92eacf7eb Merge "Use random name in qos test_list_policy_filter_by_name" 2022-01-28 23:52:26 +00:00
elajkat
757f3f1d13 Use random policy names in test_qos and test_qos_negative
Change-Id: Ib5f586e38c7c23fce6e03dc28b3f3d4828264ebf
Related-Bug: 1959184
2022-01-28 12:02:12 +01:00
65fa2c06f7 Use random name in qos test_list_policy_filter_by_name
test_list_policy_filter_by_name was looking for policies
with name 'test' and expected only one such policy to
be retrieved, but since tempest is running with multiple
concurrency and some other qos tests were also using same
policy name, this leads to test failure when this test
runs at same time with other such tests. This patch fixes
it by using random name for the policy for this test.

Closes-Bug: #1959184
Change-Id: Ibcbb2403b5b5983b2573c5a4791fb30850816d60
2022-01-28 13:54:38 +05:30
elajkat
4a1357b86d QoS min pps API tests
Co-Authored-By: Przemyslaw Szczerbik <przemyslaw.szczerbik@est.tech>
Partial-Bug: #1922237
Change-Id: I39f521a11de4e9ff4d447d7a6e85f9cbee6ee62a
2022-01-13 08:56:52 +00:00
zahlabut
7ebb66e0fd Refactoring - Use existing Tempest APIs in "QoS bandwidth limit rule" tests
Change-Id: I742156400061f9b293fd655fb69a3c4db65cad37
2021-09-09 14:21:44 +03:00
likangkang01
afd73f77d7 test sort ascending and descending qos policies by name
test sort qos policies by name,ascending and descending

Change-Id: I9bb6470b83f2003bef9206b53cb3f52671991e95
2020-06-03 14:13:02 +08:00
Rodolfo Alonso Hernandez
e2d062f125 Remove references to "tenant_id" in test_qos
Change-Id: I188bb04992b8fa306cd0da6f9ebed4c1cd2338c9
Related-Bug: #1858783
2020-02-07 09:26:32 +00:00
nfridman
07f0e78871 Add test to attach and detach policies with regular client
The test validates that a regular client is allowed to attach\detach
QoS policies only to\from networks with policies that were configured
as "Shared".

This test will not be running automatically because of the creation
of a "Shared" resource during the test.
Setting the create_shared_resources option as 'True' in the config.py
file is needed.

Change-Id: Iec3fda32cbce00a677cb30dac3c234c99d7c27fd
2019-12-15 03:41:12 -05:00
nfridman
7717d9cef5 Add test to create policy with multiple rules
The test validates that:
1.Two bandwidth limit rules could be both attached to a policy.
2.The system prevents addition of rules with the same direction to a policy.

Change-Id: I387d50673795c2a5073ec298426960fca593c017
2019-11-26 04:28:30 -05:00
nfridman
23b44ad0ef Add test to create and update DSCP values
The test verifies that admin user is able to set
DSCP marking rules with all of the valid marks between 0-56.
The test was moved from screnario\test_qos to api\test_qos.

Change-Id: I65b152622d4ba39ef710b44a2d3a044904e3e309
2019-10-06 04:06:38 -04:00
Lajos Katona
dc9c6d6dbe test for minimum bw ingress direction
Change-Id: I29fdbf51164aedc0b1a40055532f414cdf8cd4e8
Depends-On: https://review.openstack.org/584927
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2018-10-15 07:39:28 +00:00
Lajos Katona
b1c48b6688 Remove test_rule_create_fail_for_direction_ingress
When the API extension qos-bw-minimum-ingress will be on master (see:
https://review.openstack.org/584927) the test
neutron_tempest_plugin.api.test_qos.QosMinimumBandwidthRuleTestJSON.
test_rule_create_fail_for_direction_ingress is useless, so it can be
removed from master, and to keep the coverage for stable branches there
should be fullstack test: I6ee08d43aed60a7dd2d3281deaccfac2f3712b33

Change-Id: Ie04d53817c1f28b4756b1cc308203dc77dd2a19c
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2018-10-11 14:42:59 +00:00
Federico Ressi
2d7db2c4c1 Refactor tests to use create_network convenience params.
Use create_network method instead of
  - create_network_keystone_v3
  - create_shared_network

Change-Id: I3c494ccb9e5749a346621db9b3813b4dc7921db0
2018-07-12 08:17:16 +02:00
Brian Haley
6767cecb79 Fix some pep8 warnings
Fix some pep8 warnings found running under python3.5.

Also removed some ignore directives that were carried
over from the neutron tree, and exclude some additional
directories.

Trivialfix

Change-Id: I96f53d3d142352f0d2c7cc641391019b476b0724
2018-04-10 15:30:23 -04:00
Sławek Kapłoński
508dd2977c [QoS] Add API test for create port with admin's QoS policy
This patch adds API test which checks if regular user can
create port in own network if this network has got QoS policy
configured by admin and this QoS policy belongs to admin.

Issue with such scenario was reported in related bug.

Change-Id: I08f337f3bf786ae66f57d48ec8698845ac568b97
Related-Bug: #1750591
Depends-On: I464888ca3920b42edd6ab638f6a317ee51ef0994
2018-02-22 13:45:37 +01:00
Chandan Kumar
c125fd1479 Code Sync from neutron project to newly created neutron-tempest-plugin
* The following commit sync the code from following hash:
  start_hash: 7279aa35851110a4933a10b58b2758a2bc3933a3
  end_hash: 6e911a49a9e630878f4c46f61fde3964be550880

Change-Id: I371aa4d5f043f695df04b98b0f485c8f0548f2b3
2017-11-15 23:00:13 +05:30
Chandan Kumar
667d3d3260 Refactored Neutron tempest plugin directory structure
* switch from neutron.tests.tempest to neutron_tempest_plugin
* Cleaned up README.rst and setup.cfg
* Use neutron_tempest_plugin as a tempest plugin package
* Fixed gitreview
* Keeping flake8 Ignores in tox.ini as tempest plugin is
  imported from neutron codebase.

Change-Id: I42d389836e72813fdeebc797a577f4a8ac2ee603
2017-11-13 09:19:11 +05:30