[Fullstack] Fix waiting for packet with DSCP mark in test

In test_dscp_marking_packets, sender vm is sending ICMP packets to the
receiver_vm.
Before this patch even if first ICMP packet wasn't send properly, test
failed due to exception raised in execute method.

It can happend sometimes that first packet will fail to be send as there
can be e.g. some configuration on agent's side not done yet. So we
should try to ping receiver_vm for 60 seconds instead of failing on
first attempt.
This patch changes that behaviour in test.

Change-Id: Ic84e1ef507f017516d47a6b66e646e7e7b5ded8d
Closes-Bug: #1852724
This commit is contained in:
Slawek Kaplonski 2019-11-15 11:23:19 +01:00
parent 69646dc461
commit 458fd224db
1 changed files with 1 additions and 5 deletions

View File

@ -15,14 +15,12 @@
import re
import signal
import time
from oslo_log import log as logging
from neutron.agent.common import async_process
from neutron.agent.linux import iptables_manager
from neutron.common import utils as common_utils
from neutron.tests.common import net_helpers
LOG = logging.getLogger(__name__)
@ -112,9 +110,7 @@ def wait_for_dscp_marked_packet(sender_vm, receiver_vm, dscp_mark):
namespace=receiver_vm.namespace)
tcpdump_async.start(block=True)
with net_helpers.async_ping(sender_vm.namespace, [receiver_vm.ip]) as done:
while not done():
time.sleep(0.25)
sender_vm.block_until_ping(receiver_vm.ip)
try:
tcpdump_async.stop(kill_signal=signal.SIGINT)