@@ -489,6 +489,48 @@ def test_filter_ipv4_ingress_protocol_encap_by_num(self):
489489 egress = None
490490 self ._test_prepare_port_filter (rule , ingress , egress )
491491
492+ def test_filter_ipv4_ingress_protocol_ipip (self ):
493+ # We want to use what the system-dependent string here is for 'ipip',
494+ # as it could be 'ipencap' or 'ipv4' depending on the distro.
495+ # See bug #2054324.
496+ rule = {'ethertype' : 'IPv4' ,
497+ 'direction' : 'ingress' ,
498+ 'protocol' : 'ipip' }
499+ expected_proto_name = self .firewall ._iptables_protocol_name ('ipip' )
500+ ingress = mock .call .add_rule ('ifake_dev' ,
501+ '-p %s -j RETURN' % expected_proto_name ,
502+ top = False , comment = None )
503+ egress = None
504+ self ._test_prepare_port_filter (rule , ingress , egress )
505+
506+ def test_filter_ipv4_ingress_protocol_4 (self ):
507+ # We want to use what the system-dependent string here is for '4',
508+ # as it could be 'ipencap' or 'ipv4' depending on the distro.
509+ # See bug #2054324.
510+ rule = {'ethertype' : 'IPv4' ,
511+ 'direction' : 'ingress' ,
512+ 'protocol' : '4' }
513+ expected_proto_name = self .firewall ._iptables_protocol_name ('4' )
514+ ingress = mock .call .add_rule ('ifake_dev' ,
515+ '-p %s -j RETURN' % expected_proto_name ,
516+ top = False , comment = None )
517+ egress = None
518+ self ._test_prepare_port_filter (rule , ingress , egress )
519+
520+ def test_filter_ipv4_ingress_protocol_94 (self ):
521+ # We want to use what the system-dependent string here is for '94',
522+ # as it could be 'ipip' or something else depending on the distro.
523+ # See bug #2054324.
524+ rule = {'ethertype' : 'IPv4' ,
525+ 'direction' : 'ingress' ,
526+ 'protocol' : '94' }
527+ expected_proto_name = self .firewall ._iptables_protocol_name ('94' )
528+ ingress = mock .call .add_rule ('ifake_dev' ,
529+ '-p %s -j RETURN' % expected_proto_name ,
530+ top = False , comment = None )
531+ egress = None
532+ self ._test_prepare_port_filter (rule , ingress , egress )
533+
492534 def test_filter_ipv4_ingress_protocol_999_local (self ):
493535 # There is no protocol 999, so let's return a mapping
494536 # that says there is and make sure the rule is created
0 commit comments