194 Commits

Author SHA1 Message Date
Roman Safronov
ea8a27a475 Fix fallback in dvr ingress test
The fallback mechanism in dvr ingress test was introduced
in [1] in order to allow the test to work properly on
environments where the host that is used as proxy host
does not have routing to neutron external network.
As appeared the ping check in this fallback mechanism
is working inconsistently on some environments in case
cirros image is used as default image.
This patch changes the problematic ping check to
check_connectivity function that does multiple retries
before raising an exception.

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

Change-Id: I82a5095d31a7b9e96821a0985e1400814eda02b2
2024-09-26 15:17:21 +03:00
Roman Safronov
182582a0d5 Remove Tripleo from plugin description lines
This patch replaces mentions of Tripleo in the plugin description
lines by openstack-k8s-operators.

Change-Id: Ic0fc4b619cbf0be5b3da5a94c6fec1e4daeac119
2024-09-18 12:48:24 +03:00
Zuul
8b4555492a Merge "Make use of the utility method `get_neutron_api_service_name`" 2024-09-16 17:39:48 +00:00
Zuul
f0c681a9b7 Merge "Make use of the utility method `get_ml2_conf_file`" 2024-09-16 17:39:47 +00:00
Zuul
de66162e24 Merge "Do not "grep" the output of an empty list" 2024-09-16 17:39:46 +00:00
Zuul
cf1a5de2fe Merge "Fix dvr vip failover tests" 2024-09-16 13:03:52 +00:00
Zuul
a7c3c9454f Merge "Test Neutron API restart time" 2024-09-16 12:46:33 +00:00
Roman Safronov
79ddfc94b0 Fix dvr vip failover tests
On podified environments we can't use local IP for establishing
TCP connection via virtual IP (VIP) since tempest is running on
a node that can be a gateway node and logic of the test will be
affected. Therefore a separate VM is spawned on the external
network and it is used as a proxy host for establishing TCP
connection to the FIP.
Also introduced a function ensure_external_network_is_shared()
and simplified some tests from other files that had the same
code.

Change-Id: I099ec34299debcd43b8ce485656e3ea6d7a95f51
2024-09-16 00:14:56 +03:00
Zuul
28d64df58a Merge "Capture traffic only in podified nodes running ovs pods" 2024-09-15 11:00:23 +00:00
Rodolfo Alonso Hernandez
d8b9b0635f Test Neutron API restart time
The new test added checks that the time spent to restart the Neutron API
doesn't take more than one minute.

Closes-Bug: #OSPRH-2460
Change-Id: I467f6c2124b8e3d6eb76bea399fd9cc5bd553b5c
2024-09-14 16:42:26 +00:00
Rodolfo Alonso Hernandez
8233036bcd Make use of the utility method `get_neutron_api_service_name`
Change-Id: Ibfd04fef4c9182614256bec52c349c28f5cd4e49
2024-09-14 16:42:09 +00:00
Rodolfo Alonso Hernandez
e8aa6da10a Make use of the utility method `get_ml2_conf_file`
Change-Id: I0a08b343cb11dc0d75cc3ee3c9db5168e508c052
2024-09-14 16:42:05 +00:00
Rodolfo Alonso Hernandez
363e3564a9 Do not "grep" the output of an empty list
If a command returns an empty list, the "grep" command will exit with
error. In the ``OvnFdbAgingTest`` test case, we need to retrieve the
OVN SB FDB table to read the MAC address. The output is something like
this (one single register):
  $ ovn-sbctl list FDB
    _uuid               : 7422a4fb-fb01-47b5-b408-1b59470f0e9d
    dp_key              : 1
    mac                 : "fa:16:3e:69:a9:f9"
    port_key            : 7
    timestamp           : 1726246598759

It is possible to output the MAC address by adding the needed filters to
the command:
  $ ovn-sbctl --format=list --bare --columns=mac list FDB
    fa:16:3e:69:a9:f9

Related-Bug: #OSPRH-893
Change-Id: Iaca410d9943a39e76f86ec51b5292ed896f8088b
2024-09-13 17:28:01 +00:00
Zuul
2c618d8d11 Merge "Use the value of "ml2_plugin_config" when retrieving the ML2 conf file" 2024-09-13 15:11:45 +00:00
Zuul
a031da7806 Merge "Fix SGL tests log file for podified" 2024-09-13 11:34:42 +00:00
Eduardo Olivares
7bb88c4fbd Capture traffic only in podified nodes running ovs pods
Before this patch, tests capturing dataplane traffic tried to start
captures on all podified nodes (those with 'is_controller' set to
True). However, dataplane traffic should only be captured on podified
nodes running an ovs pod.

Change-Id: I6c7f45166b623f5f2b8bdfa7892605ae1b4f152d
2024-09-13 10:23:09 +02:00
Rodolfo Alonso Hernandez
5e29b1e826 Use the value of "ml2_plugin_config" when retrieving the ML2 conf file
The method ``get_ml2_conf_file`` now uses the configuration option
"ml2_plugin_config" instead of the hardcoded default value
"/etc/neutron/plugins/ml2/ml2_conf.ini"

Change-Id: Ib749d3b35ebaf030375160ebdc63b2ec4f73b959
2024-09-12 12:34:38 +00:00
Rodolfo Alonso Hernandez
284370494c Add OVN FDB aging scenario tests
The new test class checks the OVN FDB aging functionality implemented
in [1][2]

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

Related-Bug: #OSPRH-893
Change-Id: Id449a33365c5b3579f7bbf36a5becd5ca20f3e76
2024-09-12 12:33:48 +00:00
Zuul
a547366a47 Merge "Method to return the Neutron API service name" 2024-09-10 09:56:12 +00:00
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
Rodolfo Alonso Hernandez
57ead07a90 Method to return the Neutron API service name
Closes-Bug: #OSPRH-9825
Change-Id: I45e941873a640ea75a2a1db0e68fc6abc767e32e
2024-09-09 15:12:12 +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
Maor Blaustein
228f1b1436 Fix SGL tests log file for podified
Due to OSPRH-9248, security group logging writes to journal,
changed in tests accordingly to '/var/log/messages'.

Log rotation test will be skipped on podified.

Change-Id: I4402e777c5262da154bf56351fd57625108c0381
2024-09-04 14:19:19 +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