173 Commits

Author SHA1 Message Date
Zuul
0389b70b88 Merge "Use compiled OVN version v23.09.0" 2024-09-09 19:07:05 +00:00
Zuul
91666e5937 Merge "Add wait method for the Neutron API" 2024-09-09 17:29:06 +00:00
Maor Blaustein
5a925a09d6 Fix keepalived double restart
Accidental double restart may cause race condition of service not up in
time when listed by second restart call of reset_node_service.

Resolves: OSPCIX-467

Change-Id: I941673a3cbb6c755254029b8c7b9eb4a456c2d48
2024-09-05 16:03:12 +03:00
Rodolfo Alonso Hernandez
7969981891 Add wait method for the Neutron API
This method checks if the Neutron API replies to a generic command
("agent list").

Related-Bug: #OSPRH-2460
Change-Id: I7982bb130e4a8ef7495e6243f656cc4095d35db8
2024-09-04 10:17:12 +00:00
Rodolfo Alonso Hernandez
71c7251492 Use compiled OVN version v23.09.0
This is the same used in functional testing in Neutron [1].
As per the git submodule command the required OVS version is
v3.2.0-20-g1d78a3f31. This OVN version contains the code needed
to test [2]

[1]https://review.opendev.org/c/openstack/neutron/+/895849
[2]https://review.opendev.org/c/openstack/neutron/+/893333

Related-Bug: #OSPRH-893
Change-Id: I7fe5ecf0e92e63dfad4493e8d95770886129b367
2024-09-04 08:29:11 +00:00
Maor Blaustein
0219e833da Check routers/azs using short hostnames
Recently FQDNs were needed for traffic flow tests [1],
but it seems AZ tests are affected as well from this fix.

This change fixes API network agent listing
for 'OVN Controller Gateway agent' to match short hostnames to zones.
Short hostnames used since API may show a mix of short/full names.

[1] 926195: Use long names when getting router gateway | https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/926195

Change-Id: Iafeced62b4ebe50a20f976803fd8a0cdbfeb3330
2024-09-02 18:06:04 +03:00
Roman Safronov
ebd07ef03b Fix ovn dbs monitoring test for podified
Use 'unix' rather than 'punix' when running monitoring command
in ovsdbserver pod since 'punix' is a passive, a.k.a. listening
side of a connection.
Fix typo in ovnsb_db.sock path.

Change-Id: Id384e20ff0c786032fff18ca287ecd9bc32db06b
2024-08-26 21:21:40 +03:00
Zuul
dcce239747 Merge "Fix compute configuration podified, and related tests" 2024-08-21 08:45:27 +00:00
Maor Blaustein
161db4c63c Fix compute configuration podified, and related tests
This allows metadata rate limiting tests to run fully,
yet they will be skipped until feature code will be inserted to RHOSO.

The ini filename/location from which configuration pulled and applied
changed in RHOSO, now used instead of 'oc patch' for edpm nodes.

Also service existence check fixed, pointed to strip method instead of
calling it, which mistakenly interpreted as true, so later code included
crc node as node to restart metadata service, results in failure of test.

In metadata rate limiting tests redundant code removed,
and made configuration setting restart service in minimal amounts.

Change-Id: I2b44e2dbf97f87b8fd9b5feee49a634300367218
2024-08-20 18:30:18 +03:00
Roman Safronov
2043d598f5 Use long names when getting router gateway
In order to ensure traffic flow tests behave consistently
on different environments the functions that are retrieving
router gateway chassis should use full names.

Change-Id: Ic8097270271433e68ffee1b8685caf01097d9393
2024-08-19 20:33:09 +03:00
Roman Safronov
b0e46fc16a Use 'oc exec' when retrieving ovsdb command string
It was found that sometimes an unexpected output returned when
using 'oc rsh' on attempt to get ovsdb command string from db pod.
This was causing an AssertingError and a test failure.
Compared to 'oc rsh' the issue does not happen when using 'oc exec'
command.
Also running ps in the background using setsid helps to avoid
sporadic errors due to [1].

[1] https://github.com/kubevirt/kubevirt/issues/10240

Change-Id: I77530691613ca352ce5e5650b3a2450a7003f459
2024-08-14 16:00:08 +03:00
Maor Blaustein
fefb4e1292 Fix is_service_on_node method
Method should return boolean according to check,
yet raises error upon expected non-zero exit status.

Change-Id: I328edfabbf0b7ff0df8eadaf3a151aa2ab9fcfe4
0.9.1
2024-08-12 14:45:26 +03:00
Zuul
fe6c5325ca Merge "Use hypervisor_hostname instead of host to find computes" 0.9.0 2024-08-11 21:56:25 +00:00
Zuul
e788e7a845 Merge "Check node names using startswith instead of in" 2024-08-11 15:56:45 +00:00
Eduardo Olivares
fb8b12850c Use hypervisor_hostname instead of host to find computes
Before this patch, the test test_dns_name_after_ovn_controller_restart
used the value from VM's `OS-EXT-SRV-ATTR:host` to search for the
corresponding compute node within the inventory.
Due to recent changes, the compute name has changed in the inventory and
the proper value that needs to be searched corresponds with
`OS-EXT-SRV-ATTR:hypervisor_hostname` instead.
This patch fixes test_dns_name_after_ovn_controller_restart by using the
value from `OS-EXT-SRV-ATTR:hypervisor_hostname`.

Change-Id: I2e928c987c0446b6c8b8a93abcb58122d3173207
2024-08-09 09:23:32 +02:00
Eduardo Olivares
d32e91b857 Check node names using startswith instead of in
Due to recent changes in inventory creation, node names use FQDN and
this may cause issues when deciding whether a node is an OCP node or
not. Example: "compute-0.ocp.openstack.lab" is not an OCP node, but
"ocp" is part of its hostname.
With this patch, the issue with FQDNs is resolved by checking how the
hostname starts.

Change-Id: I75ad4316338effccb67614997909ee7d7ff17c65
2024-08-08 09:04:27 +02:00
Roman Safronov
048c752ca3 Fix east_west capture for vlan tenant
With vlan tenant we have mac-mapping configured in ovs db
for compute nodes. These MAC values should be used when
filtering relevant traffic for east_west communication.

Also, introduced separate tunnel_interface config parameter
to define an appropriate value when capturing traffic on
a normal node and on ovs_pod.

Change-Id: Ibef4498604bd9fff7ab537ed276ce59e8a052cd6
2024-08-06 16:53:55 +03:00
Zuul
a022d38865 Merge "Use VM on external network in DVR ingress test" 2024-08-05 21:06:05 +00:00
Zuul
c5236dad0d Merge "Wait for target status in remote_service_action" 2024-08-05 12:09:19 +00:00
Roman Safronov
f89d5d40d2 Use VM on external network in DVR ingress test
In case proxy host on the environment for some reason
does not have routing to the external network
spawn a VM on external network to use it as a proxy
host for sending traffic to the VM under test.

Note: on podified environment we can not ping VM in
DVR test from a local ip since tempest is running on
one of the OCP cluster nodes and FIP-related traffic
will be captured on the gateway node (when only
compute nodes are expected) and thus affecting the
results.

Change-Id: I35def1d0d0e419cbcf552bc6148ed112567aa8f6
2024-08-05 13:00:50 +03:00
Roman Safronov
7f4b0f0895 Wait for target status in remote_service_action
A new target_state parameter was introduced into
remote_service_action() function in order to make sure that
a service reached the expected state.

Change-Id: I6fe09ffa86c7cbc703db56a7b72d0cf90b42f9f4
2024-08-04 17:46:23 +03:00
Roman Safronov
42f8e3c435 Remove node interfaces discover
Nodes interfaces discover was introduced in [1] where code
was extended to support tcpdump captures on different type of
nodes (including OCP cluster nodes).
Since then the code was modified to capture traffic on OCP nodes
differently comparing to normal nodes and there is no longer need
in interfaces discover for nodes since a config value can be used
instead.

[1] https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/913238

Change-Id: Ida23fa855a7986ba5c5f9ca49663644715783a24
2024-08-04 17:18:09 +03:00
Zuul
2a3d2e7a51 Merge "Dismiss only specific failure in retry" 2024-08-01 14:27:08 +00:00
Maor Blaustein
7cb8a091d6 Dismiss only specific failure in retry
The use of retry decorator is easy and tempting,
many test methods may find various issues, therefore raising exceptions,
this change forces specific failure to be targeted by retry decorator
in order to avoid dismissing other exceptions which require a fix.

This is done by an obligatory regex, which validates
the exception caught and dismissed has the intended assertion message.

There is optional exception type argument, in order to let other
unexpected exceptions to be raised and fail the test.

Change-Id: Ib9a17d8c6c8778adf546c610dd070c14aff45ecd
2024-08-01 12:54:06 +03:00
Zuul
2dfbfad335 Merge "Fix upstream network suffers packet loss in tests" 2024-07-31 12:14:48 +00:00
Zuul
70bc2a747d Merge "Fix to run openstack commands on the right host" 2024-07-31 12:00:46 +00:00
Maor Blaustein
e11fe76607 Fix upstream network suffers packet loss in tests
Upstream network isn't as stable in downstream test execution,
test quickly checks traffic over time periods for configured limits,
asserts that there is no traffic loss to verify rate limitation
correctly.

This oftens fails on upstream gates, therefore adding the retry
decorator up to 3 times to get stable measures for test, while not
failing check/gate patches.

Change-Id: I7ad1fd74df4460554beb6b0ea89abcf8153645cb
2024-07-30 22:57:47 +03:00
Maor Blaustein
de5213c77e Fix to run openstack commands on the right host
This fixes tests in the following test files [1].

Method 'validate_command' is commonly used for openstack/oc commands,
therefore default ssh client should be the proxy host
(localhost on devstack, controller on podified for now).

Another new argument 'local_shell' allows to easily override and
execute any command locally (without ssh connection).

[1]
test_provider_network.py
test_router_flavors.py
test_security_group_logging.py

Change-Id: I9138b1081870da4162eeb40ca055e3547f5c12b9
2024-07-30 22:48:58 +03:00
Roman Safronov
2b4fcdfd10 Fix assignment is_controller flag for crc
In [1] we changed the way is_controller flag is assigned for nodes
on podified environments. However crc host was not handled.
This patch fixes this.

[1] https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/924946

Change-Id: Id68c9803b7c5fc4e5e142dcfbb5685f25a75a6a6
2024-07-30 16:25:15 +03:00
Zuul
072f8c7e29 Merge "Try to get a valid hypervisor_host from ssh config" 0.8.0 2024-07-29 11:54:27 +00:00
Zuul
9842cc2393 Merge "Remove redundant OCP nodes interfaces discover" 2024-07-28 17:39:48 +00:00
Roman Safronov
ba106c51c5 Try to get a valid hypervisor_host from ssh config
Usually testing setups have openstack nodes implemented as
virtual machines running on the same hypervisor host.
For tests that perform power operations for the nodes it is
necessary to have an ability to run virsh commands from the
hypervisor host.
While there is a config parameter hypervisor_host that allows
to set the value, in some cases it is not possible to know what
will a hypervisor host name since it is selected randomally.
This patch adds code that as a fallback scenario tries to
determine hypervisor host name from ssh config file, that is
usually available on the proxy host (ansible controller host)
in case environment was deployed by ci-framework.

Change-Id: Icc71c5a0511f04c19ef9509a32278f4e70e92bd2
2024-07-28 17:59:39 +03:00
Roman Safronov
643e1ed4b2 Fix is_controller value assignment for podified
On podified environment it can be that more than one replica
of rabbit or galera is running on same node and some other
OCP node does not have such processes running while still being
OSP controller, i.e. host with OSP control plane services.
This patch assigns is_controller flag for OCP hosts according
to inventory data.

Change-Id: I5aa66350f6eca924c756f82b3c074136c3388f9e
2024-07-28 14:26:59 +03:00
Zuul
1067fef73a Merge "L3HA tests fixes and improvements" 2024-07-25 18:30:45 +00:00
Roman Safronov
0d7b2a93bc Remove redundant OCP nodes interfaces discover
After code was changed for capture traffic on ovn-controller-ovs
container rather than on OCP nodes bridges there is no longer need
to discover OCP nodes interfaces.

Change-Id: I7ef62a2e46758345034c61c06222f8845c6f71f8
2024-07-25 18:35:24 +03:00
Zuul
b61f0b6386 Merge "Handle fqdn in OCP nodes" 2024-07-25 11:33:58 +00:00
Zuul
3f8703d748 Merge "Fix podified configuration set and wait w/o overwrite" 2024-07-25 11:13:50 +00:00
5daba8e6ba Handle fqdn in OCP nodes
Follow up of [1], we also need to handle OCP node
names including fqdns.

[1] https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/924394

Change-Id: Ia53caaa7d9d26dd45acbcd6e5f5d9ef49726fc74
2024-07-25 11:35:19 +05:30
Maor Blaustein
a3488f9cae Fix podified configuration set and wait w/o overwrite
The neutron pod or any other service contains separate custom
configuration buffer for non default configuration.

Any configuration change should retrieve and add existing configuration
first, this change adds such fix to avoid deleting previous settings.

This fix also waits for old service pod to be replaced before allowing
the test to continue.

Change-Id: I4028c9f9fed3d38c3bcaa698e3a119a9656b0886
2024-07-24 15:21:46 +03:00
Roman Safronov
204fcc27b4 L3HA tests fixes and improvements
Since some tests can be disruptive and can break some important
nodes an option for using only safe nodes was introduced.
With this option enabled, tests that are doing disruptive actions
will not use OSP controller nodes for this but will retry
to create objects for testing on a safer node. The option is
enabled by default.

In order to make test_l3ha_reboot_node to work properly,
discover_nodes() was changed to support nodes rescan when there
are shut off nodes.

test_l3ha_bring_down_interface was changed to use
node_tenant_interface defined in config file instead of letting
the test to discover it.

Changed default value for hypervisor_host to match the
current value used on environments deployed by ci-framework.

Moved all power operations functions to a separate class that
disruptive tests should inherit from.

Fixed incorrect calls of find_host_virsh_name by
adding required parameter and some other fixes in power
operations functions.

Change-Id: Iafe9b0210972e0c59529c4a09edbe11d68f91514
2024-07-22 17:14:36 +03:00
Zuul
17351a7865 Merge "Create decorator for retry on assert_fail" 2024-07-22 11:26:46 +00:00
Eduardo Olivares
b8df157d77 Create decorator for retry on assert_fail
This patch adds a decorator for those functions that we want to
evaluate more than once in case of an assertion failure. Some
scenario tests are conditioned by the stability of the VM or
interfaces after their creation to obtain bandwidth measurements
according to QoS criteria. For these tests, this decorator allows
for multiple evaluations seeking stability in the measurements

Co-Authored-By: froyo@redhat.com
Change-Id: I4c562a97ff958e8c15408f3d06c54c24e9a2f1fb
2024-07-19 12:25:24 +02:00
Eduardo Olivares
11d863ac35 Find OCP nodes based on hostname instead of list of CIDRs
For some reason, the list of CIDRs from an OCP node sometimes does not
include some of its IP addresses.
The method `get_ocp_main_ip` will use the hostname in order to identify
OCP nodes instead.

Change-Id: Ie3e4460d9d338aed21f62b4b17471aef26bebd4a
2024-07-18 12:01:36 +02:00
Maor Blaustein
c1c17025c6 Temporarily enable shared external network in test class
This patch enables shared parameter similarly to patch [0],
only on test class level.

For podified environments some tests will temporary enable 'shared'
parameter for external network. This is because it was decided that
on podified environments external network should not be shared
by default for some tempest api tests to work properly, see [1].
Podified environment should run all the tests that modify external
network one by one, in a single tempest thread.

[0] eacd16a847
[1] https://github.com/openstack-k8s-operators/ci-framework/pull/1862

Change-Id: Id841b5c1cb5b620d8fcf8852b6041b1f80257505
2024-07-16 14:48:23 +03:00
Roman Safronov
647aef6885 Set openstack_type podified as default
Since the plugin is recently used mainly for testing multi-node
podified environments it is worth to set this as default value
to avoid irrelevant failures and simplify podified job definitions.

Also, run_traffic_flow_tests parameter is now enabled by default.

Also, CONF.identity.uri_v3 is now preferred over CONF.identity.uri

Change-Id: Ib73f4fb0f8a465ba1e40137c0237211bb1642ef5
2024-07-15 12:36:15 +03:00
Eduardo Olivares
e219a1fa23 Ignore exit code 1 when returned stdout is correct
When the `ps` command is executed on a pod with `oc rsh <pod> ps ...`,
sometimes the exit code is not 0, but the command returns the expected
output.
This patch adds " || true" to that command in order to ignore the
returned code.

Related-issue: OSPRH-8352
Related-issue: https://github.com/kubevirt/kubevirt/issues/10240

Change-Id: I246adf9f10a2d08b64be001bf13bfb807fb62698
0.7.1
2024-07-11 08:31:16 +02:00
Eduardo Olivares
30af407669 Obtain OCP node main IPs
In case of podified setups without CRC, instead of using the IPs
for the OCP nodes from the inventory, their IPs should be obtained with
the command `oc get node/<nodename> -o yaml` from the status.addresses
field.

Change-Id: I9d5e614274adda61d57a177d8d9243993305564c
2024-07-08 18:42:37 +02:00
Eduardo Olivares
8807beed60 Send requests to OVN database leader instance
In case of podified setups, when the number of replicas is greater
than 1, the requests to the OVN databases should be sent to the
RAFT DB leader instance.
The requests can be sent from any OVN DB NB/SB pod, but the parameter
--db should be included in order to forward the requests to the leaders.

Change-Id: I802b9b685a7254b6eebae0bbe7d0033c06077349
0.7.0
2024-07-01 13:43:22 +02:00
Zuul
fd8e967b1e Merge "Make regex in extra dhcp opts test less strict" 2024-06-30 14:48:26 +00:00
Zuul
c1eb48dd39 Merge "Return first neutron pod when number of replicas is greater than 1" 2024-06-30 12:18:35 +00:00