30 Commits

Author SHA1 Message Date
Takashi Kajinami
435ff6ffc5 Bump hacking
hacking 3.0.x is too old. Bump it to the version currently used in
tempest repo.

Depends-on: https://review.opendev.org/c/openstack/tempest/+/906634
Change-Id: I01f9496e0fb66397916f8f8ce7543e3786f5d1dc
2024-11-22 10:37:03 +00:00
Rodolfo Alonso Hernandez
4f3dbe4fea Add test for extension "quota-check-limit-default"
This new test is checking that, by default, the quota engine will check
the resource usage before setting the quota. If the new quota is below
the resource usage, an exception is returned.

This patch is also adding the flag "force=True" in other tests setting
quotas for resources; these tests do not need the quota engine to
verify the current resource usage.

Related-Bug: #1953170
Change-Id: Ia193cd5a2aacc4243b5807eb7757b32e66f12365
2024-09-13 12:40:03 +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
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
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
4dee1c2727 Run security group api tests against stateless security groups too
With this patch most of the API tests related to Security groups will be
run for the default (stateful) security groups and also for stateless
security groups by passing "stateful=False" to the
create_security_group() function.

Change-Id: I66af24513ba126c1cd00ca896bbd56a448faf726
2022-12-21 11:02:03 +00:00
Ihar Hrachyshka
b0b597f803 Add stateless security group test case
It's a simple test case that creates, updates a stateless SG and
checks that the attribute is updated accordingly.

Related-Bug: #1949451
Depends-On: I85f7749e7e6186b9e3a7534bce6c306b18702333
Change-Id: I30e0a11c45618cbdaa0130942cb67ea99bbd0b92
2021-11-29 17:55:31 +00:00
Huy Tran
70be7accfd Cleanup Security Group rules after TC execution
Security group rules created by SecGroupRulesQuotaTest are not
being cleaned up after TC execution. Security Group rules normally
would get cleanup if associated Security Group is deleted. However,
SecGroupRulesQuotaTest doesn't create any Security Groups. The
Security Group rules are created in default or existing Security
Groups. Thus, the SecGroupRulesQuotaTest should be responsible to
clean up the rules which created by the TC.

Change-Id: I4dd2d9eb7e60101ba7f5c3d915ec27ee6c46b227
2021-07-01 14:46:44 -05:00
Arkady Shtempler
8ebc061c05 Create security groups with the same name
Test scenario:
Create a number of security groups using the same name.
Make sure that all the security groups have been created successfully
and that each group has its own unique ID.

Change-Id: I044e8f86cd8999d1bde5e4995239b0dfa55489f0
2021-01-16 13:19:39 +02:00
likangkang01
7d0155a883 sort secgroups by name
list security group, and sorts by name

Change-Id: I1fb22c474c4486ed69a49f7e75a7971aeb552b24
2020-08-20 13:45:23 +08:00
Eran Kuris
5f9c076261 Added new API test_sg_rules_quota_decrease_less_than_created.
The test is checking that its possible to decrease
Security group rules quota less than already created.

Change-Id: I6a170a153038380d2fe5632afcab47b1cdba5f6c
2020-04-28 11:23:10 +03:00
Eran Kuris
5f0ba3f0da Added new API test_create_sg_rules_when_quota_disabled
The test actually tries to create security group rules
while the quota is disable. The goal is to check that we
are not enforce SG rules quota while it disabled.

Change-Id: I504b98ecaa3346799b0a09ec93894472794d4635
2020-04-20 16:49:44 +03:00
Eran Kuris
345bb5efe3 Added new API test_sg_rules_quota_values.
The test is checking change of different SG rules quota values.

Change-Id: I2a42a9d8d0c6ec3872b1468acef4cca5b9112db2
2020-04-06 14:27:37 +00:00
Zuul
7729b6afac Merge "Fixed test_sg_quota_increased test" 2020-03-18 23:55:30 +00:00
Eran Kuris
4e932abbb4 Fixed test_sg_quota_increased test
The old assertion will be always true.
As a result I proposing a fix for that.

Change-Id: I0742214a5ee5a901650a0142fa3718699bb13b73
2020-03-18 08:25:12 +00:00
Eran Kuris
383be49198 Added description to test_sg_rules_quota_increased.
Change-Id: I53d95093ab2c33371cf788ca1bceaa2bb40b8ec8
2020-03-15 11:02:52 +00:00
Zuul
b82476000c Merge "Adding new test of security group rules quota increased." 2020-03-11 11:56:57 +00:00
ekuris
4e329cf99c Adding new test of security group rules quota increased.
The test is checking that it is possible to create
new security group rules after increasing the quota parameter.

Change-Id: Ie961293215c48883c962debe888b0bca418e3eb9
2020-03-10 13:35:21 +00:00
Zuul
753ddfe205 Merge "Helper class for BaseSecGroupRulesQuota tests." 2020-03-06 00:22:35 +00:00
ekuris
1b896ca196 Helper class for BaseSecGroupRulesQuota tests.
The helper class contain:
-Get function of security group rules quota
-Set function of security group rules quota
-Increase & Decrease of security group rules quota

Change-Id: I99d633bdc0fbac7d7259210052be289c94b70a2b
2020-03-04 07:41:56 +00:00
Slawek Kaplonski
31c0006ded Add list security group rules API test
This test checks that regular user can see all SG rules which belongs
to his tenant OR belongs to security group owned by his tenant.

This test also ensures that SG rules from different tenants and Security
Groups are not visible for regular user.

Fix for master branch
Depends-On: https://review.opendev.org/681910

Fix for stable/train
Depends-On: https://review.opendev.org/688715

Fix for stable/stein
Depends-On: https://review.opendev.org/688716

Fix for stable/rocky
Depends-On: https://review.opendev.org/688717

Fix for stable/queens
Depends-On: https://review.opendev.org/688719

Change-Id: Ic2e97ab8162d10e507ef83b9af0840e7311f0587
Related-Bug: #1824248
2020-02-26 20:33:02 +00:00
Rodolfo Alonso Hernandez
cc92cc9f44 Remove references to "tenant_id" in test_security_groups
Change-Id: I4cbeb5b0dff226ccb6c7d7893b4fa5a0b49a8f64
Related-Bug: #1858783
2020-02-11 09:29:10 +00:00
Alex Katz
426c909aab Positive tests for security group quota
1. Test supported values for securiyt group quota
2. Test creating maximum allowed amount of security groups
3. Test creating maximum allowed amount of security groups if
quota is increased
4. Test decreasing security group quota to a value that is less
than amount of already created security groups
5. Test creating security groups when the quota is disabled (set to -1)

Change-Id: I833e5d5e67ef7555c9e6a54613b7324310079b0b
2020-01-14 16:30:31 +02:00
Zuul
0d29ebb40c Merge "Add API test case to check if SG displays all rules" 2019-05-28 17:43:05 +00:00
Slawek Kaplonski
87c3f941a3 Add API test case to check if SG displays all rules
This patch adds new API test which checks if owner of security group
can see rules which belongs to his security group even if rule was
created and belongs to other user (admin).

Patch for master branch:
Depends-On: https://review.opendev.org/660174

Backport to stable/Stein:
Depends-On: https://review.opendev.org/661281

Backport to stable/Rocky:
Depends-On: https://review.opendev.org/661283

Backport to stable/Queens:
Depends-On: https://review.opendev.org/661284

Change-Id: I728cd8252d27e27e91bd95e4734d9db470dee35a
Related-Bug: #1824248
2019-05-24 19:02:54 +00:00
Brian Haley
8d2557c632 Change legacy security group rule check
A neutron change, https://review.opendev.org/#/c/453346/
is standardizing the protocol name for IPv6 ICMP in security
group rules to be 'ipv6-icmp', even if 'icmp' or 'icmpv6'
was passed during creation.  Change the API test to check
against a list of possible values so it covers both old and
new behaviors.

Change-Id: I0ca8d743ca56f7d67ef8c1ae45ca518bd6e6dc35
Partial-Bug: #1582500
2019-05-21 09:14:38 -04:00
Doug Wiegley
5b85ad8c3f
Add tempest api tests for security groups RBAC
Partial-Bug: #1817119
Depends-On: https://review.openstack.org/635311
Change-Id: I806d0c1763a0abc4f07a7c85922949b056ad78d8
2019-03-05 22:12:16 -07:00
Federico Ressi
e570de6389 Update test cases after security group menthods improvements.
Change I50858d5198d8a70a2bb9fb278786c433d7cb12ca improved
test case methods for helping reducint test case complexity
when handling with security groups.

This change use those API improvements to reduce the
complexity of existing test cases and to make them easier
to read.

Change-Id: I8589b31db996702c3da2235fa72182badfd84c02
2018-12-04 09:16:30 +00: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