Skip to content

Commit

Permalink
Add checking point to determine whether the interface ipAddress contains
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TachunLin committed Nov 23, 2023
1 parent 8873d8f commit c808c35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion harvester_e2e_tests/integration/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c808c35

Please sign in to comment.