Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/observability/metrics/test_vms_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,37 @@ def test_metric_kubevirt_vmi_vnic_info_windows(self, prometheus, windows_vm_for_
metric_name=f"kubevirt_vmi_vnic_info{{name='{windows_vm_for_test.name}'}}",
)

@pytest.mark.parametrize(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the stp link?
reference #4734

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"query",
[
pytest.param(
"kubevirt_vm_vnic_info{{name='{vm_name}', vnic_name='secondary'}}",
marks=pytest.mark.polarion("CNV-12225"),
),
pytest.param(
"kubevirt_vmi_vnic_info{{name='{vm_name}', vnic_name='secondary'}}",
marks=pytest.mark.polarion("CNV-12226"),
),
],
)
def test_metric_kubevirt_vm_vnic_info_after_nad_swap(self, query):
"""
Test that vnic_info metric updates the network label after a NAD swap.

Preconditions:
- Two Network Attachment Definitions (NAD-A, NAD-B) with different VLANs on the same Linux bridge
- Running VM with a secondary bridge interface attached to NAD-A

Steps:
1. Swap the VM secondary network reference from NAD-A to NAD-B
2. Query vnic_info metric for the secondary interface

Expected:
- vnic_info labels match the VM spec after NAD swap
"""

test_metric_kubevirt_vm_vnic_info_after_nad_swap.__test__ = False
Comment thread
OhadRevah marked this conversation as resolved.


class TestVmiPhaseTransitionFromDeletion:
@pytest.mark.polarion("CNV-12990")
Expand Down