File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
tests/integration/targets/vpc_ip_list/tasks Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 80
80
linode.cloud.vpcs_ip_list :
81
81
register : all_vpc_ips
82
82
83
- - name : Assert VPC IPs were returned
83
+ - name : Assert at least one VPC IP belongs to the created VPC
84
84
assert :
85
85
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
88
87
89
88
- name : List VPC IPs for a specific VPC
90
89
linode.cloud.vpc_ip_list :
91
90
vpc_id : ' {{ create_vpc.vpc.id }}'
92
91
register : vpcs_ips
93
92
94
- - name : Assert VPC IPs were returned
93
+ - name : Assert all returned VPC IPs belong to the created VPC
95
94
assert :
96
95
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
99
98
100
99
always :
101
100
- ignore_errors : true
You can’t perform that action at this time.
0 commit comments