# Test code for the ACI modules # Copyright 2017, Jacob McGill 1 - '"rsp-subtree-class=vzBrCP" in query_tenant.filter_string' - '"tn-anstest.json" in query_tenant.url' - query_name.changed == false - query_name.previous != [] - '"query-target-filter=eq(vzBrCP.name, \"anstest\")" in query_name.filter_string' - '"class/vzBrCP.json" in query_name.url' - query_all.changed == false - query_all.previous | length > 1 - '"class/vzBrCP.json" in query_all.url' - name: delete contract - check mode works aci_contract: &aci_contract_absent <<: *aci_contract_present state: absent check_mode: yes register: absent_check_mode - name: delete contract - deletion works aci_contract: <<: *aci_contract_absent register: contract_absent - name: delete contract - idempotency works aci_contract: <<: *aci_contract_absent register: absent_idempotent - name: delete contract - cleanup second contract aci_contract: <<: *aci_contract_absent contract: anstest2 - name: missing param - fail message works aci_contract: <<: *aci_contract_absent tenant: "{{ fakevar | default(omit) }}" ignore_errors: yes register: absent_missing_param - name: absent assertions assert: that: - absent_check_mode.changed == true - absent_check_mode.previous != [] - contract_absent.changed == true - contract_absent.previous == absent_check_mode.previous - absent_idempotent.changed == false - absent_idempotent.previous == [] - absent_missing_param.failed == true - 'absent_missing_param.msg == "state is absent but all of the following are missing: tenant"' - name: cleanup tenant aci_tenant: <<: *aci_tenant_present state: absent when: tenant_present.changed == true