# Test code for the ACI modules # Copyright 2017, Jacob McGill 1 - get_all_tenant.changed == false - '"tn-anstest.json" in get_all_tenant.url' - get_all_bd.changed == false - '"query-target-filter=eq(fvBD.name, \"anstest\")" in get_all_bd.filter_string' - '"class/fvBD.json" in get_all_bd.url' - get_all_tenant_bd.changed == false - '"tn-anstest/BD-anstest.json" in get_all_tenant_bd.url' - get_all_tenant_bd.existing.0.fvBD.children | length > 1 - get_subnet_tenant.changed == false - '"rsp-subtree-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnet_tenant.filter_string' - '"tn-anstest.json" in get_subnet_tenant.url' - get_subnet_bd.changed == false - '"query-target-filter=eq(fvBD.name, \"anstest\")" and "rsp-subtree-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnet_bd.filter_string' - '"class/fvBD.json" in get_subnet_bd.url' - get_subnet.changed == false - get_subnet.existing | length == 1 - '"tn-anstest/BD-anstest/subnet-[10.100.100.1/24].json" in get_subnet.url' - get_subnets_gateway.changed == false - '"query-target-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnets_gateway.filter_string' - '"class/fvSubnet.json" in get_subnets_gateway.url' - name: delete subnet - check mode works aci_bd_subnet: <<: *aci_subnet_absent check_mode: yes register: delete_check_mode - name: delete subnet - delete works aci_bd_subnet: <<: *aci_subnet_absent register: delete_subnet - name: delete subnet - cleanup aci_bd_subnet: <<: *aci_subnet2_absent - name: delete subnet again - idempotency works aci_bd_subnet: <<: *aci_subnet2_absent register: delete_idempotency - name: asserts for deletion task assert: that: - delete_check_mode.changed == true - delete_check_mode.proposed == {} - delete_subnet.changed == true - delete_subnet.existing != [] - 'delete_subnet.method == "DELETE"' - delete_idempotency.changed == false - delete_idempotency.existing == [] - name: delete bd - cleanup before ending tests aci_bd: <<: *aci_bd_present state: absent when: bd_present.changed == true - name: delete tenant - cleanup before ending tests aci_tenant: <<: *aci_tenant_present state: absent when: tenant_present.changed == true