]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Increase max attempts to 2 for pings on ARP tests
authorKevin Benton <blak111@gmail.com>
Tue, 31 Mar 2015 18:20:18 +0000 (11:20 -0700)
committerKevin Benton <blak111@gmail.com>
Tue, 31 Mar 2015 18:20:18 +0000 (11:20 -0700)
If the server under test is under heavy load, the requirement
of the very first ping passing may be too strict. This patch
increases the max attempts to 2 for the ARP spoofing tests to
give time for the OVS flow changes to take effect.

Change-Id: Ib70790da23861a8ed9c77f9c11aaf8fa41bf581c
Closes-Bug: #1443916

neutron/tests/functional/agent/test_ovs_flows.py

index 9fe1ffc47ff48424995139255e0f17b024d56e18..c012880a555777f0cadc361061619489ce4590c2 100644 (file)
@@ -35,6 +35,7 @@ class ARPSpoofTestCase(test_ovs_lib.OVSBridgeTestBase,
         self.dst_addr = '192.168.0.2'
         self.src_ns = self._create_namespace()
         self.dst_ns = self._create_namespace()
+        self.pinger = helpers.Pinger(self.src_ns, max_attempts=2)
         self.src_p = self.useFixture(
             net_helpers.OVSPortFixture(self.br, self.src_ns.namespace)).port
         self.dst_p = self.useFixture(
@@ -47,8 +48,7 @@ class ARPSpoofTestCase(test_ovs_lib.OVSBridgeTestBase,
         self._setup_arp_spoof_for_port(self.dst_p.name, [self.dst_addr])
         self.src_p.addr.add('%s/24' % self.src_addr)
         self.dst_p.addr.add('%s/24' % self.dst_addr)
-        pinger = helpers.Pinger(self.src_ns)
-        pinger.assert_ping(self.dst_addr)
+        self.pinger.assert_ping(self.dst_addr)
 
     def test_arp_spoof_blocks_response(self):
         # this will prevent the destination from responding to the ARP
@@ -56,16 +56,14 @@ class ARPSpoofTestCase(test_ovs_lib.OVSBridgeTestBase,
         self._setup_arp_spoof_for_port(self.dst_p.name, ['192.168.0.3'])
         self.src_p.addr.add('%s/24' % self.src_addr)
         self.dst_p.addr.add('%s/24' % self.dst_addr)
-        pinger = helpers.Pinger(self.src_ns)
-        pinger.assert_no_ping(self.dst_addr)
+        self.pinger.assert_no_ping(self.dst_addr)
 
     def test_arp_spoof_allowed_address_pairs(self):
         self._setup_arp_spoof_for_port(self.dst_p.name, ['192.168.0.3',
                                                          self.dst_addr])
         self.src_p.addr.add('%s/24' % self.src_addr)
         self.dst_p.addr.add('%s/24' % self.dst_addr)
-        pinger = helpers.Pinger(self.src_ns)
-        pinger.assert_ping(self.dst_addr)
+        self.pinger.assert_ping(self.dst_addr)
 
     def test_arp_spoof_disable_port_security(self):
         # block first and then disable port security to make sure old rules
@@ -75,8 +73,7 @@ class ARPSpoofTestCase(test_ovs_lib.OVSBridgeTestBase,
                                        psec=False)
         self.src_p.addr.add('%s/24' % self.src_addr)
         self.dst_p.addr.add('%s/24' % self.dst_addr)
-        pinger = helpers.Pinger(self.src_ns)
-        pinger.assert_ping(self.dst_addr)
+        self.pinger.assert_ping(self.dst_addr)
 
     def _setup_arp_spoof_for_port(self, port, addrs, psec=True):
         of_port_map = self.br.get_vif_port_to_ofport_map()