Commit Graph

237 Commits

Author SHA1 Message Date
Omer 427701e776 Add missing cleanups after octavia resources creation
In some of the tests, cleanups were missing after creating Octavia
resources.

This patch adds the missing cleanups.

Change-Id: I848e08295580709fa739df2d216dad0efd19a795
2024-02-22 03:17:47 -05:00
Zuul ffc51f76b2 Merge "Drop implementation to use pyOpenSSL to manage pkcs12 certs" 2024-01-19 18:34:26 +00:00
Takashi Kajinami 25872b36de Drop implementation to use pyOpenSSL to manage pkcs12 certs
The cryptography library has been bumped to 3.1 in upper-constraints
file during Ussuri, which is quite old. So we no longer have to
maintain logic for cryptography < 3.0.

Change-Id: I1a463e320b94b0e99e92541581e1ee5feffd356a
2023-11-06 23:26:15 +09:00
Gregory Thiemonge ece5ab4369 Add SCTP protocol listener api tests
Story: 2007884
Task: 41174

Change-Id: I090045a0eac39cb64f0373f932e7b42640ee5ad9
2023-07-11 08:48:53 -04:00
Zuul e7f794e685 Merge "Add h2 traffic/scenario test" 2023-05-03 10:28:27 +00:00
Zuul 8a6e50424a Merge "Fix the pool client auth test" 2023-04-13 05:39:07 +00:00
Gregory Thiemonge d698a18781 Fix request interval in _wait_for_lb_functional
The request_interval parameter is passed to the _wait_for_lb_functional
function but it wasn't used in the function.
Now the function sleeps for request_interval sec for each iteration of
the loop.
It mitigates some random failures with the TCP listener +
least_connection lb_algorithm tests that require a specific delay
between the requests [0]

[0] https://opendev.org/openstack/octavia-tempest-plugin/src/branch/master/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py#L854

Change-Id: Idf0a9fb71178abea732748f92f01eed5a55a3228
2023-04-06 09:50:42 +02:00
Michael Johnson 554873fc00 Fix the pool client auth test
There was an intermittent test failure in the
test_pool_reencryption_client_authentication test where members are detected
as unbalanced. This was due to the time it takes for the health monitor to
bring the member back into the pool.
This change adds a waiter for the members to go operating_status ONLINE before
checking for balanced member requests.

Story: 2010660
Task: 47710
Change-Id: Ibb1f351c77f3ed7a0c69c8295973f77ab2069dad
2023-03-24 21:25:05 +00:00
Michael Johnson 6dac8ff58f Update Octavia tempest tests for no scoped tokens
There has been a direction change in the "secure-RBAC" goal and scoped
tokens are no longer being implemented[1].
The Octavia tempest tests were updated for the new keystone roles and
scoped tokens at the same time with an (bad) assumption that they would be
turned on at the same time.
This patch updates the Octavia tempest plugin to not assume that scoped
tokens are in use when the RBAC type is set to keystone_default_roles.

[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#direction-change

Depends-On: https://review.opendev.org/c/openstack/octavia/+/877433
Change-Id: Ia1c4ca0b675d39bd43640184d6d3deba823fd3f6
2023-03-14 23:21:51 +00:00
Zuul 5b73479a4d Merge "Reduce the number of load balancers in PoolAPITest" 2023-03-03 13:13:20 +00:00
Gregory Thiemonge fb04e6ea97 Fix legacy admin in RBAC tests
The legacy admin continues to work as it is with the sRBAC [0]
if os_system_admin is allowed, os_admin should be allowed.

[0] https://governance.openstack.org/tc/goals/selected/\
    consistent-and-secure-rbac.html\#legacy-admin-continues-to-work-as-it-is

Depends-On: https://review.opendev.org/c/openstack/octavia/+/875620

Change-Id: I10d497a4b4e3a3b21cb24dba73d5074a71a3d381
2023-02-28 07:39:53 -05:00
Omer 6590e6e6ee Add h2 traffic/scenario test
This patch adds a test where we test both h2 and HTTP traffic on the
same load balancer.

For this purpose, we deploy an HTTP listener, a TERMINATED_HTTPS
listener with h2 alpn protocols, and an HTTP pool with h2 alpn protocol
and backend re-encryption.

Change-Id: I470268c91cce18a00baf3fb1f721299bf4662e13
2023-02-21 12:55:00 +01:00
Michael Johnson 9e9f526d65 Add "member" role to non-admin test credentials
Some services are enabling "new defaults" RBAC by default. This will require all non-admin users to have either the "member" or "reader" role. This patch updates the Octavia tempest plugin to include the "member" role in test credentials when the tempest plugin is configured for "RBAC_test_type" other than owner-or-admin.

Change-Id: I8aadb98d438943b18a8d72ff54e216930cfd3ccc
2023-01-18 18:02:06 +00:00
Zuul f1061176af Merge "Make user role logging optional" 2023-01-09 11:13:05 +00:00
Zuul a98cd8787e Merge "Remove skip flag for tests skipped due to inactive bug" 2023-01-04 12:56:52 +00:00
Bas de Bruijne 530a88a434 Make user role logging optional
Not in every cloud does tempest have permissions to list the
role assignments. Since it is not critial for running the tests,
the logging of the user roles should be configurable.

Change-Id: I8aea2b597b9dd9bbdc5a1527fae03e86364aab4c
2023-01-03 17:41:29 +00:00
Michael Johnson 4a61eeb5de Add scenario test for Prometheus over TLS
This patch adds a scenario test for Prometheus listeners using TLS with
client authentication.

Change-Id: Idc68a6fb0423d7682be861429d8e09f3d8b24771
2022-11-21 23:44:27 +00:00
Michael Johnson 8646e5ae97 API and scenario tests for PROMETHEUS listeners.
This patch adds API and scenario tests for PROMETHEUS listeners. This
includes scenario tests that connect to the metrics endpoint.

Depends-On: https://review.opendev.org/c/openstack/octavia/+/812258
Change-Id: Ia46d8c0967bc5b0f7cd11b6e3ca3a4e03c0bc138
2022-11-21 23:29:13 +00:00
Zuul c6da8f6345 Merge "Adding 2 traffic based test cases." 2022-11-17 14:34:38 +00:00
Lukáš Piwowarski 5aa216efc7 Remove skip flag for tests skipped due to inactive bug
Several tests are skipped because of story 2007979 [1] even though it
seems that the bug tracked by the story has already been resolved.

This patch removes the skip flag for these tests as the bug has already
been resolved.

[1] https://storyboard.openstack.org/#!/story/2007979

Change-Id: Ibec0bf4fba52a32dd1c9980c5d6bd7afc35d81a3
2022-11-15 17:40:00 +01:00
Michael Johnson 031ecca513 Adds a pool client authentication scenario test
This patch adds a pool client authentication scenario test that uses
test servers that require client authentication.

Change-Id: Id5b200954cdf02280d31ed910012a1591a2d2697
2022-09-22 18:57:35 +00:00
Zuul 17902190af Merge "Add ALPN support to the pools service client" 2022-09-22 18:24:41 +00:00
Zuul b6fe3c6884 Merge "Spliting member API tests in 2 classes" 2022-09-12 14:14:59 +00:00
Arkady Shtempler a186f060a0 Adding 2 traffic based test cases.
1) test_udp_update_pool_healthmonitor_listener
   Traffic should PASS after updating any of LB's components.

2) test_hm_op_status_changed_as_expected_on_update
   Update health monitor with various combinations of:
   HTTP method, expected HTTP status codes and backend URL.
   Validate that members' operation status is getting into
   appropriate state on each update.

Change-Id: Ie80378ac1a96941eefa905fd6f49c8fa7e9c3692
2022-08-02 11:22:06 +03:00
Gregory Thiemonge a66952e962 Fix generate_pkcs12_bundle for FIPS
generate_pkcs12_bundle used the PKCS12 class of the pyOpenSSL module
which is not compliant with FIPS (uses SHA1).
Switch to the cryptography module for generating the PKCS bundles unless
for really old releases (<=3.0) that don't support it (stable/train is
still on 2.8).

Change-Id: Ibd50e9a6e406683b7faba093d716c83d2b994ad7
2022-07-21 12:29:56 +02:00
Gregory Thiemonge 2f975b31c9 Fix TLS*_METHOD for old pyopenssl releases
The TLS_METHOD constant was introduced in pyopenssl 21.0.0 [0], but some
older Octavia branches (from train to victoria) still use older releases
(19.1.0 for victoria) and then don't support it. Switch back to the
previous the SSL methods if the new constanst doesn't exist.

[0] 5dc698861c

Change-Id: Ib0eeb1136c168fcc32326f4ed8b008fb7f193a30
2022-07-11 14:33:58 +02:00
Zuul 2a8713266a Merge "Remove deprecated OpenSSL methods" 2022-07-08 15:18:51 +00:00
Zuul 1aeccba999 Merge "Add missing RBAC enforcement tests for Listener API" 2022-05-10 20:17:01 +00:00
Fernando Royo 403216a767 Fix error on listener OPERATING_STATUS check
This patch fixes the check for listeners that
have been created with admin_state_up = False,
when running a driver in non-noop mode.

By error it is checking that the listener
is in ONLINE status, when this particular case
requires checking OFFLINE.

Change-Id: I07a9f6abdef29334d70e30755bb948c5b0b65d54
2022-05-10 10:08:45 +02:00
Gregory Thiemonge 6b2be2fea3 Remove deprecated OpenSSL methods
TLSv1_2_METHOD and SSLv23_METHOD are deprecated in OpenSSL [0], update
SSL.Context to use the generic TLS_METHOD.

This change also fixes the c9s-based FIPS jobs (they don't support
TLSv1.2).

[0] https://www.pyopenssl.org/en/stable/api/ssl.html#context-objects

Story 2009942
Task 44847

Change-Id: I39e293db39d2a9287b581833cfe9fd469f701a7c
2022-05-02 08:11:44 +02:00
Vadim Ponomarev f46e53f8e2
Add waiting OPERATION_STATUS for the third listener in tests.
This commit fixes the situation when test _test_listener_list fails
because of a mismatch OPERATION_STATUS. This error can be reproduced
only in really slow environments.

Change-Id: Ie873a59fffda425c60e912abbb0d3aec68e134ed
2022-04-27 13:34:50 +04:00
Gregory Thiemonge 137ca9c803 Add missing RBAC enforcement tests for Listener API
Some checks were missing for the test_*_listener_update and
test_*_listener_delete tests in ListenerAPITest.

Change-Id: I1ee799c56286c687ea2d7c456f84f34103d58d91
2022-03-29 15:36:21 +02:00
Zuul 9b0c0ff4bf Merge "Fix incorrect subnet_id for ipv6 member servers" 2022-03-23 19:58:39 +00:00
Gregory Thiemonge 16b6906d53 Spliting member API tests in 2 classes
Split MemberAPITest class into MemberAPITest1 and MemberAPITest2
classes. MemberAPITest contained 240 test funtions and it took 1h45 in
the octavia-v2-dsvm-noop-api job to run those functions sequentially.
By spliting this class, the load now spread on 2 workers and it reduces
the duration of the noop-api jobs, avoiding frequent timeout issues.

Change-Id: I2d2cf910bd5801bfeb92c1ede51bd120ced3b4f9
2022-02-14 08:09:16 +01:00
Zuul a3a95b132e Merge "Fix octavia-tempest-plugin on old tempest releases" 2022-02-09 15:30:24 +00:00
Zuul 3d8d6ca0eb Merge "Add centos-9-stream job" 2022-02-08 23:23:48 +00:00
Gregory Thiemonge a2c234ea22 Add centos-9-stream job
Add octavia-v2-dsvm-scenario-centos-9-stream

Add extra args to the "scp" command to authorize the pubkey exchange
with a cirros VM.
Detect the openssh client version to enable the use of the SCP protocol
(starting with openssh 8.7, the SFTP protocol is the default protocol
with scp, SFTP is not supported by Cirros) when sending files to the
cirros VM.

Depends-On: https://review.opendev.org/828189

Change-Id: I689a50e6762fd22e1aaec8aa84ff5b075ff5bd45
2022-02-07 21:21:46 +01:00
Gregory Thiemonge b0da4f3ce5 Fix octavia-tempest-plugin on old tempest releases
This is a follow-up commit for 'Add type to allow ECDSA keys'
(I34ac429ab5442cef056ee8b63fcb2ba41e8b9b27), this commit allows
using octavia-tempest-plugin with older tempest releases
(ex: in our jobs on stable/train).
It catches the exception if [validation].ssh_key_type is not
supported and doesn't pass the ssh_key_type argument to tempest
functions.

Change-Id: I5c2db87975803b30ea230c3bbf5dab4b96da4614
2022-02-04 10:58:09 +01:00
Michael Johnson 1b8929ee91 Add ALPN support to the pools service client
This patch adds ALPN protocol selection support to the pools service
client allowing you to limit the ALPN protocols negotiated when connecting
to member servers.

A follow on patch should include test coverage for this.

Change-Id: Id0b93446dbfdde479fd573eed3e9a5c1e9400609
2021-11-24 18:01:39 +00:00
Ade Lee d0ea406ee4 Add type to allow ECDSA keys
Some tempest tests will fail under FIPS because they are trying to
ssh to a cirrus instance that has a version of dropbear that does
not support signatures other than using SHA-1 for RSA keys. This
is not allowed under FIPS.  The workaround until cirros is updated
is to use ECDSA keys.  This patch allows the key type to be
specified.

Depends-On: https://review.opendev.org/c/openstack/tempest/+/807465
Change-Id: I34ac429ab5442cef056ee8b63fcb2ba41e8b9b27
2021-11-05 20:38:44 +00:00
Zuul ec23dbc276 Merge "Adds a pool re-encryption scenario test" 2021-10-02 01:05:31 +00:00
Gregory Thiemonge a78cfe0142 Fix incorrect subnet_id for ipv6 member servers
When adding an ipv6 member in test_ipv6_traffic_ops, the ipv4 subnet
from the same network was provided. This is incorrect, the ipv6 subnet
must be passed.

Change-Id: Id8f409a15e14c110f8075bbe943aed42224a948d
2021-09-23 14:56:54 +02:00
Gleb Zimin 685532377c Fix wrong protocol in UDP pool tests
Change-Id: I5bb7ee389e734c075f10ed38507bade9a442e51b
2021-07-30 18:42:34 +03:00
Zuul 058ceaf0e7 Merge "Fix expect_timeout_error in IPv6 scenario tests" 2021-07-21 19:15:05 +00:00
Michael Johnson 29d8e61ca2 Update service client access in tempest tests
All the load balancer service clients are registered via the plugin interface[1],
that way Tempest register and create the lazy initialization of registered clients
so that they can be access from there in consistent way.

But octavia-tempest-client create a separate instance of those and access instead of
accessing the registered service client in Tempest. This commit makes all the service clients
access from Tempest registry and remove the separate objects.

[1] cac3eefc44/octavia_tempest_plugin/plugin.py (L54)

Change-Id: Ie24909b49baf2c6a886e2ff711e641e36ffe6b50
2021-06-30 23:15:30 +00:00
Gregory Thiemonge 88d78fba15 Fix expect_timeout_error in IPv6 scenario tests
Fix except_timeout_error call to make_request. In case of an IPv6
address and a TCP-based protocol, make_request expects brackets around
the address (ex: [2001:12::2]).

Some tests failed with the following error: "Validate URL got exception:
Failed to parse: http://fd22:262a:41e1:1::f5:97. Retrying.". Then the
requests timed out because each retry failed and not for the excepted
reason (which is: SG update was applied)
Because of that issue, some IPv6 tests based on
_test_listener_with_allowed_cidrs may have failed because the tests
considered that the SG were applied, while the traffic could still pass.

Change-Id: I2e6d108a8d4ce197ae657ea10b10f63b1a5850c4
2021-06-22 11:32:18 +02:00
Arkady Shtempler cac3eefc44 New test: test_tcp_and_udp_traffic_on_same_port
It's possible to use the same VIP port for TCP and UDP protocols.
Two listeners: UDP and TCP are being created using the same VIP port.
UDP and TCP traffic validation, both should PASS.

Change-Id: Ie93829be86b8a2442911ce212cdd0bc98237b962
2021-06-01 16:44:43 +03:00
Arkady Shtempler 02c4040d4e Remove "listener_id" from functions where it's not in use
Fix functions and callers where "listener_id" wasn't actually used.

Change-Id: I7ca3b4011918d7047ad9a16306653b9054e36c4a
2021-05-15 13:25:28 +00:00
Arkady Shtempler 1ea1a2bd37 New test case: "test_insert_headers"
This test covers LB "insert HTTP headers" functionality.
It’s a traffic based scenario and validation is done using real HTTP headers
being received on backend side.

Change-Id: I97efd6bcc793e1378356c18209d5345597f39a00
2021-05-03 17:46:38 +00:00
Gregory Thiemonge 3497f6cb70 Fix owner_or_admin API tests
lb_observer and lb_global_observer don't have any meaning when
admin_or_owner policy override in enabled.
This commit disables client creation for those roles and removes their
uses from API tests (the behavior of the owner_or_admin tests are now
similar to their behavior before the introduction of the new RBAC
tests).

Requires the following configuration in tempest.conf:

[load_balancer]
RBAC_test_type = owner_or_admin
member_role = member
admin_role = admin

Change-Id: I2231384933d5974b962a558e8c0b3bffb1140b5a
2021-04-20 06:19:50 +02:00