network/tests/tasks/assert_may_fail.yml
Wen Liang d92baacf1f feat: Support wait_ip property
Add support for the `wait_ip` property, the system will consider
connection activated only when specific IP stack is configured.
This enables flexibility in scenarios such as
IPv6-only networks, where the overall network configuration can still
succeed when IPv4 configuration fails but IPv6 completes successfully.

The `wait_ip` can be configured with the following possible values:
  * "any": System will consider interface activated when any IP stack is
           configured.
  * "ipv4": System will wait IPv4 been configured.
  * "ipv6": System will wait IPv6 been configured.
  * "ipv4+ipv6": System will wait both IPv4 and IPv6 been configured.

Resolves: https://issues.redhat.com/browse/RHEL-63026

Signed-off-by: Wen Liang <wenliang@redhat.com>
2024-10-29 09:43:38 -04:00

30 lines
938 B
YAML

# SPDX-License-Identifier: BSD-3-Clause
---
- name: Get ipv4.may-fail
command: >
nmcli -f ipv4.may-fail connection show {{ profile }}
register: may_fail4
ignore_errors: true
changed_when: false
- name: Get ipv6.may-fail
command: >
nmcli -f ipv6.may-fail connection show {{ profile }}
register: may_fail6
ignore_errors: true
changed_when: false
- name: "Assert that ipv4.may-fail is configured as specified"
assert:
that:
- may_fail4.stdout.split(":")[1] | trim
== "no"
msg: "ipv4.may-fail is configured as
{{ may_fail4.stdout.split(':')[1] | trim }}
but wait_ip is specified as {{ wait_ip }}"
- name: "Assert that ipv6.may-fail is configured as specified"
assert:
that:
- may_fail6.stdout.split(":")[1] | trim
== "no"
msg: "ipv6.may-fail is configured as
{{ may_fail6.stdout.split(':')[1] | trim }}
but wait_ip is specified as {{ wait_ip }}"