'Verify security group rule for icmp protocol works.
Specify icmp type (port_range_min) and icmp code
(port_range_max) with different values. A separate testcase
is added for icmp protocol as icmp validation would be
different from tcp/udp.'

@decorators.idempotent_id('c9463db8-b44d-4f52-b6c0-8dbda99f26ce')
def test_create_security_group_rule_with_icmp_type_code(self):

    (group_create_body, _) = self._create_security_group()
    sg_id = group_create_body['security_group']['id']
    direction = 'ingress'
    protocol = 'icmp'
    icmp_type_codes = [(3, 2), (3, 0), (8, 0), (0, 0), (11, None)]
    for (icmp_type, icmp_code) in icmp_type_codes:
        self._create_verify_security_group_rule(sg_id, direction, self.ethertype, protocol, icmp_type, icmp_code)
