Skip to content

Commit db3480f

Browse files
authored
fix the failing test in TOD for Ansible_linode (#667)
* adding blank line * fix_test
1 parent d3dd19d commit db3480f

File tree

1 file changed

+5
-6
lines changed
  • tests/integration/targets/vpc_ip_list/tasks

1 file changed

+5
-6
lines changed

tests/integration/targets/vpc_ip_list/tasks/main.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,21 @@
8080
linode.cloud.vpcs_ip_list:
8181
register: all_vpc_ips
8282

83-
- name: Assert VPC IPs were returned
83+
- name: Assert at least one VPC IP belongs to the created VPC
8484
assert:
8585
that:
86-
- all_vpc_ips.vpcs_ips[0].vpc_id == create_vpc.vpc.id
87-
- all_vpc_ips.vpcs_ips[1].vpc_id == create_vpc.vpc.id
86+
- create_vpc.vpc.id in all_vpc_ips.vpcs_ips | map(attribute='vpc_id') | list
8887

8988
- name: List VPC IPs for a specific VPC
9089
linode.cloud.vpc_ip_list:
9190
vpc_id: '{{ create_vpc.vpc.id }}'
9291
register: vpcs_ips
9392

94-
- name: Assert VPC IPs were returned
93+
- name: Assert all returned VPC IPs belong to the created VPC
9594
assert:
9695
that:
97-
- vpcs_ips.vpcs_ips[0].vpc_id == create_vpc.vpc.id
98-
- vpcs_ips.vpcs_ips[1].vpc_id == create_vpc.vpc.id
96+
- vpcs_ips.vpcs_ips | length > 0
97+
- vpcs_ips.vpcs_ips | selectattr('vpc_id', 'equalto', create_vpc.vpc.id) | list | length == vpcs_ips.vpcs_ips | length
9998

10099
always:
101100
- ignore_errors: true

0 commit comments

Comments
 (0)