Merge "Rename RyuNeighAdvertisementFilter class"
This commit is contained in:
commit
21cbb720f9
@ -614,7 +614,7 @@ class RyuFilterIcmpv6ProtocolType(object):
|
|||||||
return pkt_protocol.type_ == self.type_
|
return pkt_protocol.type_ == self.type_
|
||||||
|
|
||||||
|
|
||||||
class RyuNeighbAdvertisementFilter(RyuFilterIcmpv6ProtocolType):
|
class RyuNeighborAdvertisementFilter(RyuFilterIcmpv6ProtocolType):
|
||||||
"""Use ryu to parse the packet and test if it's a Neighbor Advertisement"""
|
"""Use ryu to parse the packet and test if it's a Neighbor Advertisement"""
|
||||||
type_ = icmpv6.ND_NEIGHBOR_ADVERT
|
type_ = icmpv6.ND_NEIGHBOR_ADVERT
|
||||||
|
|
||||||
|
@ -168,10 +168,10 @@ class TestArpResponder(test_base.DFTestBase):
|
|||||||
raise self.policy.exceptions[0]
|
raise self.policy.exceptions[0]
|
||||||
|
|
||||||
|
|
||||||
class TestNeighAdvertiser(test_base.DFTestBase):
|
class TestNeighborAdvertiser(test_base.DFTestBase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestNeighAdvertiser, self).setUp()
|
super(TestNeighborAdvertiser, self).setUp()
|
||||||
self.topology = None
|
self.topology = None
|
||||||
self.policy = None
|
self.policy = None
|
||||||
try:
|
try:
|
||||||
@ -206,12 +206,13 @@ class TestNeighAdvertiser(test_base.DFTestBase):
|
|||||||
ignore_action = app_testing_objects.IgnoreAction()
|
ignore_action = app_testing_objects.IgnoreAction()
|
||||||
log_action = app_testing_objects.LogAction()
|
log_action = app_testing_objects.LogAction()
|
||||||
key1 = (subnet1.subnet_id, port1.port_id)
|
key1 = (subnet1.subnet_id, port1.port_id)
|
||||||
|
adv_filter = app_testing_objects.RyuNeighborAdvertisementFilter()
|
||||||
port_policies = {
|
port_policies = {
|
||||||
key1: app_testing_objects.PortPolicy(
|
key1: app_testing_objects.PortPolicy(
|
||||||
rules=[
|
rules=[
|
||||||
app_testing_objects.PortPolicyRule(
|
app_testing_objects.PortPolicyRule(
|
||||||
# Detect advertisements
|
# Detect advertisements
|
||||||
app_testing_objects.RyuNeighbAdvertisementFilter(),
|
adv_filter,
|
||||||
actions=[
|
actions=[
|
||||||
log_action,
|
log_action,
|
||||||
app_testing_objects.StopSimulationAction()
|
app_testing_objects.StopSimulationAction()
|
||||||
@ -265,7 +266,7 @@ class TestNeighAdvertiser(test_base.DFTestBase):
|
|||||||
return result.data
|
return result.data
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(TestNeighAdvertiser, self).tearDown()
|
super(TestNeighborAdvertiser, self).tearDown()
|
||||||
self.topology.close()
|
self.topology.close()
|
||||||
self.policy.close()
|
self.policy.close()
|
||||||
utils.execute(['sysctl', '-w', 'net.ipv6.conf.default.accept_dad={}'.
|
utils.execute(['sysctl', '-w', 'net.ipv6.conf.default.accept_dad={}'.
|
||||||
|
Loading…
Reference in New Issue
Block a user