From c808c3505324c64ca71c2f11f0ef5dd2b451a30c Mon Sep 17 00:00:00 2001 From: davidtclin Date: Tue, 3 Oct 2023 00:53:39 +0800 Subject: [PATCH] Add checking point to determine whether the interface ipAddress contains digit. To prevent the unexpected case when the interface can't retrieve ip address from external vlan which cause test case `test_vlan_to_mgmt_connection` failed. --- harvester_e2e_tests/integration/test_networks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/harvester_e2e_tests/integration/test_networks.py b/harvester_e2e_tests/integration/test_networks.py index d8b5a62a1..8550d5032 100644 --- a/harvester_e2e_tests/integration/test_networks.py +++ b/harvester_e2e_tests/integration/test_networks.py @@ -567,7 +567,11 @@ def test_mgmt_to_vlan_connection(self, api_client, request, client, unique_name, interfaces_data = data['status']['interfaces'] ip_addresses = [] for interface in interfaces_data: - if 'ipAddress' in interface: + # Check the ipAddress in digital format + if ( + 'ipAddress' in interface and + interface['ipAddress'].replace('.', '').isdigit() + ): ip_addresses.append(interface['ipAddress']) if len(ip_addresses) > 0: