def test_icmp_rule_created_on_apic(self):
        pr = self._create_simple_policy_rule('in', 'icmp', None)
        tenant = pr['tenant_id']

        mgr = self.driver.apic_manager
        expected_calls = [
            mock.call(pr['id'], owner=tenant, entry='os-entry-0', etherT='ip',
                      prot='icmp', transaction=mock.ANY),
            mock.call(amap.REVERSE_PREFIX + pr['id'], owner=tenant,
                      entry=mock.ANY, etherT='ip', icmpv4T='echo-rep',
                      prot='icmp', transaction=mock.ANY),
            mock.call(amap.REVERSE_PREFIX + pr['id'], owner=tenant,
                      entry=mock.ANY, etherT='ip', icmpv4T='dst-unreach',
                      prot='icmp', transaction=mock.ANY),
            mock.call(amap.REVERSE_PREFIX + pr['id'], owner=tenant,
                      entry=mock.ANY, etherT='ip', icmpv4T='src-quench',
                      prot='icmp', transaction=mock.ANY),
            mock.call(amap.REVERSE_PREFIX + pr['id'], owner=tenant,
                      entry=mock.ANY, etherT='ip', icmpv4T='time-exceeded',
                      prot='icmp', transaction=mock.ANY)]
        # verify that entry is always different
        found = set()
        for call in mgr.create_tenant_filter.call_args_list:
            # Only for reverse filters
            if call[0][0].startswith(amap.REVERSE_PREFIX):
                self.assertFalse(call[1]['entry'] in found)
                found.add(call[1]['entry'])

        self._check_call_list(
            expected_calls, mgr.create_tenant_filter.call_args_list)
dataset/ETHPy150Open openstack/group-based-policy/gbpservice/neutron/tests/unit/services/grouppolicy/test_apic_mapping.py/TestPolicyRule.test_icmp_rule_created_on_apic/original