# Test code for the ACI modules # Copyright 2017, Jacob McGill 1 - query_all.previous.0.fvBD is defined - '"rsp-subtree-class=fvRsCtx,fvRsIgmpsn,fvRsBDToNdP,fvRsBdToEpRet" in query_all.filter_string' - '"class/fvBD.json" in query_all.url' - query_tenant.changed == false - query_tenant.previous | length == 1 - query_tenant.previous.0.fvTenant.children | length == 2 - '"rsp-subtree-class=fvRsCtx,fvRsIgmpsn,fvRsBDToNdP,fvRsBdToEpRet,fvBD" in query_tenant.filter_string' - '"tn-anstest.json" in query_tenant.url' - query_bd_bd.changed == false - query_bd_bd.previous != [] - '"query-target-filter=eq(fvBD.name, \"anstest\")" in query_bd_bd.filter_string' - '"rsp-subtree=full&rsp-subtree-class=fvRsCtx,fvRsIgmpsn,fvRsBDToNdP,fvRsBdToEpRet" in query_bd_bd.filter_string' - '"class/fvBD.json" in query_bd_bd.url' - query_bd.changed == false - query_bd.previous | length == 1 - 'query_bd.previous.0.fvBD.attributes.name == "anstest"' - '"rsp-subtree-class=fvRsCtx,fvRsIgmpsn,fvRsBDToNdP,fvRsBdToEpRet" in query_bd.filter_string' - '"tn-anstest/BD-anstest.json" in query_bd.url' - name: delete bd - check mode works aci_bd: &aci_bd_absent <<: *aci_bd_present state: absent check_mode: yes register: bd_absent_check_mode - name: delete bd - delete works aci_bd: <<: *aci_bd_absent register: bd_absent - name: delete bd again - idempotency works aci_bd: <<: *aci_bd_absent register: bd_absent_idempotent - name: delete bd - cleanup aci_bd: <<: *aci_bd_absent name: anstest2 - name: delete bd missing param - fails properly aci_bd: <<: *aci_bd_absent bd: "{{ fakevar | default(omit) }}" ignore_errors: yes register: bd_absent_missing_param - name: asserts for deletion task assert: that: - bd_absent_check_mode.changed == true - bd_absent_check_mode.proposed == {} - bd_absent.changed == true - bd_absent.previous != [] - bd_absent_idempotent.changed == false - bd_absent_idempotent.previous == [] - bd_absent_missing_param.failed == true - 'bd_absent_missing_param.msg == "state is absent but all of the following are missing: bd"' - name: delete vrf - cleanup before ending tests aci_vrf: <<: *aci_vrf_present state: absent when: vrf_present.changed == true - name: delete tenant - cleanup before ending tests aci_tenant: <<: *aci_tenant_present state: absent when: tenant_present.changed == true